Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Support for .NET Core 2.0 #48

Open
the-owl opened this issue Aug 21, 2017 · 2 comments
Open

Support for .NET Core 2.0 #48

the-owl opened this issue Aug 21, 2017 · 2 comments

Comments

@the-owl
Copy link

the-owl commented Aug 21, 2017

Is .NET Core 2.0 supported under Linux? I tried a hello world example, but it gave me a CoreCLR initialization error.

index.js looks like this:

var edge = require('electron-edge');

var helloWorld = edge.func(`
    async (input) => { 
        return ".NET Welcomes " + input.ToString(); 
    }
`);

helloWorld('JavaScript', function (error, result) {
    if (error) throw error;
    console.log(result);
});

Trying to run it produces the following output:

$ node_modules/.bin/electron index.js 
CoreClrEmbedding::Initialize - Failed to initialize CoreCLR, HRESULT: 0x80070057
App threw an error during load
TypeError: edge.initializeClrFunc is not a function
    at Object.exports.func (/home/theowl/projects/work/dotnet/testapp/node_modules/electron-edge/lib/edge.js:169:17)
    at Object.<anonymous> (/home/theowl/projects/work/dotnet/testapp/index.js:3:23)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at loadApplicationPackage (/home/theowl/projects/work/dotnet/testapp/node_modules/electron/dist/resources/default_app.asar/main.js:280:12)
    at Object.<anonymous> (/home/theowl/projects/work/dotnet/testapp/node_modules/electron/dist/resources/default_app.asar/main.js:322:5)
    at Module._compile (module.js:571:32)
/home/theowl/projects/work/dotnet/testapp/node_modules/electron/dist/resources/default_app.asar/main.js:6068: Uncaught TypeError: edge.initializeClrFunc is not a function

Electron: v1.5.0
Node.js: v7.4.0
.NET Core: v2.0.0
OS: Fedora 26

@agracio
Copy link

agracio commented Sep 25, 2017

Electron-edge is based on Edge.js that does not support .NET Core versions above 1.0.0.
I maintain a fork of edge called edge-js (https://github.com/agracio/edge-js) that offers support for .NET Core 2.0 although it might have issues.
And just as electron-edge extends edge to support Electron platform there is electron-edge-js (https://github.com/agracio/electron-edge-js) to support Electron. It includes all features of edge-js and offers support for multiple Electron platforms.
Try it out and let me know if it works for you.

@Lestjer
Copy link

Lestjer commented Jan 12, 2018

hi @agracio

when I run my application with npm start, it runs without problem but after build it with electron-builder it shows: "edge.initilizeClrFunc is not a function at Object.exports.func .."

electron: v1.7.10
electron-edge-js: v8.3.0
node: v8.9.4
.NET Core: v2.1.4

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants