mvc 2 using Codebehind instead of precompiled dll
How do I run my mvc 2 web application using the code-behind classes rather than the generated dll it creates when compiling ?
The reason for this is so I can update an Action in a controller for example via the .cs file rather than having to redeploy a 开发者_StackOverflow社区new dll for the whole site.
Similar to how you could have websites in asp.net 2 webforms rather than web applications
ASP.NET MVC uses ASP.NET application instead of ASP.NET website so what you are asking is not possible. The application needs to be precompiled before deployment.
Now this being said you could in fact you a web site as model for ASP.NET MVC application but be prepared to do everything manually.
- Create a new ASP.NET website
- In the special
App_Code
folder add a controller - Add the Views folder containing the corresponding web.config, layout and views
- Configure your routes in
Global.asax
So you need to put all your code behind (controllers, models, ...) in the special App_Code
folder.
精彩评论