简体   繁体   English

调试时,我可以进入我的NuGet包

[英]When debugging I can step into my NuGet package

I created a brand new NuGet package for internal use 我创建了一个全新的NuGet包供内部使用

it is: 它是:

  • private, not published on the NuGet repo 私有,未在NuGet存储库上发布
  • compiled in release mode 在发布模式下编译

However, I'm able to step into the provided API! 但是,我可以使用提供的API! How can it be? 怎么可能?

NOTE: I moved away the actual source code. 注意:我移走了实际的源代码。 The project which is using the package doesn't "see" the package source code 使用该程序包的项目不会“看到”程序包源代码

just dont publish the pdb file :) 只是不发布pdb文件:)

PS: if your VS knows the path to the sources from your Nuget Package, he will still be able on your PC to do a Step by Step debug. PS:如果您的VS知道从Nuget包到源的路径,他仍然可以在您的PC上进行逐步调试。

By default, Release builds produce PDB files . 默认情况下,发布版本会生成PDB文件 Among other information, these PDB files contain locations of source files. 除其他信息外,这些PDB文件还包含源文件的位置。

When you step through your code, Visual Studio loads the PDB file, from there it extracts full paths to source files, and as long as it can access them (which it can, provided that you've built your NuGet package locally), you get to step though library code. 当您单步执行代码时,Visual Studio加载PDB文件,从那里提取源文件的完整路径,并且只要它可以访问它们(只要已在本地构建NuGet包,就可以访问它们),您就可以逐步了解库代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM