-
-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error's trying to call C# .NET 5.0 "Self-Contained" "Single-File" DLL on Windows without any .NET Frameworks Installed #131
Comments
Hello @harlankoehn and @agracio ! By any chance, did you find a solution to this issue? I am experiencing the same issue only after packaging. I am running electron-builder, and everything works in developer builds. I have the C# published project folder set in extraResources. I'm on .NET 6.0, but
And I receive the following error no matter what I do in playing with various publishing or packaging settings:
Following is a printout of the files in the EDGE_APP_ROOT file list
And following is a printout of the files in the EDGE_APP_ROOT/refs file list
Here is my repo on the current commit: https://github.com/paranext/paranext-core/tree/d1a6a02d48602283ff7b4b542c505f9503593ec7 Thank you very much for the help! Please let me know if you have any ideas. EDIT: I printed the stack trace of the edge code where it was throwing this "parent does not exist" stuff (note that 'electronAPI.edge.invoke' is the ipc channel for edge stuff as I have change to using a preload and
This exception is thrown during
I have tried importing Because the standalone instructions in edge.js's readme say to use
I also ran the production build while logging some kind of dll interaction using a tool called Fusion++, and that indicated an error with Fusion++ edge_nativeclr error full log
Reproduced from the error log is the following critical piece:
I suppose |
In my case we resorted to building a console app which references our DLL. Then we have to call that console application with some parameters from within Electron. We were able to package the console application as a stand alone executable but we had to use the Publish feature in Visual Studio to get it to bundle correctly into one file. Nothing ideal about what we resorted to but it does work. |
We were hoping to distribute our Electron app along with our .NET DLL and without any requirements to install any .NET Frameworks. So far, I haven't been able to achieve this.
As a test, I've written a small desktop app that utilizes this exact same DLL file, published it, and ran it on a clean Win10 VM that doesn't have any .NET frameworks installed. It runs without any problems.
When I take the DLL, copy over the same supporting DLL files needed by the desktop app, and also include a [projectname].deps.json file, and then run the Electron app, I get this error message:
With: process.env.EDGE_USE_CORECLR = 1
Unhandled Exception Error: This is not a published, standalone application and we are unable to locate the .NET Core SDK. Please make sure that it is installed; see http://microsoft.com/net/core for more details. at process.func [as dlopen] (electron/js2c/asar_bundle.js:5:1846)
Without any process.env.EDGE_USE_CORECLR statement
We get this:
System.TypeLoadException: Could not load type 'System.Object' from assembly 'System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' because the parent does not exist.
Or this:
System.IO.FileNotFoundException: Could not load file or assembly 'System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified.
Our DLL project file looks like this:
I've attached a screenshot of our DLL publish settings. This just produces a NUPKG file that when expanded, doesn't include any of the supporting DLL's needed.
Just to reiterate, how can we call functions in a .NET 5.0 or 6.0 DLL without having to install any .NET framework on the target machine? Would we have better luck if we targeted .NET 4.6 or some older version of .NET Core? Is this a problem in Edge or a problem with .NET Core? Also, do we need to target "Any CPU", "Win-x86" or "Win-x64"? We currently only need our Electron app to work on Windows but we intend to support both 32bit and 64bit versions.
The text was updated successfully, but these errors were encountered: