System.Drawing not supported with ASP NET CORE & Electron EDGE JS

184 Views Asked by At

We are building an app(Actually converting) with electron & asp net core in which we came across an issue "System.Drawing is not supported on this platform.". We are using Electron EdgeJS for making server side call from electron app.

https://www.npmjs.com/package/electron-edge-js

In our product system.drawing assembly needed as that forms the core of the app. Without system.drawing assembly we could able to connect to server via Electron-Edgejs.

And it's actually working fine in MVC where we dont run into any issues.

Electron Edge

var getAppDomainDirectory = edge.func({
    assemblyFile: baseDll,
    typeName: localTypeName,
    methodName: 'GetAppDomainDirectory'
});
    

C#

public async Task<object> GetAppDomainDirectory()
{
Image image1 = Image.FromFile(@"Capture.png");
Image image2 = Image.FromFile(@"signature.jpg");
PropertyItem propItem = image1.GetPropertyItem(20624);
propItem.Id = 20625;
image2.SetPropertyItem(propItem);
return "";
}

Exception Snippet

enter image description here

0

There are 0 best solutions below