Reputation: 313
I have published my site out to local IIS, but when I launch the site I get the following error:
the CodeDom provider type "Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" could not be located.
I have built the application on .NET version 4.6. I have thought about building on 4.7.2, but wasn't sure if that would fix this issue.
Upvotes: 0
Views: 8859
Reputation: 1
I think you have to choose 1 of 2 ways to add this CodeDom Using package config or nuget to install as reference to your proj or using web.config. I prefer nuget option and remove <system.codedom>
Upvotes: 0
Reputation: 2211
What worked for me was adding the following lines on the Web.config, that for some reason were not present:
<system.codedom>
<compilers>
<compiler extension=".cs" language="c#;cs;csharp" warningLevel="4" compilerOptions="/langversion:7.3 /nowarn:1659;1699;1701;612;618" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<compiler extension=".vb" language="vb;vbs;visualbasic;vbscript" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008,40000,40008 /define:_MYTYPE=\"Web\" /optionInfer+" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</compilers>
</system.codedom>
Upvotes: 1