why are there 2 web.config files

后端 未结 4 888
轮回少年
轮回少年 2020-12-29 03:27

Someone sent me over a link to download the sample standard asp.net MVC sample, I noticed that there were 2 web.config files:

  1. 1 in the root directory
4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-29 04:10

    /Views/Web.config

    This is not your application’s main web.config file. It just contains a directive instructing the web server not to serve any *.aspx files under /Views (because they should be rendered by a controller, not invoked directly like classic WebForms *.aspx files). This file also contains configuration needed to make the standard ASP.NET ASPX page compiler work properly with ASP.NET MVC view template syntax.

    /Web.config

    This defines your application configuration.

    This is from the book Pro ASP.NET MVC Framework

提交回复
热议问题