After building my class library, I have several .dlls in my bin/Debug directory (some are from my own project while others are from third-party libraries). For example,
MyLibrary.dll
Newtonsoft.Json.dll
NLog.dll
I would like to rename these assemblies so that they include their version number. For example,
MyLibrary-1.0.0.0.dll
Newtonsoft.Json-10.0.3.0.dll
NLog-2.0.0.0.dll
What's the best way to do this? I can't just rename the files. I need to change the assembly names themselves, and propagate those changes to whatever depends on them.
So far, I've found the following solution (see https://stackoverflow.com/a/21753873/1383366):
ildasm /all /out=MyLibrary.il MyLibrary.dll
ilasm /dll /out=MyLibrary-1.0.0.0.dll MyLibrary.il
I'm not just not sure whether this is enough to properly change the assembly name, and I don't know the best way to propagate the name change.