Today, I released version 2.1 of my NuGet package LegacyWrapper. It comes with a major enhancement regarding the cross-architecture loading of DLLs: It is now possible to load 64bit DLLs from a 32bit process:
1using (var client = new WrapperClient(TestDllPath, TargetArchitecture.Amd64))
2{
3 result = (int)client.Invoke<TestStdCallDelegate>("TestStdCall", new object[] { input });
4}
As the second constructor parameter is optional and defaults to X86, the new release should be fully backwards compatible.
From now on, there are two wrapper executables, one for each processor architecture. The wrapper client will evaluate the TargetArchitecture
parameter and then execute the appropriate wrapper. The unit tests are aware of the new feature. However, I found no solution to automatically invoke unit tests for both architectures, so they need to be run manually.
[Click here for the original blog post explaining LegacyWrapper.]({% post_url 2015-09-28-legacy-wrapper-invoking-an-unmanaged-32bit-library-out-of-a-64bit-process %})