Does Roslyn have a hard dependency on Visual Studio?

Topics: APIs
Jun 23, 2014 at 5:53 AM
Edited Jun 23, 2014 at 9:50 AM
Instantiating a CustomWorkspace throws a ReflectionTypeLoadException for me unless the following assemblies are available:

Microsoft.Build.dll (version 12)
Microsoft.Build.Tasks.V12.0.dll

As I understand, these assemblies are part of Visual Studio 2014. Does this mean that the Roslyn workspaces layer is usable only if Visual Studio is installed?

Here's how I'm instantiating a CustomWorkspace:
MefHostServices services = MefHostServices.Create (new[]
{ 
    typeof(MefHostServices).Assembly,
    typeof(Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions).Assembly
});
            
var workspace = new CustomWorkspace (services);    // throws unless above assemblies are present
And if Roslyn workspaces does depend on VS2014, will this remain the case going forward? Will we be able to use Roslyn services like code formatting without VS installed?

Thanks
Joe
Aug 1, 2014 at 11:56 AM
Hi Joe!

Please see here: https://roslyn.codeplex.com/workitem/218
Build Tools 2013 installer (http://www.microsoft.com/en-us/download/details.aspx?id=40760) should solve things for you.

~Michael
Aug 2, 2014 at 10:30 AM
Thanks, Michael

I was hoping to use Roslyn for autocompletion in LINQPad, as a replacement for the SharpDevelop libraries. Unfortunately, I can't demand that users of LINQPad install Microsoft Build Tools 2013 as a prerequisite, so Roslyn is useless to me.

I could reinvent the workspaces layer and consume just the syntactic/semantic model libraries. But then how can I be sure that in future releases, a dependency on Build Tools won't be introduced into those libraries as well?

This is a shame, because LINQPad was supposed to be one of the target scenarios for Roslyn. I don't understand why Roslyn should depend on Build Tools. Shouldn't it be the other way round?

Joe
Coordinator
Aug 2, 2014 at 5:33 PM
The workspaces layer has a dependency on the build tools because it uses MSBuild to be able to open projects and solutions in the MSBuildWorkspace type.

We plan on extracting that dependency into a separate assembly soon however, since we would like to make the core of the Workspaces layer portable.
Marked as answer by TomasMatousek on 8/2/2014 at 11:45 PM
Feb 3, 2015 at 6:42 AM
Has there been any progress on this? The workspaces layer in the most recent CTP still seems to depend on MSBuild.
Coordinator
Feb 3, 2015 at 3:58 PM
We haven't made any progress here. We're focused mostly on doing what we need to in order to ship VS 2015, and since this isn't a requirement for that, we may not get to it for a while. I did file https://github.com/dotnet/roslyn/issues/212 to make sure it's at least tracked though.