2

Is there a better way to modify the version information of a .NET assembly of the one I am currently using.

My current approach is the following.

I do disassemble the assembly with ildasm:

ildasm /nobar Riolo.WebUI.dll /out=Riolo.WebUI.il 

This will generated also a Riolo.WebUI.res compiled resource file, that I then open and modify with the user interface of Visual Studio, then I do reassemble the assembly back with ilasm:

ilasm Riolo.WebUI.il /OUTPUT=Riolo.WebUI.dll /RESOURCE=Riolo.WebUI.res /DLL /PDB 

There are various issues with this process, the main is obviously that I feel like shooting at a mosquito with a broadside of carronades, then that as I don't know how decompile .res files to .rc files with the command line, I cannot use a command line script, as I have to open Visual Studio to modify the .res file, which means it is very time consuming and somewhat error prone, and, last but not least, I do feel that roundtripping assemblies I may well end up loosing information, even if unwittingly, hence I am afraid I will early or later be bitten in some yet unforeseen scenario.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
aledeniz
  • 431
  • 3
  • 13
  • You could just open the assembly directly without using ildasm.exe, File + Open + File. Edit the native file version resource. It is very unclear why you'd have to do this, getting the right stuff into the assembly in the first place is much easier by editing AssemblyInfo.cs – Hans Passant Oct 05 '11 at 13:40
  • There are various Microsoft tools that generate assemblies without some version info, i.e. **tlbimp.exe** (no company, no copyright, no trademarks and number version always set to 1.0.0.0), or the **Web Deployment projects** (no company, no copyright, no trademarks). – aledeniz Oct 07 '11 at 12:04
  • This bites me in various scenarios, the most obvious being certification for the Windows logo, which requires publisher (company), product name and version number, but also when I have to put together installer for updates (update.exe), as while the interops interface may have changed, their version number has not. – aledeniz Oct 07 '11 at 12:10
  • As I deal with the generation of tens of assemblies, I would love to find a scriptable way to add the missing version info elements as a post build step. – aledeniz Oct 07 '11 at 12:11

0 Answers0