Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I check my .NET assembly for freshness?

All,

I'm working on a SharePoint project, but this isn't a SharePoint-specific question per-se. I have an assembly I've deployed to a SharePoint farm, and I'd like to verify whether my "newest version" is sitting in the GAC, or if an older version from late yesterday is sitting there instead. This is a test farm, so yes, we are revving versions constantly.

Without doing anything crazy like changing the assembly version itself every time I compile*, is there some assembly property I can check (or set at compile-time)?

*I should clarify, in SharePoint projects we hardcode the assembly's full name in multiple places (including XML files), so changing the assembly version is a less savory option than you might think.

like image 460
Peter Seale Avatar asked Dec 27 '25 14:12

Peter Seale


2 Answers

Assembly Version is the intended mechanism for this, but you could roll your own by comparing an MD5 hash of the GAC assembly with the MD5 of your latest version.

like image 162
Ed Guiness Avatar answered Dec 30 '25 04:12

Ed Guiness


You could use AssemblyFileVersion attribute. From the docs, the AssemblyFileVersion

Instructs a complier to use a specific version number for the Win32 file version resource. The Win32 file version is not required to be the same as the assembly's version number.

like image 25
Rob Windsor Avatar answered Dec 30 '25 03:12

Rob Windsor



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!