Visual Studio中不允许在MVC意见断点 [英] Visual Studio does not allow breakpoints in MVC views

查看:339
本文介绍了Visual Studio中不允许在MVC意见断点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时候的Visual Studio不允许我在MVC的意见设置断点。这发生在我身上得分倍,但它不会发生的每一个观点,我不知道为什么。

Sometimes Visual Studio does not allow me to set breakpoints in MVC views. This has happened to me scores of times, but it doesn't happen for every view and I don't know why.

在左侧栏中单击放置一个断点,它把一个白色的圆圈,而不是正常的红色圆圈。当你将鼠标悬停在它的信息是断点目前不会受到打击。源$ C ​​$ c是原来的版本不同。它接着描述了如何让断点被击中,但会产生奇怪的结果,我不希望这样反正。

When you click on the left-hand bar to place a breakpoint, it places a white circle instead of the normal red circle. The message when you hover over it is "The breakpoint will not currently be hit. The source code is different from the original version." It goes on to describe how to allow breakpoints to be hit, but that produces strange results and I don't want that anyways.

如果错误是正确的,那么我想运行原始出处code。我不知道发生了什么事在VS幕后;我尝试重建和所有,但它并不能帮助。我在调试模式下运行在VS 2012。

If the error is correct, then I want to run the original source code. I don't know what's going on behind the scenes in VS; I try rebuilding and all that but it doesn't help. I'm running in Debug mode in VS 2012.

推荐答案

这可以通过很多事情造成的,但也有少数项目来检查我已经帮助人们与最近:

This could be caused by many things, but a few items to check which I've helped people with recently:


  • 第一步:必须有旁边的DLL来启用调试一个PDB文件。 (参见:什么是PDB文件?)请确保您有PDB中执行目录。

  • First step: there must be a PDB file alongside the DLL to enable debugging. (see: What is a PDB file?) Make sure you have the PDB in the executing directory.

清洁从你的bin文件夹中删除所有的旧的DLL。

Clean to remove all the old DLLs from your bin folders.

确保您的应用程序正在运行当前的code的版本(你有相同的版本在Visual Studio)。不要以为这只是因为你点击生成或部署。如果没有检测到更改然后东西往往不会发生。检查装配的建造时间,或改变一些东西,重建看到文件的大小变化。

Ensure that your application is running a build of your current code (the same version you have in Visual Studio). Don't assume that it is just because you clicked 'build' or 'deploy'. If no changes were detected then things often don't happen. Check the build time of the assembly, or change something and rebuild to see the file size change.

如果你正在运行什么网站相关的,请确保浏览器不缓存code或IIS不持有长期运行的进程。

If you're running something web-related, make sure a browser isn't caching code, or IIS isn't holding a long running process.

杀死任何运行Visual Studio开发服务器实例(您可以从任务管理器做到这一点,或者更简单地从系统托盘 - 它们看起来像一个IE浏览器的标志,当你将鼠标悬停在他们,他们会告诉你哪个端口它们运行)。

Kill any running Visual Studio Development Server instances (you can do this from task manager, or more simply from the system tray - they look like an IE logo and when you hover over them they'll tell you which port they run on).

重新启动IIS使用 IISRESET 从命令提示符。

Restart IIS using iisreset from a command prompt.

检查调试设置在Visual Studio(工具>选项>调试>符号)你想自动加载的符号,如果你重新链接时,你需要在这里引用它们PDB文件等组件。

Check the settings for Debugging in Visual Studio (Tools > Options > Debugging > Symbols) You want to automatically load symbols, and if you're linking other assemblies you need to reference their PDB files here.

这篇关于Visual Studio中不允许在MVC意见断点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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