Visual Studio代码与调试源的位置不同步 [英] Visual Studio Code out of sync with the location for debug source

查看:438
本文介绍了Visual Studio代码与调试源的位置不同步的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经签出了 Visual Studio  2008年项目的标签一个新的本地文件夹。 (本地文件夹与通常在HEAD代码中工作的地方不同。)



我在项目中做了一个干净和重建 - 创建了一个DLL文件。它重建成功,位于正确的构建区域。



当我查看解决方案资源管理器,它显示了新文件夹中所有文件的绝对路径。



是当我设置一个断点并尝试调试代码时,它从不会触发断点。当我右键单击断点并查看位置时,它会显示一条文件在HEAD区域中的路径,当它被上传到 SVN 。我不知道从哪里得到那条旧路。

解决方案

这是一个可以出错的小小的清单:


  1. 验证加载的模块( Ctrl + D + < M 通常)。看到您的代码模块从您希望加载的代码模块加载。


  2. 在清理/重建时,只清除项目的输出(如果我有 MyAssembly 项目构建一个 MyASsembly.dll ,只有与该项目相关的文件将被删除。引用在清理过程中不被删除。


  3. 尝试隔离问题。使用 F10 开始调试(步入调试代码)。查看入口点是否正常,但只有一些您尝试命中的其他代码是从错误的位置获取的。



I've checked out a tag for a Visual Studio 2008 project into a new local folder. (The local folder is different than where I normally work on HEAD code.)

I did a 'clean' and 'rebuild' on the project -- which created a DLL file. It rebuilt successfully and is located in the correct build area.

When I look at the files in Solution Explorer, it shows the correct absolute path for all the files within the new folder.

The problem is that when I set a breakpoint and try to debug the code, it never hits the breakpoint. When I right click on the breakpoint and look at 'Location' it shows me a path to where the file had been in the HEAD area when it was uploaded into SVN. I don't see where it is getting that old path from.

解决方案

Here's a small checklist of things that can go wrong:

  1. Verify loaded Modules (Ctrl + D + M usually). See that your code modules are loaded from where you expect them to load.

  2. When doing clean/rebuild, only the project's output is cleaned (if I have MyAssembly project that builds a MyASsembly.dll, only the file relevant for this project will be removed. Any other assemblies that are referenced are not deleted in the cleanup process.

  3. Try to isolate the issue. Start debugging with F10 (step into the debugged code). See if the entry point is OK, but only some other code that you're trying to hit is taken from the wrong location.

这篇关于Visual Studio代码与调试源的位置不同步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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