c# - Include TFS path in .NET assembly -


when troubleshooting our applications, in many situations cannot sure branch assemblies come from, due imperfect release cycle , human error.

(we have quite lot of different bugfix/feature/test/release branches etc. in our tfs).

the pdb-files can sometimes, in test environment @ least, they're missing or outdated / belong assemblies branch.

so, trying think of way include source branch information inside assembly directly.

surprisingly, not find straight forward way online accomplish this.

my answer below explains approach. happy feedback or alternative solutions.

in short: created custom attribute put intoassemblyinfo.cs. inside attribute's constructor, server path current assembly queried tfs , compiled it.

it's combination of following:

can add custom version strings .net dll?

how path of assembly code in?

get tfs mapped folder of local sub folder of solution?

(note: cannot post actual source code due company restrictions, think it's pretty straight forward.)

to attribute's value later unfortunately not easy getting version number dll-file's properties, @ least possible information need minimum effort. (i use small powershell script that.)


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -