c# - Use Roslyn MSBuildWorkspace with Visual Studio 2013 -



c# - Use Roslyn MSBuildWorkspace with Visual Studio 2013 -

for master thesis i'm building visual studio plugin should perform code-analysis of current opened solution. in order i've decided seek utilize roslyn, using corresponding nuget package.

everything works fine (syntaxtree navigating code,...) until i've tried utilize msbuildworkspace.create(). lastly phone call causes next exception:

could not load file or assembly 'microsoft.build, version=14.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a' or 1 of dependencies. scheme cannot find file specified.":"microsoft.build, version=14.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a

i found 2 posts:

creating new microsoft.codeanalysis.customworkspace - got reflectiontypeloadexception msbuildworkspace.create() throws exception

from understand need msbuild tools visual studio 14, in related iso.

i not want install total visual studio 14, because plugin i'm writing should run under visual studio 2013. 2 post seems can install part of vs 14.

my question is: if install msbuild tools visual studio 14 happen other visual studio projects i'm working on? @ moment utilize msbuild tool of visual studio 2013. it's possible still utilize that?

update

what i'm acctually trying find if given method has references within project. thought proceed in this post.

when you're building plugin visual studio, if care getting workspace open solution (i.e. code user editing), shouldn't utilize msbuildworkspace, ever. that's type loading things outside of visual studio. can if you're in product mef [import] microsoft.visualstudio.languageservices.visualstudioworkspace. gives live access user has open, , avoids running msbuild entirely.

note you're still going have careful selection of reference assemblies build against: if utilize latest nuget packages won't work since differ in version (and apis -- changed bunch of stuff) in lastly visual studio 2013 preview.

c# roslyn

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -