4

Trying to find a solution I read this question: What does the Web.Config file do in the views folder of a MVC project

But I still want to know: Why do I need a web.config in all view folders in MVC?

This answer The web.config file exists in the Views folders to prevent access to your views by any means other than your controller is not enough for me, if it's true, it's a temporary solution.

If this is really the only reason, this is a huge point to improve. But, I'm pretty sure there is a good reason for that.

Community
  • 1
  • 1
Custodio
  • 8,594
  • 15
  • 80
  • 115
  • 1
    I found this post to have some useful answers: [http://stackoverflow.com/questions/1355353/why-are-there-2-web-config-files][1] [1]: http://stackoverflow.com/questions/1355353/why-are-there-2-web-config-files – Forty-Two Apr 24 '12 at 19:40
  • This is aim of my question! Shame on MVC if the only reason is: `The web.config in the Views directory just has one significant entry, which blocks direct access`. – Custodio Apr 24 '12 at 20:52

1 Answers1

0

Ahh, yes, I agree. In another answer in the same thread this reason is given:

This file also contains configuration needed to make the standard ASP.NET ASPX page compiler work properly with ASP.NET MVC view template syntax.

So I infer there are some backward compatibility issues that may need to be worked out. But I do agree with your central point that this is something that should be improved upon in future iterations.

Forty-Two
  • 7,535
  • 2
  • 37
  • 54