Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CodeDom provider can't be located after another application deployed

I had two web applications deployed in a site under IIS 7.5

site.com/myApp site.com/anotherMyApp

Now another devs deployed their app as root application

site.com/

Now when I access site.com/myApp or /anotherMyApp it throws:

The CodeDom provider type "Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" could not be located.

Source error :

Line 54:   <system.codedom>
Line 55:     <compilers>
Line 56:       <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" />
Line 57:       <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
Line 58:     </compilers>

Source File: C:\inetpub\wwwrootprettysite\THEIR APPLICATION\web.config

Questions

Why is this happening?
Why is the "source error" in their application's webconfig and how does it affect my application?
How do I fix my applications without breaking theirs?

To clarify :

  • Application hierarchy is correct, their application should be
    installed in root.
  • .NET framework installed is 4.5.2
  • Their application is using Roslyn compiler which is supplied in bin/roslyn
  • My applications web.configs have no <system.codedom> section.
like image 542
evictednoise Avatar asked May 11 '16 12:05

evictednoise


People also ask

What is Microsoft CodeDOM?

The CodeDOM provides types that represent many common types of source code elements. You can design a program that builds a source code model using CodeDOM elements to assemble an object graph. This object graph can be rendered as source code using a CodeDOM code generator for a supported programming language.

What is System CodeDOM?

The <system. codedom> element contains compiler configuration settings for language providers installed on a computer in addition to the default providers that are installed with the . NET Framework, such as the CSharpCodeProvider and the VBCodeProvider.

What is DotNetCompilerPlatform?

DotNetCompilerPlatform 1.0. 2 package is released on NuGet. It enables ASP.NET to support the new language features and improves the compilation performance. To install this NuGet package, open NuGet Package Manager in visual studio, search Microsoft. CodeDom.


1 Answers

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
like image 118
mattfei Avatar answered Sep 29 '22 11:09

mattfei