MVC3发布后,只需更新视图 [英] After MVC3 publish, just update the views

查看:105
本文介绍了MVC3发布后,只需更新视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我已经搜索了这个答案,但无法找到正在寻找的内容,所以在这里它是...



说我正在使用Visual Web Developer Express开发一个MVC3应用程序,我将使用内置的发布工具部署该站点。 / p>

但是现在我的网站已经开始运行,我发现我需要对其中一个视图进行微调。我更新视图并保存文件,并使用我的FTP程序上传新文件。
问题是,MVC3 / .NET似乎没有刷新/更改视图,因为它仍然使用旧版本。



当然我有尝试刷新(甚至在许多不同的浏览器),但它仍然不会加载新的视图。



这是正常的行为,这意味着我必须每次发布我做一些微小的调整(有点耗时)?我真的不能想像是这样的情况,所以我想知道你是否可以轻看一下?



欣赏任何回复!



/ Mikael

解决方案

如果您上传视图(.cshtml)文件,已经更改的应用程序的 ONLY 部分,刷新将反映更改 - 您可能必须使用ctrl + f5清除临时缓存。然而!如果您更改控制器代码或操作代码的任何或任何c#(或vb,如果您使用的是),那么您必须重新上传已编译的.dll关联整个应用程序是为了反映更改。


.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

解决方案

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.

这篇关于MVC3发布后,只需更新视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆