简体   繁体   中英

Configuring an asp.net project

If I want to add this lines for configuring an asp.net MVC4 app,

<configuration>  
<startup useLegacyV2RuntimeActivationPolicy="true"><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>  
</configuration>  

in which file should I put them? Should I create an app.config file or put them in the web.config file? I used to add them for a console app or class library app.config and I got what I need, but now I have an asp.net mvc4 project.

You can put it in app.config file.

But here is what you should know.

Web.config is for ASP.NET and ASP.NET MVC; app.config is for desktop applications and DLLs.

If you need to store any kind of parameter for your application that you can change without having to recompile, Web.config is the place to go.

Cheer!

将其添加到根目录中的web.config文件中。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM