ASP.NET MVC and two Web.config files

前端 未结 1 463
挽巷
挽巷 2020-12-09 15:04

Where is the Web.config supposed to go in an ASP.NET MVC project?

I just ran into an error trying to do this:

_cnstr = System.Configuration.Configu         


        
相关标签:
1条回答
  • 2020-12-09 15:23

    The settings should go into the web.config at the application root. The web.config in the views folder is there to block direct access to the view aspx pages which should only get served through controllers.

    (And: I tried creating application settings on my machine, with ASP.NET MVC RC 1 installed, using a newly created mvc web application. They get added to the web.config at the application root.)

    0 讨论(0)
提交回复
热议问题