Here is my problem. There is a game engine with a core library core2.dll which has a class C in it.
It is a windows class with a c# wrapper.
I want to use mainly all the classes from core2.dll except for one class which I want to use the class from the previous version of the library core1.dll
If you try to call the class from core2.dll it has a 'deprecated error message'.
I think the class is pretty self contained. (Lets say it is some math functions for example) So my thoughts are to include both core2.dll and core1.dll in my project but somehow make the class C only from core1.dll.
Any thoughts on how (if at all ) to achieve this?
If you need to replace part of the code inside core2.dll then you can decompile both using ildasm, change required pieces inside core2.dll and compile it back again.
Run x64_x86 Cross Tools Command Prompt for VS 2017
and execute
ildasm core1.dll /OUT=core1.il
ildasm core2.dll /OUT=core2.il
REM open il files with text editor, find classes in core1.il and replace them in core2.il
REM note, that there might be no core2.res
ilasm core2.il /RESOURCE=core2.res /DLL
This will work absolutely fine if dll is not signed. Even better - you assemble to code so ilasm will ensure your code will work in the runtime. Runtime incompatibility is a pretty annoying issue with binding redirects...
Make sure you don't violate any licenses and copyrights.