All posts by Jens Hantschel

Setting Up A SymBol Server For .NET WITH Bitbucket AND GitLink

Since two years we develop own nuget-packages in our company. It was a problem to debug these packages when we ran into errors with them. So we needed to setup a symbol-server…

If you don’t know what the purpose of a symbol server is, you read about it here:

A guy who set up a symbol server also with bitbucket, posted it experience here:

So, actually, I did nearly the same, but I want to share my own experience with it.

We also use bamboo and build tasks. So we wanted to automate the modifying of the pdb and pushing the pdb to the symbol server. Our script is looking like this:

$workingDir = $Env:bamboo_working_directory 
$shortPlanName = $Env:bamboo_shortPlanName

$pdbFile = $shortPlanName + ".pdb"
$bitbucketProjectKey = "MYNUGETPROJECTS"

$pathToPdb = $workingDir + "\Source\bin\Release\" + $pdbFile

$url = "http://etimgm01.etiscan.local:81/" + $bitbucketProjectKey + "/repos/" + $shortPlanName + "/raw/{filename}/rev/{revision}"
$arguments = $pathToPdb + " --baseDir " + $workingDir + " --url " + $url

Write-Host $pathToPdb
Write-Host $url
Write-Host $arguments

$process = Start-Process -FilePath C:\tools\gitlink\gitlink.exe -ArgumentList $arguments -Wait
Write-Host "Exit-Code GitLink: " + $process.ExitCode

$arguments = "add /r /s \\etisrv01\sources\000_SymbolServer /f " + $pathToPdb + " /t " + $shortPlanName

$process = Start-Process -FilePath "C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\symstore.exe" -ArgumentList $arguments -Wait
Write-Host "Exit-Code symstore: " + $process.ExitCode

As you see, there is a link to a local webserver and not directly to bitbucket. The problem is also mentioned by Shonn Lyga. So we had to set up a URL-Rewrite in an IIS-Server, because “srcsrv.dll” doesn’t support question marks in its URL. The following screenshot shows the incoming rule for the IIS-Server which redirects to the bitbucket-server:

In the powershell script you also find the tool “GitLink“. This tool modifies the pdb and maps the files with the corresponding URL. So you tell the pdb where to find the corresponding source file. Additional informations for GitLink you will find on GitHub.

So I hope that someone is out there who can use this information.

Could not load file or assembly sapnco, Version=

Recently I had the following error:

Could not load file or assembly ‘sapnco, Version=, Culture=neutral, PublicKeyToken=50436dca5c7f7d23’ or one of its dependencies. The system cannot find the file specified.

The version of the SAP-Connector depends on .Net Framework 2.0 and needs “Microsoft Visual C++ 2005 Redistributable Package”. After installing this packaged, the error was solved. You have to install the correct version (x86 or x64).

The “VerifyClickOnceSigningSettings” task failed unexpectedly.

This error occurs when you are trying to develop office applications.

Error        The “VerifyClickOnceSigningSettings” task failed unexpectedly.
System.IO.FileNotFoundException: Could not load file or assembly ‘Microsoft.VisualStudio.Tools.Applications.Hosting, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. Das System kann die angegebene Datei nicht finden.

This error means that he can’t find an assembly which is contained in VSTA-SDK. The SDK can be download from microsoft website.

[] How to return calendar week from a date

This is a method how to calculate the calendar week from a date:

Imports System.Globalization
Public Function getCalendarWeek(ByVal Datum As Date) As Short
Dim CUI As New CultureInfo (CultureInfo.CurrentCulture.Name)
Return CUI.Calendar.GetWeekOfYear(Datum,_
End Function