C# – Modify Assembly Version and References (.NET)

assembliescnetversion

I have an application exe plus 3 referenced assemblies in a folder. Compiled in VS2010, CLR 4.0.

I'd like to modify the version of all 4 assemblies to match (1.0.0.0) and also modify the reference section in each of those assemblies to match the new version number.

Is that possible after the application was already build outside the IDE?

EDIT:

Here is the scenario: Our dlls are often installed in the GAC with a specific version. The version is only incremented when commercial products are released. We have many self written development tools that use some of those dlls that are installed in the GAC. The tools are build at a certain point and not rebuild when the code has changed. The CLR prefers to load the assembly from GAC though instead of the local assemblies, so many times our tools do not use the assemblies that they were build with. Thats a huge problem and I don't see how it could be solved otherwise.

Best Answer

Use Reflector and its plugin Reflexil; of course, if the assemblies are signed they won't work together anymore (actually I think they won't work at all?). Otherwise you won't even need to modify the references I think.

Edit: also, Marc is absolutely right; can't imagine what scenario would absolutely require you to do this, it's quite hackish.