Updates to Controllers or Models are not accounted for when recompiling ASP.NET MVC application
This is more of a VS.NET issue I'm sure, but I can't get this to work.
I am updating an older ASP.NET MVC application.
I update code in a class (eg: Controller or Model).
When I rebuild the project/solution and test it (localhost) the changes to the code are not compiled, these changes are not applied. However, changes to the Views take effect immediately.
I am using VS.Net 2010 and app is built in MVC 1.0. Originally the app was built in VS.Net 2008, so when I opened it in VS.Net 2010, the project files were updated. However I did not update the project to a more recent version of .NET.
What am I doing wrong开发者_Python百科?
This could indeed be some assembly version problem but if you are saying that changes to the views are taken into account it means that the application at least runs correctly. When you opened the project in VS 2010 it probably migrated it to ASP.NET MVC 2.0 (using System.Web.Mvc v2.0.0.0
). If you still want to use v1.0 remove the reference of this new assembly and add the older version. Also make sure that there are no binding redirects in web.config. Changes made into controllers and models should be taken into account after recompiling the web application project. Changes to the views are taken into account immediately and no recompilation is needed.
精彩评论