Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What exactly does <system.codedom>/<compilers> do in web.config in MVC 5?

I am about to migrate a bunch of projects from .NET 4.0 + MVC 3 to .NET 4.5.2 + MVC5.

To make this easier, I've created a new blank MVC project to compare DLL references and some other stuff such as web.config.

In the latter, the following entries are generated by Visual Studio:

<system.codedom>     <compilers>       <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"/>       <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+"/>     </compilers> </system.codedom> 

But I don't know what this does exactly. The MVC 3 projects don't contain these parts. My understanding is it has something to do with Roslyn?

like image 788
MarioDS Avatar asked Dec 31 '15 11:12

MarioDS


People also ask

What is System CodeDOM compiler?

Contains types for managing the generation and compilation of source code in supported programming languages. Code generators can each produce source code in a particular programming language based on the structure of Code Document Object Model (CodeDOM) source code models consisting of elements provided by the System.

What is System CodeDOM compiler GeneratedCodeAttribute?

The GeneratedCodeAttribute class can be used by code analysis tools to identify computer-generated code, and to provide an analysis based on the tool and the version of the tool that generated the code.

What is system CodeDOM dll?

Provides types that can be used to model the structure of a source code document and to output source code for that model in a supported language. Commonly Used Types: System.CodeDom.CodeObject.

Where does CodeDOM could be used in net?

The CodeDOM can also be used to compile source code into a binary assembly. Some common uses for the CodeDOM include: Templated code generation: generating code for ASP.NET, XML Web services client proxies, code wizards, designers, or other code-emitting mechanisms.

What is system codedom in NET Framework?

.NET Framework Version 2.0. 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 web config in ASP NET Core?

The web.config is a file that is read by IIS and the ASP.NET Core Module to configure an app hosted with IIS. In order to set up the ASP.NET Core Module correctly, the web.config file must be present at the content root path (typically the app base path) of the deployed app.

What is the compiler configuration element?

The 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. The element contains zero or more elements.

How do I configure the ASP NET Core Module?

The ASP.NET Core Module is configured with the aspNetCore section of the system.webServer node in the site's web.config file. The following web.config file is published for a framework-dependent deployment and configures the ASP.NET Core Module to handle site requests:


1 Answers

These settings are used for dynamic compilation. They can be safely removed from the web.config if you do pre-compilation and only put the compiled assemblies on the webserver.

See also The impact of multiple compiler definitions in system.codedom in web.config

like image 175
Jochen Avatar answered Sep 19 '22 02:09

Jochen