Search code examples
.net-assemblydnspy

Can't install a modified assembly in Global Assembly Cache


Using dnSpy assembly editor I modified a copyrighted IBM assembly (DLL). I fixed a bug in the source code. After compiling the code back to a DLL, I tried to install it into the GAC.

But during this, InstallAssembly threw the following error:

InstallAssembly failed with error -2146234299

Anyone knows what this means? Thanks for any help!

EDIT

On learn.microsoft.com I can see that -2146234299 means FusionErrorSignatureCheckFailed. So it is not possible for me to modify the DLL?


Solution

  • I'm very glad you're not able to do this 🤓. This is exactly what's intended:

    Assemblies deployed in the Global Assembly Cache must have a strong name. When an assembly is added to the Global Assembly Cache, integrity checks are performed on all files that make up the assembly. The cache performs these integrity checks to ensure that an assembly has not been tampered with, for example, when a file has changed but the manifest does not reflect the change.

    Source: Global Assembly Cache