The Codedom Provider Type "Microsoft.Codedom.Providers.Dotnetcompilerplatform.Csharpcodeprovider" Could Not Be Located

CodeDom provider can't be located after another application deployed

Your app inherits the config from its parent app, and your app doesn't have Microsoft.CodeDom.Providers.DotNetCompilerPlatform. That's why you see that error. There are several options.

  1. Override system.codedom setting in your web.config
  2. Install Microsoft.CodeDom.Providers.DotNetCompilerPlatform nupkg in your app

C# extension failure

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>

IIS 7 unable to find Microsoft.CodDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider DLL

So this was caused because I had nested all the assemblies for the site under a folder with the configurations name like you would do in a console/windows app (e.g. 'bin\Debug'). For web applications, the assemblies do not get nested under a config folder (e.g. they should go in 'bin\').

Hope this helps others!



Related Topics



Leave a reply



Submit