After MVC3 publish, just update the views

人盡茶涼 提交于 2019-12-09 20:08:31

问题


.NET/MVC3 newbie, so please bear with me!

I've searched for this answer all over but cant find exactly what im looking for, so here it comes...

Lets say that i'm developing an MVC3 app with Visual Web Developer Express and i go about deploying the site using the built in publishing tool.

But now that my site is up and running i find that i need to make a minor adjustment in one of the views. I update the view and save the file, and use my FTP program to upload the new file. The problem is that MVC3/.NET doesn't seem to refresh/change the view, because it's still using the old version.

Of course I have tried refreshing (in many different browsers even), but it still won't load the new view.

Is this normal behaviour, meaning that i have to publish every time i make some minor adjustments (kinda time consuming)? I really can't imagine that this is the case, so i'm wondering if you could shed some light over this?

Appreciate any replies!

/Mikael


回答1:


If you upload the view (.cshtml) file and that is the ONLY part of the application that has changed, a refresh will reflect the change - you may have to ctrl+f5 to clear the temp cache. However! If you change ANY of the controller code or action code, or any c# (or vb if thats what you use), then you MUST re-upload the compiled .dll associated with the entire application in order for the changes to be reflected.



来源:https://stackoverflow.com/questions/9056995/after-mvc3-publish-just-update-the-views

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!