I am packing my nugets with pdb and src files. Is there a way to put a break point inside my src files and use debugging at the same time ?
Asked
Active
Viewed 3,240 times
2
-
Does Source only packages let me put breakpoints ? http://nikcodes.com/2013/10/23/packaging-source-code-with-nuget/ – Rıfat Erdem Sahin Jun 21 '14 at 08:26
-
I think this may be an answer to your question: http://stackoverflow.com/questions/21857780/how-to-debug-into-my-nuget-package-deployed-from-teamcity. What he says essentially is that you need to step into your code or otherwise open the deployed source file, and then you can set breakpoints in them, provided you have deployed a pdb. – kkm inactive - support strike Dec 24 '14 at 23:35
1 Answers
2
Including the .pdbs in your NuGet package should allow you to debug into the assembly contained in the package on the machine you built it on. As long as the .pdbs are put into the output folder on build.
If you want other people to be able to debug into your NuGet package source code then you should look at creating a symbol NuGet package. The symbol NuGet package has .pdbs and the source code and is published to SymbolSource. In Visual Studio you can configure SymbolSource as a new symbol source and then step into the NuGet package source code.

Matt Ward
- 47,057
- 5
- 93
- 94
-
4including the .pdbs in your NuGet package should allow you to debug into the assembly contained in the package. >>> But I can not place breakpoints into the source – Rıfat Erdem Sahin Jun 21 '14 at 13:20
-
If you want other people to be able to debug into your NuGet package source code then you should look at creating a symbol NuGet package. >>> SymbolSource system is somewhat so slow.And it really does not solve my problem of placing break points in nuget packages. – Rıfat Erdem Sahin Jun 21 '14 at 13:21
-
What steps are you trying in detail? Both the options specified work for me. – Matt Ward Jun 21 '14 at 14:48
-
I think it is almost impossible to debug a webapi handler that contains within a nuget package. I cannot put a breakpoint at the source code from the nuget package before I run the debug. The nuget package source code only opens at debug mode, I need to put a breakpoint at design time. Also, I cannot step into a webapi handler as well. – Y P Dec 05 '14 at 08:38
-
-
You can use this trick to place a breakpoint anywhere, not just step into: Add a reference to the type in questions somewhere in your code, hit F12 on it. This will open the decompiled code which is not ideal but you'll be able to place a breakpoint roughly where you want it. Debug the app, the breakpoint will be hit and the symbol source will be loaded. Then you can debug just as with step into. – Piedone Aug 12 '20 at 15:28