如何在 Visual Studio 2008 和 ASP.Net MVC 中编辑并继续?
我正在尝试编辑并继续使用 Visual Studio 2008 和 ASP.Net MVC 项目。 我运行的是 64 位,所以这增加了问题。
在配置管理器中,我的活动解决方案平台是 x86,所有项目也都针对调试 x86。
在项目属性中,我选择了“启用编辑并继续”。
在“工具”->“选项...”->“调试”->“编辑并继续”中,我选择了“启用编辑并继续”。
在“工具”->“选项...”->“调试”->“常规”中,我启用了“当一个项目中断时中断所有进程”。
一旦我尝试更改视图/模板之外的某些源代码,我就会收到消息:编辑并继续:代码运行时或选项“当一个项目中断时中断所有进程”时不允许进行更改已禁用。 可以在“工具”、“选项”、“调试”中启用该选项。
有什么想法如何让它工作吗?
I'm trying to get edit-and-continue working with Visual Studio 2008 with an ASP.Net MVC project. I'm running 64-bit, so that adds to the problem.
In Configuration Manager, my active solution platform is x86 and all the projects are targeting Debug x86 as well.
In the project properties I have "Enable Edit and Continue" selected.
In Tools->Options...->Debugging->Edit and continue I have "Enable Edit and Continue" selected.
In Tools->Options...->Debugging->General I have "Break all processes when one project breaks" enabled.
As soon as I try to change some source code outside of a view/template'I get the message: Edit and continue: Changes are not allowed while code is running or if the option 'Break all processes when one project breaks' is dissabled. The option can be enabled in Tools, Options, Debugging.
Any ideas how to get it to work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您是否已选中“启用优化”? (高级编译选项),我认为你不能检查它......
另外:
http://blogs.msdn.com/webdevelopertips/archive/2008/11/26/tip-29-did-you-know-how-to-enable -编辑并继续功能for-web-application-projects.aspx
Do you have Enable Optimizations checked? (Advanced Compile Options), I don't think you can have that checked...
Also:
http://blogs.msdn.com/webdevelopertips/archive/2008/11/26/tip-29-did-you-know-how-to-enable-edit-and-continue-feature-for-web-application-projects.aspx
对于 VS2010 尝试这个
For VS2010 try this
程序运行时您无法“编辑并继续”。 您必须中断才能编辑并继续,如果您有很多线程,则必须全部中断。
如果中断时,某些线程继续运行,则不是“编辑并继续”的问题,而是中断选项的问题。
注意:您不需要停止程序,但必须中断,然后才能继续。
You can't 'edit and continue' when the program is running. You must break to edit and continue, and if you have many threads you must break all.
If when breaking, some threads continue to run, it not a problem with 'edit and continue' but a problem with the break options.
Note: You don't need to stop the program, but you must break, and then you can continue.
您使用 IIS 还是内置的 Visual Studio 开发服务器进行调试? 我在进行编辑并继续在 IIS 下运行之前遇到了麻烦,最终只使用了内置服务器。
Are you using IIS or the built in Visual Studio development server for debugging? I've had trouble before getting edit and continue running under IIS, and ended up just using the built in server.
我打开一个单独的浏览器窗口(因此当我停止调试时它不会关闭),然后我停止调试,进行更改并构建它们,然后继续使用另一个浏览器窗口来查看更改。 (是的 - 即使您的类文件、控制器等发生更改,这也适用)。
如果您只想更改视图、CSS 或脚本,您只需移动和刷新即可确保您的浏览器获取更新的文件,而不是使用缓存。
如果这对任何人来说听起来很奇怪 - 尝试一下! 有用!
I open a separate browser window (so it doesn't close when I stop debugging) then I stop debugging, make changes and build them and just carry on using the other browser window to view the changes. (Yes - this works even with changes in your class files, controllers etc).
If you just want to change the views, CSS or scripts you just need to shift and refresh to make sure your browser gets the updated files rather than using the cache.
If this sounds odd to anyone - try it! It works!