Edit a view in Runtime

痴心易碎 提交于 2019-12-08 03:09:39

问题


I'm developing a website with ASP MVC 3 and Razor in VS2010 SP1.

When I'm running the site from VS, if the view was open in the IDE, I can edit a view in runtime, and press F5 to show the changes, but if I open the view after run the site, then the view is locked (no message, simply I can write in the VS Editor)

When I stop debuggin the solution, the views that are locked remains locked, and I have to close the file and open id again in order to modify the code.

This behaviour is uncomfortable. Can anyone tell me why sometimes I can write in the VS2010 editor and other times I can't?

Other Notes:

  • The TFS is not the problem.
  • It happens in all the VS 2012 SP1 of my office.
  • It only happens in vb.net projects, not in C# proyects.
  • It didn't happens in VS2012.
  • I've disabled all the extensions.

Thanks.


回答1:


I have experienced this as well.

I've found that just reopening the file, while in debug, works most of the time. The nearest thing I can figure is that you're not actually editing the file but actually viewing a debug version of the file.

This normally happens, for instance, a javascript method causes an exception within the source of that page. It then loads the active version of that page instead of the one you're editing. Though I've had it happen without any errors generated so I'm fairly certain that's not the whole issue. It might be worth posting an issue on http://aspnet.codeplex.com/workitem/list/basic It hasn't happened often enough for me to narrow it down but it sounds like it happens for you more often.




回答2:


After more than a year suffering this problem, a solution was found.

This MS HotFix for VS2010SP1 solved the issue.

http://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=40811



来源:https://stackoverflow.com/questions/5501360/edit-a-view-in-runtime

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