Visual Studio Code out of sync with the location f

2019-08-30 15:48发布

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.

3条回答
Bombasti
2楼-- · 2019-08-30 16:25

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.

查看更多
Luminary・发光体
3楼-- · 2019-08-30 16:26

Visual Studio editor does not understand unix style end of line. try to use unix2dos util on the misbehaving source files.

查看更多
一夜七次
4楼-- · 2019-08-30 16:45

After firing up the debugger, it might help to use menu Debug -> Windows -> Modules to see exactly where Visual Studio is loading the assembly from.

Also, verify that you are building in Debug mode. I hate to admit that occasionally I build in Release mode and then wonder why the debugger does not stop at breakpoints.

查看更多
登录 后发表回答