tags:

views:

49

answers:

2

What is the reason that ASP.NET MVC templates are available only for Web Application projects and not for Web Site projects?

+1  A: 

ASP.NET MVC relies on the compilation (i.e. you compile before deploying) model of WAP.

(Web Site projects are compiled in deployment by default.)

Richard
+2  A: 

Web Site projects work by giving you the option of letting your pages be compiled on the fly. That means that your code in the code-behind (or in the page) for those pages isn't compiled until a request is made to view the page. The only reason that works is because your page and the code-behind for it are tied together.

In an ASP.NET MVC Project, a user doesn't request a page. They enter a URL and the URL Routing directs the request to the appropriate Controller for handling. Since Views and Controllers aren't implicitly linked like ASPX and Code-Behind files, they need to be pre-compiled.

Therefore, the Web Application is the only option that will work for ASP.NET MVC.

Justin Niessner