参考Collections.Immutable在visual studio扩展

时间:2018-05-16 17:46:08

标签: c# vsix

我有一个可视工作室扩展(对于VS 2017),它在一些函数和引用System.Collections.Immutable, Version=1.2.2.0中使用Roslyn。当我第一次运行它时,它会抱怨它没有引用System.Collections.Immutable程序集,所以我在source.extensions.vsixmanifest中添加了资产(以及Microsoft.CodeAnalysis.CSharp.dll和发生了Microsoft.CodeAnalysis.dll

这解决了我丢失装配的问题,但现在我得到了:

  

找不到方法:' System.Collections.Immutable.ImmutableArray`1 Microsoft.CodeAnalysis.Scripting.Script.Compile(System.Threading.CancellationToken)'。

我相信它可能仍在引用不同版本的System.Collections.Immutable,同时调试扩展程序,如果我尝试这样做:

System.Reflection.Assembly.GetAssembly(typeof(System.Collections.Immutable.ImmutableArray))

我明白了:

  

错误CS0433:类型' ImmutableArray'存在于' System.Collections.Immutable,Version = 1.2.2.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a'和' System.Core,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089'

有没有办法在扩展程序中解决这个问题? (.config程序集重定向等内容除非您编辑Visual Studio自己的.config,否则我的确无法正常工作。

0 个答案:

没有答案
相关问题