Mixed C# and C++ solution
dgrinblat
Posts: 4 New member
i have a .net 6 app which takes dependency on 2 libraries. 1st library is written in C#, and the second library is a Managed C++/CLR library. I created an .saproj that embeds both the C# and the C++/CLR libraries into my main app DLL.
When i run the app it crashes at runtime saying it can't load the C++/CLR library.
Is there a way around this? Or would you be able to provide a fix for this in a future release?
I attached my visual studio solution which also includes the .saproj file that is in the "Obfuscated" subfolder.
Thanks,
Dmitry
Answers
I attempted to build your solution from scratch to see the obfuscation behaviour but the CSharpLib dependency appears to be missing?
The directory is present, but there's no resource inside that could be embedded.
Had a look at the project you provided and see that CSharpLib was there and not built.
I could build it to the required DLL and include it in the project.
However I then hit an issue with ManagedCPPLib dependency.
I tried to built it but am missing some packages in my VS env.
For the sake of replicating this, are you able to conduct a build of the project and provide the DLLs directly so we ensure they match what you are using.
I know at a minimum it will be CSharpLib & ManagedCPPLib.
Unsure if there are others, but looking at the project I suspect not.
You can provide the files via this link
https://files.red-gate.com/requests/aYqQg76QiPhNIPKEOifXYH
This link will be active for 14 days.