如何调试到从TeamCity的部署了我的NuGet包? [英] How to debug into my nuget package deployed from TeamCity?

查看:275
本文介绍了如何调试到从TeamCity的部署了我的NuGet包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经把我的团队使用到从TeamCity的部署到网络文件夹中的NuGet包库。我不能调试这个代码,但! SymbolSource一个解决方案,我看了一下,但我宁愿找到某种方式来访问该.PDB /来源直接从TeamCity的文件。有谁知道如何做到这一点?

I have put a library that my team uses into a nuget package that is deployed from TeamCity into a network folder. I cannot debug into this code though! SymbolSource is one solution I have read about but I would much rather find some way to have access to the .pdb/source files directly from Teamcity. Does anyone know how to do this?

修改:当我检查'包含符号和源代码中的的NuGet包打造步骤TeamCity的,除了在网络文件夹中的.nupkg文件创建一个.Symbol.nupkg。该.Symbol.nupkg包含src和.pdb文件。

Edit. When I check 'Include Symbols and Source' in the Nuget Pack build step TeamCity creates a .Symbol.nupkg in addition to the .nupkg file in the network folder. The .Symbol.nupkg contains the src and the .pdb file.

修改我未选中'包含符号和源上的TeamCity并添加下面我nuspec文件:

Edit. I unchecked 'Include Symbols and Source' on TeamCity and added the following to my nuspec file:

  <files>
    <file src="..\MyLibrary\bin\release\MyLibrary.dll" target="lib\net40" />
    <file src="..\MyLibrary\bin\release\MyLibrary.pdb" target="lib\net40" />
    <file src="..\MyLibrary\*.cs" target="src" />
    <file src="..\MyLibrary\**\*.cs" target="src" />
  </files>

这增加了DLL时,PDB,并在的NuGet包我的库源文件和没。'T生成.Symbols文件,我认为只需要符号服务器

This added the dll, the pdb, and the source files for my library in the nuget package and didn't generate a .Symbols file which I think is only needed for symbol servers.

推荐答案

有关更轻量级的解决方案:

For a more lightweight solution:


  1. 把PDB中的NuGet包旁边的DLL。

  2. 源代码添加到调试源代码文件引用包解决方案。

这意味着你将能够步执行代码和查看例外,但你可能要找到磁盘上的文件,并打开它之前,你可以设置一个断点。显然,你需要小心源是在正确的版本。

This means you'll be able to step through code and view exceptions, but you might have to find a file on disk and open it before you can set a breakpoint. Obviously you need to be careful that the source is at the right revision.

更多关于第1步

如果您目前包装没有Nuspec,你需要创建一个Nuspec,那么PDB添加到lib文件夹中的文件列表的NuGet规范可能是用于生成有用的命令如的NuGet文档定义的初始规范。然后,确保团队市的NuGet包步骤引用您的新nuspec。

If you're currently packaging without a Nuspec, you'll need to create a Nuspec, then add the pdb to the list of files in the lib folder "NuGet spec" may be a useful command for generating the initial spec as defined in NuGet docs. Then ensure the Team City Nuget Pack step is referencing your new nuspec.

更多关于第2步

当你打开一个解决方案,右击解决方案,选择属性...通用属性...调试源文件,并添加源根目录中的相关二进制参考。或见 MSDN
请注意,您无法打开该解决方案性能,同时调试。

When you have a solution open, right click on Solution, select Properties...Common Properties...Debug Source Files, and add the root source directory for the relevant binary reference. Or see MSDN. Note, you can't open the solution properties while debugging.

这篇关于如何调试到从TeamCity的部署了我的NuGet包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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