簡體   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