1
votes

I have a project that compiles and runs fine in VS2015 version=14.0.25431.01 Update 3. Everything is great and works perfectly.

I then installed VS2017 version=15.4.2 and the project now refuses to compile with the error:

Error An Exception was thrown while running the transformation code. The process cannot continue. The following Exception was thrown: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.CodeAnalysis, Version=1.3.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.CodeAnalysis, Version=1.3.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' at Microsoft.VisualStudio.TextTemplating.CompilerBridge..ctor(String source, Boolean debug, IEnumerable1 references, String cmdLineArguments) at Microsoft.VisualStudio.TextTemplating.CompilerBridge.Create(SupportedLanguage language, String source, Boolean debug, IEnumerable1 references, String cmdLineArguments) at Microsoft.VisualStudio.TextTemplating.TransformationRunner.Compile(String source, String inputFile, IEnumerable1 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, IEnumerable1 compilerReferences, String compilerOptions) at Microsoft.VisualStudio.TextTemplating.TransformationRunner.PrepareTransformation(TemplateProcessingSession session, String source, ITextTemplatingEngineHost host)

I have tried updating the Nuget package Microsoft.CodeDom.Providers.DotNetCompilerPlatform but no luck.

Any help would be appreciated,

Terry

1

1 Answers

0
votes

We ended up removing the T4 Template Text Transmutation code that we were using and this fixed the problem.

Not the ideal solution, but good enough. For anyone else that encounters this problem there are two threads that had some suggestions:

MSBuild support for T4 templates in Visual Studio 2017 RTM

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