Open ggegoge opened 1 month ago
Hello,
The publish directory has already been discussed earlier https://github.com/3F/DllExport/issues/224#issuecomment-1545023216
It seems I need to add something like this later for automatic generation in future versions.
But this is not the problem in your case:
Could not load file or assembly 'System.Runtime, Version=8.0.0.0,
3F/DllExport project does not officially support the modern .NET 8 platform yet (1.7.4). I apologize for the inconvenience.
FYI: you can temporarily add <LangVersion>latest</LangVersion>
to support some modern language features on older target platforms
tldr
The issue is the following: I manage to create a DLL with my c# functions exposed to C++. But I miss the runtime then, When I try to publish the dll as self contained to generate other DLLs, I am missing the function from the DLL. I believe that the Dll in publish doesn't get modified. Path: to the published dll:
\bin\Release\net8.0-windows\publish\win-x64\*
Question
more details
I have simple C# code:
it is in a project targeting .NET 8.0. When running the following c++ code:
I was using the DLL by simply building the project in visual studio
I am missing the runtime:
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies
I tried to publish the DLL as self contained and then I would paste all of the required DLLs to see if then having System.Runtime.dll clearly in path fixes the issue but the problem then is that the dll created this way does not contain the StartApplication function
for the self contained build:
the csproj for the project itself is
dotnet new classlib
+ DllExport's additionsThe question is related to:
DllExport -version
: v1.7.4.29858+c1cc52fData
tab: