Steps done:
- Standard C# program was made (actually, it’s
https://learn.microsoft.com/en-us/aspnet/core/tutorials/grpc/grpc-start?view=aspnetcore-8.0&tabs=visual-studio).
That works. - A C++/CLR .NET class library was made (I need to keep
some code ‘invisible’ from the users of the executable, not possible
with C#, IP-reasons…). - I want to call a static method from the C++
class. - I made sure both C#/C++ use the same .NET version
(see answer here Managed C++ namespace not accesible in C#.Net during compilation) - The C++ is correctly (I assume) referenced by the C# module, else
compilation would already fail.
When I start the C# program, I get the following error:
System.IO.FileNotFoundException HResult=0x80070002 Message=Could not load file or assembly 'grpc_server_processing, Version=1.0.8900.14343, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified. Source=<Cannot evaluate the exception source> StackTrace: <Cannot evaluate the exception stack trace>
The C++ DLL is where it should be, I also tried copying the DLL to the same folder as the C# executable, same error. Starting C# executable outside Visual Studio: same error. The version number of the DLL in the error message is the same as I see in Visual Studio in the object browser:
I have no idea what could be wrong, any help is very welcome.