PublishSymbols@2 - Index sources and publish symbols v2 task
სტატია
Use this task to index your source code and publish your symbols to a file share or Azure Artifacts symbol server.
Indexing your source code allows you to use your symbol files to debug your application on a machine other than the one you used to build your application. For example, you can debug an application built by a build agent from a dev machine that does not have the source code.
Symbol servers enable your debugger to automatically retrieve the correct symbol files without knowing product names, build numbers, or package names.
Syntax
YAML
# Index sources and publish symbols v2# Index your source code and publish symbols to a file share or Azure Artifacts symbol server.- task:PublishSymbols@2 inputs:#SymbolsFolder: '$(Build.SourcesDirectory)' # string. Path to symbols folder. Default: $(Build.SourcesDirectory). SearchPattern:'**/bin/**/*.pdb'# string. Required. Search pattern. Default: **/bin/**/*.pdb.#Manifest: # string. Manifest. #IndexSources: true # boolean. Index sources. Default: true.#PublishSymbols: true # boolean. Publish symbols. Default: true. SymbolServerType:# 'TeamServices' | 'FileShare'. Required when PublishSymbols = true. Symbol server type. #SymbolsPath: # string. Optional. Use when PublishSymbols = true && SymbolServerType = FileShare. Path to publish symbols. #CompressSymbols: false # boolean. Optional. Use when SymbolServerType = FileShare. Compress symbols. Default: false.#SymbolExpirationInDays: '36530' # string. Optional. Use when PublishSymbols = true && SymbolServerType = TeamServices. Symbol Expiration (in days). Default: 36530.# Advanced#IndexableFileFormats: 'Default' # 'Default' | 'Pdb' | 'SourceMap' | 'All'. Optional. Use when PublishSymbols = true && SymbolServerType = TeamServices. Symbol file formats to publish. Default: Default.#DetailedLog: true # boolean. Verbose logging. Default: true.#TreatNotIndexedAsWarning: false # boolean. Warn if not indexed. Default: false.#UseNetCoreClientTool: false # boolean. Use NetCore client tool. Default: false.#SymbolsMaximumWaitTime: # string. Max wait time (min). #SymbolsProduct: # string. Product. #SymbolsVersion: # string. Version. #SymbolsArtifactName: 'Symbols_$(BuildConfiguration)' # string. Artifact name. Default: Symbols_$(BuildConfiguration).
YAML
# Index sources and publish symbols v2# Index your source code and publish symbols to a file share or Azure Artifacts symbol server.- task:PublishSymbols@2 inputs:#SymbolsFolder: '$(Build.SourcesDirectory)' # string. Path to symbols folder. Default: $(Build.SourcesDirectory). SearchPattern:'**/bin/**/*.pdb'# string. Required. Search pattern. Default: **/bin/**/*.pdb.#IndexSources: true # boolean. Index sources. Default: true.#PublishSymbols: true # boolean. Publish symbols. Default: true. SymbolServerType:# 'TeamServices' | 'FileShare'. Required when PublishSymbols = true. Symbol server type. #SymbolsPath: # string. Optional. Use when PublishSymbols = true && SymbolServerType = FileShare. Path to publish symbols. #CompressSymbols: false # boolean. Optional. Use when SymbolServerType = FileShare. Compress symbols. Default: false.#SymbolExpirationInDays: '36530' # string. Optional. Use when PublishSymbols = true && SymbolServerType = TeamServices. Symbol Expiration (in days). Default: 36530.# Advanced#IndexableFileFormats: 'Default' # 'Default' | 'Pdb' | 'SourceMap' | 'All'. Optional. Use when PublishSymbols = true && SymbolServerType = TeamServices. Symbol file formats to publish. Default: Default.#DetailedLog: true # boolean. Verbose logging. Default: true.#TreatNotIndexedAsWarning: false # boolean. Warn if not indexed. Default: false.#UseNetCoreClientTool: false # boolean. Use NetCore client tool. Default: false.#SymbolsMaximumWaitTime: # string. Max wait time (min). #SymbolsProduct: # string. Product. #SymbolsVersion: # string. Version. #SymbolsArtifactName: 'Symbols_$(BuildConfiguration)' # string. Artifact name. Default: Symbols_$(BuildConfiguration).
YAML
# Index sources and publish symbols v2# Index your source code and publish symbols to a file share or Azure Artifacts symbol server.- task:PublishSymbols@2 inputs:#SymbolsFolder: '$(Build.SourcesDirectory)' # string. Path to symbols folder. Default: $(Build.SourcesDirectory). SearchPattern:'**/bin/**/*.pdb'# string. Required. Search pattern. Default: **/bin/**/*.pdb.#IndexSources: true # boolean. Index sources. Default: true.#PublishSymbols: true # boolean. Publish symbols. Default: true. SymbolServerType:# 'TeamServices' | 'FileShare'. Required when PublishSymbols = true. Symbol server type. #SymbolsPath: # string. Optional. Use when PublishSymbols = true && SymbolServerType = FileShare. Path to publish symbols. #CompressSymbols: false # boolean. Optional. Use when SymbolServerType = FileShare. Compress symbols. Default: false.# Advanced#DetailedLog: true # boolean. Verbose logging. Default: true.#TreatNotIndexedAsWarning: false # boolean. Warn if not indexed. Default: false.#SymbolsMaximumWaitTime: # string. Max wait time (min). #SymbolsProduct: # string. Product. #SymbolsVersion: # string. Version. #SymbolsArtifactName: 'Symbols_$(BuildConfiguration)' # string. Artifact name. Default: Symbols_$(BuildConfiguration).
YAML
# Index sources and publish symbols v2# Index your source code and publish symbols to a file share or Azure Artifacts Symbol Server.- task:PublishSymbols@2 inputs:#SymbolsFolder: '$(Build.SourcesDirectory)' # string. Path to symbols folder. Default: $(Build.SourcesDirectory). SearchPattern:'**/bin/**/*.pdb'# string. Required. Search pattern. Default: **/bin/**/*.pdb.#IndexSources: true # boolean. Index sources. Default: true.#PublishSymbols: true # boolean. Publish symbols. Default: true. SymbolServerType:# 'TeamServices' | 'FileShare'. Required when PublishSymbols = true. Symbol server type. #SymbolsPath: # string. Optional. Use when PublishSymbols = true && SymbolServerType = FileShare. Path to publish symbols. #CompressSymbols: false # boolean. Optional. Use when SymbolServerType = FileShare. Compress symbols. Default: false.# Advanced#DetailedLog: true # boolean. Verbose logging. Default: true.#TreatNotIndexedAsWarning: false # boolean. Warn if not indexed. Default: false.#SymbolsMaximumWaitTime: # string. Max wait time (min). #SymbolsProduct: # string. Product. #SymbolsVersion: # string. Version. #SymbolsArtifactName: 'Symbols_$(BuildConfiguration)' # string. Artifact name. Default: Symbols_$(BuildConfiguration).
Inputs
SymbolsFolder - Path to symbols folder string. Default value: $(Build.SourcesDirectory).
Specifies the path to the folder that is searched for with symbol files. The default is $(Build.SourcesDirectory). Otherwise, specify a rooted path, such as $(Build.BinariesDirectory)/MyProject.
Note
UNC paths aren't supported if you select the Azure Artifacts symbol server as the server type.
SymbolServerType - Symbol server type string. Required when PublishSymbols = true. Allowed values: TeamServices (Symbol Server in this organization/collection (requires Azure Artifacts)), FileShare (File share).
Specifies where to publish symbols. Symbols published to the Azure Artifacts symbol server are accessible by any user with access to the organization/collection. Azure DevOps Server only supports the File share option. See instructions to Publish symbols for debugging to use Symbol Server in Azure Artifacts.
SymbolsPath - Path to publish symbols string. Optional. Use when PublishSymbols = true && SymbolServerType = FileShare.
Specifies the file share that hosts your symbols. This value will be used in the call to symstore.exe add as the /s parameter.
To prepare your SymStore symbol store:
Set up a folder on a file-sharing server to store the symbols. For example, set up \fabrikam-share\symbols.
If you leave this argument blank, your symbols will be source indexed but not published. You can also store your symbols with your drops. See Publish Build Artifacts.
CompressSymbols - Compress symbols boolean. Optional. Use when SymbolServerType = FileShare. Default value: false.
Compresses symbols when publishing to file share.
SymbolExpirationInDays - Symbol Expiration (in days) string. Optional. Use when PublishSymbols = true && SymbolServerType = TeamServices. Default value: 36530.
Specifies the number of days that symbols should be retained.
IndexableFileFormats - Symbol file formats to publish string. Optional. Use when PublishSymbols = true && SymbolServerType = TeamServices. Allowed values: Default (The Default set of symbols to upload), Pdb (Only Pdb based symbols Windows pdb's and managed Portable pdb's.), SourceMap (Only JavaScript based SourceMap symbols (*.js.map)), All (All supported symbol formats). Default value: Default.
Specifies which debug formats to publish to the symbol server.
TreatNotIndexedAsWarning - Warn if not indexed boolean. Default value: false.
Specifies whether to warn if sources are not indexed for a PDB file. Otherwise, the messages are logged as normal output.
UseNetCoreClientTool - Use NetCore client tool boolean. Default value: false.
Specifies whether to use a version of the symbol upload tool that supports DWARF and ELF files. This option only matters on Windows agents. On non-Windows agents, the version of the symbol upload tool that supports DWARF and ELF files will always be used.
SymbolsMaximumWaitTime - Max wait time (min) string.
Specifies the number of minutes to wait before failing this task.
SymbolsProduct - Product string.
Specifies the product parameter to symstore.exe. The default is $(Build.DefinitionName).
SymbolsVersion - Version string.
Specifies the version parameter to symstore.exe. The default is $(Build.BuildNumber).
SymbolsArtifactName - Artifact name string. Default value: Symbols_$(BuildConfiguration).
Specifies the artifact name to use for the symbols artifact. This should only be used with the FileShare symbol server type. The default is Symbols_$(BuildConfiguration).
Use this task to index your source code and publish your symbols to a file share or Azure Artifacts symbol server.
Indexing your source code allows you to use your symbol files to debug your application on a machine other than the one you used to build your application. For example, you can debug an application built by a build agent from a dev machine that does not have the source code.
Symbol servers enables your debugger to automatically retrieve the correct symbol files without knowing product names, build numbers, or package names.
მნიშვნელოვანი
To delete symbols that were published using the Index Sources & Publish Symbols task, you must first delete the build that generated those symbols. This can be accomplished by using retention policies or by manually deleting the run.
How does indexing work?
By choosing to index the sources, an extra section will be injected into the PDB files. PDB files normally contain references to the local source file paths only E.g: C:\BuildAgent_work\1\src\MyApp\Program.cs. The extra section injected into the PDB file contains mapping instructions for debuggers. The mapping information indicates how to retrieve the server item corresponding to each local path.
The Visual Studio debugger will use the mapping information to retrieve the source file from the server. An actual command to retrieve the source file is included in the mapping information. Example:
Symbols are associated with the build that published to Azure Pipelines they are associated with a build. When the build is deleted either manually or using retention policies, the symbols are also deleted. If you want to retain the symbols indefinitely, mark the build as Retain Indefinitely.
შემოუერთდით Meetup სერიას, რათა შექმნათ მასშტაბური AI გადაწყვეტილებები რეალურ სამყაროში გამოყენების შემთხვევებზე დაყრდნობით თანამემამულე დეველოპერებთან და ექსპერტებთან.