You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
am I doing something wrong to miss the runtime? when running the c# function from c# it works
for the published version: am I doing something wrong to miss the function there or is it a bug that this dll doesn't get modified?
more details
I have simple C# code:
public class EntryPoint
{
[DllExport(CallingConvention = CallingConvention.StdCall)]
public static void StartApplication()
{
Console.WriteLine("Application started from C# DLL!! !");
}
}
it is in a project targeting .NET 8.0. When running the following c++ code:
int main()
{
HMODULE appModule = LoadLibraryEx(L"Dummy.dll", nullptr, 0);
auto startApplicationFunction = GetProcAddress(appModule, "StartApplication");
startApplicationFunction();
return 0;
}
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
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:The text was updated successfully, but these errors were encountered: