Hi I use roslyn Microsoft.CodeAnalysis.Csharp dlls in my vs2015 extension,I upgraded my visual studio extension project to visual studio 2013 to 2015. but only My roslyn dll's are not copied when I want to install extension.My target framework is still same (.net 4.5.0). and I check nuget.org to new roslyn dlls ,Supported version looks same.I try to upgrade my roslyn versions but result is same. If I manually copy to extension path roslyn dlls that time myextension is working. Is there any Idea about that?
Asked
Active
Viewed 405 times
3
2 Answers
3
In visual studio 2015 vsix projects some dlls like Microsoft.CodeAnalysis.dll not copied to extension path.You can add
<ForceIncludeInVSIX>true</ForceIncludeInVSIX>
tag inside your reference tag like.
<Reference Include="Microsoft.CodeAnalysis.dll, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<ForceIncludeInVSIX>true</ForceIncludeInVSIX>
</Reference>
For details you can check this site... http://comealive.io/Forcing-DLLs-To-Vsix/

Bilgehan
- 1,135
- 1
- 14
- 41
2
Roslyn is included with Visual Studio; you should not include Roslyn DLLs in your VSIX.
If you do, you may get lots of strange errors from loading a different copy of the DLLs.

SLaks
- 868,454
- 176
- 1,908
- 1,964
-
1Occasionally it's useful. For example if you want to ship the DLLs in a VSIX that also targets VS 2013. That said, people should definitely be aware of the risks. – JoshVarty Dec 29 '16 at 19:38
-
agree it's part of VS 2015, however, when I created an extension in VS 2017, using Roslyn NuGet packages, VS 2015 does not see them. Frustrating. – May 03 '17 at 16:43
-
@Karl: You need to reference the lowest version of Roslyn / VS that you want your extension to support. – SLaks May 03 '17 at 16:52
-
@SLaks OK makes sense. I'll spin up a VM, install VS 2015 and see what version of Roslyn that is installed and give this a go. – May 04 '17 at 10:36