I have some nuget package hosted in my gitlab project. And I need debug this package and can't do this on Visual Studio for Mac. Here is my csproj file:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1</TargetFrameworks>
<!-- Optional: Publish the repository URL in the built .nupkg (in the NuSpec <Repository> element) -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<!-- Optional: Embed source files that are not tracked by the source control manager in the PDB -->
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<!-- Optional: Build symbol package (.snupkg) to distribute the PDB containing Source Link -->
<IncludeSymbols>true</IncludeSymbols>
<!-- Recommended: Embed symbols containing Source Link in the main file (exe/dll) -->
<DebugType>embedded</DebugType>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<EmbedAllSources>true</EmbedAllSources>
<PackageVersion>1.0.18.0</PackageVersion>
<AssemblyVersion>1.0.18.0</AssemblyVersion>
<FileVersion>1.0.18.0</FileVersion>
<InformationalVersion>1.0.18.0</InformationalVersion>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
</PropertyGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('netstandard2.0')) Or $(TargetFramework.StartsWith('netstandard2.1'))">
<PackageReference Include="nlog" Version="4.6.2" />
<PackageReference Include="System.Threading" Version="4.3.0" />
<PackageReference Include="Microsoft.SourceLink.GitLab" Version="1.0.0" PrivateAssets="All"/>
<Compile Include="ISynchronizationContext.cs" />
<Compile Include="TaskExtensions.cs" />
<Compile Include="AsyncAwaiter.cs" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('netcoreapp3.1'))">
<PackageReference Include="Microsoft.SourceLink.GitLab" Version="1.0.0" PrivateAssets="All"/>
<PackageReference Include="nlog" Version="4.6.2" />
<PackageReference Include="System.Threading" Version="4.3.0" />
<Compile Include="*.cs" />
</ItemGroup>
<PropertyGroup>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>
</Project>
this is my deploy part of .gitlab-ci.yml:
deploy:
stage: deploy
script:
- dotnet pack -c Release
- dotnet nuget add source "$CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/nuget/index.json" --name $CI_PROJECT_TITLE --username $CI_REGISTRY_USER --password $CI_REGISTRY_PASSWORD --store-password-in-clear-text
- dotnet nuget push "Source/bin/Release/*.nupkg" --source $CI_PROJECT_TITLE
Debug nuget package working in Visual Studio 2019, but not working in Visual Studio for Mac. In this article I have read that:
In Visual Studio for Mac, support for symbol servers doesn’t exist yet, so Source Link only works with NuGet packages that contain their own debug symbols.
What I need to do to enable debugging my nuget package in Visual Studio for Mac?