Index Sources & Publish Symbols step fails in TFS 2015

By : Jensen
Source: Stackoverflow.com
Question!

By default TFS Build creates a "Index Sources & Publish Symbols" step in a Visual Studio Build definition. When the step's property "Path to publish symbols" is empty, everything works fine. But when setting the path to a local directory, the step generates the following error:

2015-09-25T11:00:09.7991491Z Executing the powershell script: C:\NewAgent\tasks\PublishSymbols\1.0.4\PublishSymbols.ps1
2015-09-25T11:00:10.0022755Z Find-Files -SearchPattern **\bin\**\*.pdb -RootFolder C:\NewAgent\_work\990dcb3f\Projects
2015-09-25T11:00:10.0491548Z Found 15 files to index...
2015-09-25T11:00:10.0491548Z Invoke-IndexSources -RepositoryEndpoint <repositoryEndpoint> -SourceFolder C:\NewAgent\_work\990dcb3f\Projects -PdbFiles <pdbFiles>
2015-09-25T11:00:10.6272794Z Invoke-PublishSymbols -PdbFiles <pdbFiles> -Share C:\DebugSymbols -Product EntityMapper -Version 20150925.14 -MaximumWaitTime 7200000 -MaximumSemaphoreAge 1440 -ArtifactName 
2015-09-25T11:00:10.7348541Z ##[error]Can't infer artifact type from artifact location C:\DebugSymbols.
2015-09-25T11:00:10.7504779Z  
2015-09-25T11:00:10.7504779Z Start: AssociateArtifact
2015-09-25T11:00:10.7504779Z ##[error]Artifact Type is required.
2015-09-25T11:00:10.7504779Z End: AssociateArtifact

The pdb files are published to the specified directory, so i don't really understand what is causing the error (which then causes the whole build job to fail).

By : Jensen


Answers

When the step's property "Path to publish symbols" is empty, everything works fine.

Yes, because if symbols path is not set, the script only index sources, not publishing symbols.

But when setting the path to a local directory, the step generates the error

You need prepare your symbol store. In your case setup folder sharing and permissions.



In my case changing the "Path to publish symbols" from

//myserver/symbols

to

\\myserver\symbols

solved the issue. Don't know why this happend to me but ok... :)

By : timtos


This video can help you solving your question :)
By: admin