Skip to content

Getting Started with electron edge

License

CC0-1.0, MIT licenses found

Licenses found

CC0-1.0
LICENSE.md
MIT
License.txt
Notifications You must be signed in to change notification settings

weliwita/electron-edge-sample

Repository files navigation

electron-edge-sample

Getting Started with electron-edge

This is an attempt to get a electron app up and running with .net core. I had to use older preview version of dotnet core 1.0.0-preview2-003121 to get everything up and running. Need to upgrade the sample if newer versions are supported.

Running The sample

Please note that this sample run on dotnet core 1.0.0-preview2-003121. You may try pointing to different versions of core clr in global.json file.

> npm install
> cd core_modules\helloworld
> dotnet restore
> dotnet build
> set EDGE_USE_CORECLR=1
> npm run start

When run, the electron app spit out a console log with the message from core dll

Hello from dot net core

scaffalding the core dll project

> cd core_modules\helloworld 
> dotnet new -t Lib

Add nessasary code for startup class

namespace HelloWorld
{
    using System.Threading.Tasks;
    public class Startup
    {
        public async Task<object> Invoke(object input)
        {
            return "Hello from dot net core";
        }
    }
}

Reference the startup class in the js file

var helloWorld = edge.func({
  assemblyFile: path.join(__dirname, 'core_modules\\helloworld\\bin\\Debug\\netstandard1.6\\helloworld.dll'),
  typeName: 'HelloWorld.Startup'
});

common issues you may encounter while running this sample

Could not load file or assembly 'System.Runtime, Version=4.1.0.0, ...'

You have fall back to .net framework native clr mode. Switch to CoreCLR mode.

>set EDGE_USE_CORECLR=1

About

Getting Started with electron edge

Resources

License

CC0-1.0, MIT licenses found

Licenses found

CC0-1.0
LICENSE.md
MIT
License.txt

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published