Azure DevOps SourceLink and Symbol Server with Release DLL in Nuget package

有些话、适合烂在心里 提交于 2019-12-24 03:37:14

问题


I have a .NET Standard 2.0 TestSouceLink project with the following configuration in the .csproj:

<PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
    <RestoreProjectStyle>PackageReference</RestoreProjectStyle>
    <Authors>Jérôme MEVEL</Authors>
    <Description>Just a test package for SourceLink</Description>
    <Version>1.1.1</Version>

    <PublishRepositoryUrl>true</PublishRepositoryUrl>
    <EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
    <DebugType>full</DebugType>
    <DebugSymbols>true</DebugSymbols>
</PropertyGroup>

<ItemGroup>
    <PackageReference Include="Microsoft.SourceLink.Vsts.Git" Version="1.0.0-beta2-18618-05">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
    </PackageReference>
</ItemGroup>

We have an Azure DevOps server which generates our Nuget packages in build pipelines.

I added a Publish symbols path task at the end to push the .pdb files to the Symbol Server and I managed to get Source Link to work along with the Azure DevOps Symbol Server with the Debug build configuration only.

The problem is that I don't want my DLLs in the Nuget packages to be generated in Debug mode. I want them to be Release. But when I change the dotnet pack task to use Release in the Configuration to package text box, then Source Link doesn't work anymore.

Is there a way to generate a Nuget package with a Release DLL inside? and to still have Source Link working with the Symbol Server?

I don't mind using a .nuspec file along with the Nuget CLI if this is the only way however I don't want to include the .pdb files inside the Nuget packages.

Thanks

来源:https://stackoverflow.com/questions/55899023/azure-devops-sourcelink-and-symbol-server-with-release-dll-in-nuget-package

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!