azure-devops - 调试期间未从 Azure Devpos 加载 nuget 包的索引源
问题描述
尝试使用 azure yml 构建 pipleline 以发布符号以允许使用 azure devops 调试 nuget pkg。我看到 PDB 文件已下载到符号缓存文件夹,但单步执行要求在 Visual Studio 中查找源文件位置,即使我在发布符号期间对源代码进行了索引。
我试图在 Visual Studio 调试中启用不同的选项,但似乎没有任何帮助
这是我的 yml
# ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
name: $(BuildDefinitionName)_$(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) # need this for byBuildNumber verisonScheme nuget pack
# the build will trigger on any changes to the master branch
trigger:
- master
# the build will run on a Microsoft hosted agent, using the lastest Windows VM Image
pool:
vmImage: 'windows-latest'
# these variables are available throughout the build file
# just the build configuration is defined, in this case we are building Release packages
variables:
buildConfiguration: 'Release'
#The build has 3 seperate tasks run under 1 step
steps:
# The first task is the dotnet command build, pointing to our csproj file
- task: DotNetCoreCLI@2
displayName: 'dotnet build'
inputs:
command: 'build'
arguments: '--configuration $(buildConfiguration)'
projects: 'src/Common.Core/Common.Core.csproj'
- task: PublishSymbols@2
inputs:
symbolsFolder: '$(Build.SourcesDirectory)'
searchPattern: '**/bin/**/*.pdb'
indexSources: true
publishSymbols: true
symbolServerType: 'teamServices'
treatNotIndexedAsWarning: true
symbolsProduct: '$(Build.DefinitionName)'
symbolsVersion: '$(Build.BuildNumber)'
symbolsArtifactName: '$(name).Symbols_$(BuildConfiguration)'
# The second task is dotnet pack command again pointing to the csproj file
# The nobuild means the project will not be compiled before running pack, because its already built in above step
- task: DotNetCoreCLI@2
displayName: "dotnet pack"
inputs:
command: 'pack'
arguments: '--configuration $(buildConfiguration)'
packagesToPack: 'src/Common.Core/Common.Core.csproj'
nobuild: true
includeSymbols: true
versioningScheme: 'byBuildNumber'
# The last task is a nuget command, nuget push
# This will push any .nupkg files to the 'Nuget' artifact feed
# allowPackageConflicts allows us to build the same version and not throw an error when trying to push
# instead it just ingores the latest package unless the version changes
- task: NuGetCommand@2
displayName: 'nuget push'
inputs:
command: 'push'
feedsToUse: 'select'
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
nuGetFeedType: 'internal'
publishVstsFeed: 'myNuget'
allowPackageConflicts: true
我希望当我调试带有启用了 idnexed 源代码的符号的 nuget 包时,它会自动下载 pdf 文件和源代码。
解决方案
我看到 PDB 文件已下载到符号缓存文件夹,但单步执行要求在 Visual Studio 中查找源文件位置,即使我在发布符号期间对源代码进行了索引。
您应该让调试器知道在哪里可以找到您的源文件。首先,请将您的 xx.nupkg 重命名为 xx.zip 并检查它是否包含必要的源文件。
之后,您可以right-click Solution in Solution Explorer=>Properties=>Debug Source Files
单击New Line
选项以将 nuget 源文件的路径添加到debug source files
设置中。
我希望当我调试带有启用了 idnexed 源代码的符号的 nuget 包时,它会自动下载 pdf 文件和源代码。
也许你可以从这个问题中得到一些帮助。您可以尝试将源文件的构建操作设置为C# compiler
为.net core
.
推荐阅读
- swift4.2 - 如何在 Swift 4.2 中使用 SDWebImage 使用 headerView 完成块?
- python - 我用 pyinstaller 创建的 exe 闪烁并终止
- c - C-结构函数
- python-3.x - Opencv中使用multiTracker对象的多对象跟踪初始化
- java - java编译器如何以及在哪里存储.class文件
- java - 如何找到ascii数组的总和?
- c++ - 删除后的c ++指针仍然占用内存
- wix - 取消安装 Wix Burn Boostrapper 并删除 ARP 条目
- git - 如何查看分行信息?
- r - 将每 4 行转置为 4 个单独的列