繁体   English   中英

将项目从VS2015升级到VS2017会导致CodeAnalysis错误

[英]Upgrading Project From VS2015 to VS2017 leads to CodeAnalysis error

我有一个可以在VS2015 version = 14.0.25431.01 Update 3中编译并正常运行的项目。一切都很好,并且运行良好。

然后我安装了VS2017 version = 15.4.2,该项目现在拒绝编译并显示以下错误:

错误运行转换代码时引发异常。 该过程无法继续。 引发了以下异常:System.IO.FileNotFoundException:无法加载文件或程序集“ Microsoft.CodeAnalysis,版本= 1.3.1.0,区域性=中性,PublicKeyToken = 31bf3856ad364e35”或其依赖项之一。 该系统找不到指定的文件。 文件名:Microsoft.VisualStudio.TextTemplating.CompilerBridge..ctor(Microsoft.CodeAnalysis,Version = 1.3.1.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35)(String source,Boolean debug,IEnumerable 1 references, String cmdLineArguments) at Microsoft.VisualStudio.TextTemplating.CompilerBridge.Create(SupportedLanguage language, String source, Boolean debug, IEnumerable Visual Studio.TextTemplating.CompilerBridge.Create 1 references, String cmdLineArguments) at Microsoft.VisualStudio.TextTemplating.CompilerBridge.Create(SupportedLanguage language, String source, Boolean debug, IEnumerable 1引用,字符串cmdLineArguments)在Microsoft.VisualStudio.TextTemplating.TransformationRunner.Compile(字符串源,字符串inputFile,IEnumerable 1 references, Boolean debug, SupportedLanguage language, String compilerOptions) at Microsoft.VisualStudio.TextTemplating.TransformationRunner.LocateAssembly(Boolean cacheAssemblies, String fullClassName, String source, String inputFile, Boolean debug, SupportedLanguage language, IEnumerable 1编译器参考,字符串编译器选项) (TemplateProcessingSession会话,因此 urce,ITextTemplatingEngineHost主机)

我尝试更新Nuget包Microsoft.CodeDom.Providers.DotNetCompilerPlatform,但是没有运气。

任何帮助,将不胜感激,

特里

我们最终删除了所使用的T4模板文本转换代码,从而解决了该问题。

不是理想的解决方案,但足够好。 对于其他遇到此问题的人,有两个线程有​​一些建议:

MSBuild对Visual Studio 2017 RTM中的T4模板的支持

https://social.msdn.microsoft.com/Forums/zh-CN/424885d8-8247-4632-ba3f-da75cd18d304/upgrading-project-from-vs2015-to-vs2017-leads-to-codeanalysis-error?forum= visualstudiogeneral&prof =必填

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM