How does ASP.NET engine know to compile files in Areas or Controllers folder?

I'm trying to add MVC to existing WebForms Web Site. I wonder, how does ASP.NET engine know that it should compile all the .cs files in Areas? Is there any configuration I should do?

I know that in Web Application Project in VS I would be able to set build action for individual files, but there is no such option in Web Site kind of VS project.

Upvotes: 0

Views: 53

Answers (1)

Erik Funkenbusch
Erik Funkenbusch

Reputation: 93434

MVC requires a Web Application project. It cannot be added to a Web Site project.

Web Site projects have many disadvantages and quirks, and you should avoid them if at all possible. I know, it's very convenient to be able to edit the code behinds and not have to republish, but this benefit is not worth the other disadvantages IMO.

Upvotes: 1

Related Questions