I have created one tool using console application named "DocumentHashcode" in which I am using third party DLL - DocumentFormat.OpenXml.dll
.
When I'm going to deploy it, I am using DocumentHashcode.exe
and DocumentFormat.OpenXml.dll
for running the application.
I want to rename DocumentFormat.OpenXml.dll
to CATBldHashCodeSupporterDll.dll
. Can anyone advise how to achieve this?
You need to manually load the assembly. The simplest way is to load it before the JITer tries to load the DocumentFormat.OpenXml namespace. You can manually load it like this:
var dllPath = Path.Combine(Directory.GetCurrentDirectory(), "reNamed.dll");
Assembly.LoadFile(dllPath);
Alternatively you could listen to the AppDomain.AssemblyResolve event, which gives you the chance to load the renamed DLL once the JITer has failed to find it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With