简体   繁体   English

如何使用VS 15.7及更高版本调试没有WIP功能的nuget软件包

[英]How to debug a nuget package without WIP features using VS 15.7 and above

I've read this: How to debug into my nuget package deployed from TeamCity? 我读过这篇文章: 如何调试从TeamCity部署的nuget包? but for some reason my project cannot be debugged, without asking me to specify for the location of the source file. 但是由于某种原因,如果不要求我指定源文件的位置,则无法调试我的项目。 Using the following commands i was able to properly create a package (without having to add any of it in the .csproj) with symbols 使用以下命令,我能够使用符号正确创建一个程序包(无需在.csproj中添加任何程序包)

The package in question is located on a local nuget feed. 有问题的程序包位于本地nuget提要上。

It will prompt me for the source file during debugging, despite the nupkg containing debugging symbols+sources it isn't working 尽管nupkg包含调试符号和源,它仍会在调试过程中提示我输入源文件,但它无法正常工作

Commands used to produce the package: 用于产生软件包的命令:

dotnet clean "../$path"
dotnet pack "../$path" -o "$outputRoot" -v $verbosity -c $configuration -symbols --include-symbols --include-source /p:PackageVersion=$version  
Invoke-Expression "& $nugetPath push $outputRoot\$path.$version.symbols.nupkg -source $localFeed" 

Structure in local repo: 本地仓库中的结构:

contents of local nuget feed 本地nuget提要的内容

Nuget回购

contents of package.id/$version/ package.id/$version/的内容

Nuget回购

contents of lib/net462 lib / net462的内容

Nuget回购

To me it looks like the package is in a state where this should be working - shouldn't it? 在我看来,该程序包处于应能正常工作的状态-不是吗?

It will prompt me for the source file during debugging, despite the nupkg containing debugging symbols+sources it isn't working 尽管nupkg包含调试符号和源,它仍会在调试过程中提示我输入源文件,但它无法正常工作

Even if the debugging symbols+sources are included in the symbols nuget package, but NuGet itself does not have the ability to parse the symbols nuget package when you debugging this nuget package in the Visual Studio. 即使调试符号+源包含在symbols nuget包中,但是在Visual Studio中调试此nuget包时,NuGet本身也无法解析symbols nuget包。 So Visual Studio still can not find the the source file during debugging. 因此,Visual Studio在调试过程中仍找不到源文件。 That is the reason why NuGet team publish the symbols package to the SymbolSource server . 这就是NuGet团队将Symbols包发布到SymbolSource服务器的原因

See How to debug code in a nuget package created by me for some more details. 有关更多详细信息,请参见如何调试由我创建的nuget包中的代码

Besides, since Currently the NuGet package debugging and symbols experience is not streamlined. 此外,由于目前没有简化NuGet包的调试和符号体验。 , it not very easy to debug the nuget package from Visual Studio successfully. ,从Visual Studio成功调试nuget包不是一件容易的事。 Not sure why you do not want to specify for the location of the source file, if you are interested in it, you could use the lightweight solution to debug the nuget package: 不确定为什么不想指定源文件的位置,如果您对此感兴趣,可以使用轻量级解决方案来调试nuget包:

Is it possible to host both regular and symbols packages in a NuGet local feed on a network share? 是否可以在网络共享的NuGet本地供稿中同时托管常规软件包和符号软件包?

I have been using this method all the time without any other issue, hope this helps you. 我一直在使用此方法,没有其他问题,希望对您有所帮助。

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

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