我有一个 .NET Standard 2.0TestSouceLink
项目,其中包含以下配置.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>
我们有一个 Azure DevOps 服务器,它在构建管道中生成我们的 Nuget 包。
我Publish symbols path
在最后添加了一个任务,将文件推.pdb
送到符号服务器,并且我设法让源链接与 Azure DevOps 符号服务器一起工作,仅具有调试构建配置。
问题是我不希望 Nuget 包中的 DLL 在调试模式下生成。我希望他们成为Release。但是当我在文本框中更改dotnet pack
要使用的任务时,源链接不再起作用。Release
Configuration to package
有没有办法生成一个带有 Release DLL 的 Nuget 包?并且仍然让 Source Link 与 Symbol Server 一起工作?
如果这是唯一的方法,我不介意将.nuspec
文件与Nuget
CLI 一起使用,但是我不想将.pdb
文件包含在 Nuget 包中。
谢谢