Hello,
I have had problems with some conflict between compiler versions.
I see that when I create a new project in VS, choosing template : "ASP.NET Web Application (.NET Framework)", a blank project, there is an installed Nuget package, "Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1" - is that how it is supposed to be?
The default Web.config has this info:
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=####" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701" />
(and so on)
And there is a packages.config that looks like this:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="2.0.1" targetFramework="net472" />
</packages>
At "Managed Nuget packages" I see the Microsoft.CodeDom.Providers.DotNetCompilerPlatform version 2.01
I can upgrade it there to 3.6.
But if I create a new project it is still set to the old version 2.01
So if every new project should have this package, where can I change the default version of it?
Shouldn't it have the latest version as default?
Welcome to Microsoft Q&A!
Which version of Visual Studio are you using?
Based on my testing, the default version of Microsoft.CodeDom.Providers.DotNetCompilerPlatform is version 2.0.1.
If you want to update the default NuGet package, you need to update the project template itself. You can refer to the Xavier Decoster's blog.
But it is not recommended that you do this. It is risky, because manual updates might corrupt the template if the latest version of all dependencies are not compatible with each other.
And I suggest you update the NuGet package from Manage NuGet Pacages.
Sincerely,
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.