Search code examples
c#.netvisual-studiodebuggingwindows-services

Binary was not built with debug information. C# .NET Framework 4.5


I'm using Visual Studio 2019 Community Edition (Version 16.3.7), .NET Framework 4.5 and C#. Trying to attach to process in debugging mode, but having a long "Loading symbols for systemDllName from: Microsoft Symbol Server" process, something like 5-7 minutes. As a result, I can't attach to windows process and debug.

After some investigation, I've found out that MyProject.exe module has Symbol Status "Binary was not built with debug information". I tried to find similar issues here, but they didn't help, list of similar issues:

Also I tried to check manually all csproj files to write in "Debug" mode building and it didn't help. I tried to do all basic stuff as clean solution/delete all breakpoints/check and uncheck "Only my code" in debug settings and it didn't help.

Interesting fact: sometimes debugger works correctly and I don't have any issues at all. For example, I had rebooted the OS and it helped, but sometimes it doesn't help.

The main problem: I don't know what exactly goes wrong (pdb.files loading? loading from MS server? some problems with building? etc) and why sometimes it works correctly?

Some examples: Loading symbols for 5-7 minutes Module window. Guys, sorry for that terrible censorship :)


Solution

  • So, as @Train suggested, the best way to handle this issue was VS upgrading. I had 16.3.7 version and upgraded to 16.4.3 version.

    It is not 100% guarantee that the issue won't shoot you again, but it is working for now. In case, that all common stuff (clean solution/folders/checks in menu/etc) doesn't help you try to play with VS version.