究竟是什么&LT;系统codeDOM&GT; /&LT;编译器&GT;做在web.config中的MVC 5? [英] What exactly does <system.codedom>/<compilers> do in web.config in MVC 5?
问题描述
我即将从.NET 4.0 + MVC 3迁移一串项目.NET 4.5.2 + MVC5。
I am about to migrate a bunch of projects from .NET 4.0 + MVC 3 to .NET 4.5.2 + MVC5.
为使这更容易,我创建了一个新的空白MVC项目比较DLL引用和一些其他的东西,如web.config中。
To make this easier, I've created a new blank MVC project to compare DLL references and some other stuff such as web.config.
在后者,是由Visual Studio生成以下条目:
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=\"Web\" /optionInfer+"/>
</compilers>
</system.codedom>
但我不知道这是什么具体的行为。 MVC的3个项目不包含这些部件。我的理解是它是与罗斯林?
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?
推荐答案
这些设置用于的动态编译。他们可以从web.config被安全地删除,如果你做pre-编译,只把编译好的程序集的网络服务器。
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.
又见<一个href=\"http://stackoverflow.com/questions/8713255/the-impact-of-multiple-compiler-definitions-in-system-$c$cdom-in-web-config\">The在系统中,在web.config中codeDOM的多个编译器定义的影响
这篇关于究竟是什么&LT;系统codeDOM&GT; /&LT;编译器&GT;做在web.config中的MVC 5?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!