1

Whenever I create an MVC web application their is a second Web.config file in the solution. It is inside the Views folder.

If I remove it, BadThings happen. But any time, things are needed to be added to a Web.config (nuget packages, connection strings, app settings) it only ever goes into the root Web.Config, and I try to never make changes to this second beast.

Also, it was just one other headache when needing to upgrade apps from MVC3 -> MVC4 -> MVC5

What is the Views Web.Config used for, and what sort of changes are ever made for it?

Thanks.

1 Answers1

0

I am sure this has been asked before, but the file is there to ensure nobody can access a view without going through the controller. If you remove it, someone can hack to see your code, which might give them some information on what you are doing (especially if someone on your team is sloppy).

In general, you don't make changes, as it is just there to add the extra security.

Gregory A Beamer
  • 16,870
  • 3
  • 25
  • 32