Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用SourceLink解决引用nuget版本时不方便源码调试的问题 #183

Closed
gmf520 opened this issue Aug 26, 2020 · 1 comment
Closed
Labels
Feature 🔨 新功能,新特性 Finished ✔️ 实现并完工 Useful 💯 对于解决问题有帮助
Milestone

Comments

@gmf520
Copy link
Member

gmf520 commented Aug 26, 2020

您的功能请求与现有问题有关吗?请描述

对于直接引用nuget程序包的情况,遇到问题想调试osharp代码,很不方便

描述您想到的解决方案

https://docs.microsoft.com/zh-cn/dotnet/standard/library-guidance/sourcelink 所示,提供解决方案步骤如下:

  1. 所有发布的工程(*.csproj)文件添加如下配置
<PropertyGroup>
    <RepositoryUrl>https://github.com/dotnetcore/osharp</RepositoryUrl>
    <RepositoryType>git</RepositoryType>
    <PublishRepositoryUrl>true</PublishRepositoryUrl>
    <EmbedUntrackedSources>true</EmbedUntrackedSources>
    <IncludeSymbols>true</IncludeSymbols>
    <SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<ItemGroup>
  <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
</ItemGroup>
  1. 生成 .nupkg和.snupkg 文件并发布
  2. 调试时启用VS的“源链接”支持
@gmf520 gmf520 added this to the vNext milestone Aug 26, 2020
@gmf520 gmf520 added Feature 🔨 新功能,新特性 Finished ✔️ 实现并完工 labels Aug 26, 2020
@gmf520 gmf520 closed this as completed Aug 26, 2020
@gmf520 gmf520 mentioned this issue Aug 27, 2020
8 tasks
@gmf520 gmf520 added the Useful 💯 对于解决问题有帮助 label Aug 27, 2020
@gmf520
Copy link
Member Author

gmf520 commented Aug 27, 2020

Nuget引用OSharpNS启用源码调试的方法

版本:v3.1.7 正式版

VS2019设置

一取一勾

image

一勾

image

可以源码调试了,会自动下载对应版本的源码进行调试

@gmf520 gmf520 pinned this issue Aug 27, 2020
@gmf520 gmf520 unpinned this issue Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature 🔨 新功能,新特性 Finished ✔️ 实现并完工 Useful 💯 对于解决问题有帮助
Projects
None yet
Development

No branches or pull requests

1 participant