## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
David
@dava2788
Hello All, how are you?
I'm a rookie with Electron.NET
Can you guys help me.
I'm trying to follow this video tutorial
But I'm using the .NET 6.0. 202
And in this version Microsoft merge the program.cs with the starup.cs
Not sure what are the changes I will need to do for this new file.
Huseyn Burhonov
@HuseynBurhonov
Hello everyone! I have a question. I need do downgrade electron build app version in C# project. Do you have any useful link ?
Huseyn Burhonov
@HuseynBurhonov
Now I make installation app and electron installs it automatically. There maybe any bug in new version, so i want to send command to downgrade the app version to old build that worked fine. How to realize this function ?
win32nipuh
@win32nipuh
Nobody, we are alone at this Earth....
Mudasar Ellahi
@mudasarellahi
@dava2788 You can add following line after CreateBuilder
builder.WebHost.UseElectron(args);
Mudasar Ellahi
@mudasarellahi
Is there a way to bundle everything inside win-unpacked folder as single file and provide that as portable application?
3 replies
teremy
@teremy
Hi, there is still no documentation for Electron.NET, right? Is there some sort of roadmap or what are the plans regarding this matter?
AlphaZeroUno
@AlphaZeroUno
After electronize start I get this error. With older binance.net libraries this does not happen.
You can help me? thank you
AlphaZeroUno
@AlphaZeroUno
webBuilder.UseElectron (args);
does not solve the problem
AlphaZeroUno
@AlphaZeroUno
with NET 6 works ( builder.WebHost.UseElectron(args);). Thank you
win32nipuh
@win32nipuh
Hi , I'd like to remind on Windows: >electronize build /target linux does not work
3 replies
Georgi Blazhev
@georgi-blazhev
Hello,
Do you know why Electron is removing the file extension of the file I'm downloading from my backend and saving it simply as File, even though the extension is in the name?
For example "Mock-Excel.xlsx" is saved simply as "Mock-Excel" and is of type File
Garrkrom
@Garrkrom

Hi, I got a problem with a "Hello World" application with VSCode on Ubuntu 22.04.1 LTS. What I did so far is:

1. dotnet new mvc -o HelloWorld
3. dotnet tool install ElectronNET.API -g
4. using ElectronNET.API; // In Program.cs, but this shows: "Type or Namespace name ElectronNET could not be found"; csharp CS0246
5. electronize init # This states I must install .NET, it searches for Version '5.0.0' but I have Version 6.0.108 installed.

Do I need Version 5, too? Or is there something else missing? On my Windows machine I was up and running at this point.

2 replies
The HelloWorld.csproj file contains:
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
...
Garrkrom
@Garrkrom
Do I have to build the API and CLI from the Main branch in order to work on Linux?
rtwin
@rtwin:staphup.nl
[m]
hi, i've got an electronics question. even though this doesn't seem to be a place where it's discussed, i could be lucky that someone knows the answer. Can i ask my question?
K.Milchev
@KristiforMilchev

Hey guys, can someone help out, recently i worked on application that i built in .Net MAUI, favoribly enough, its 90% compatible with blazorserver so i decided to utilize Electron.Net to port it respectivly to Linux and Mac as the MAUI side doesn't seem that good as an alternative, installation is tedious and most users can't figure it out.

So, everything ok with porting the application but i can't get the browser window to show, initially Electron.Net.CLI was throwing and error that it doesn't support .Net 6, i had to clone the project and recompile it under .Net 6, so now it seems to be somewhat working. However when i try to dotnet-electronize start using the compiled binary in .Net 6, the application starts as usual but the browser window doesn't open, does anyone have any ideas what might be the issues with this:?

using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using SYNCWallet.Services.Definitions;
using SYNCWallet.Services.Implementation;
using NFTLock.Data;
using SYNCWallet.Data;
using ElectronNET.API;
using Microsoft.AspNetCore.Server.Kestrel.Https;
using ElectronNET.API.Entities;

var builder = WebApplication.CreateBuilder(args);

Electron.App.On("select-client-certificate", (obj) => { Console.WriteLine("select-client-certificate"); Electron.Notification.Show( new NotificationOptions("select-client-certificate", $"select-client-certificate event has been captured") { Silent = false, }); }); // --- Add electron... builder.Services.AddElectron(); builder.WebHost.ConfigureKestrel(o => { o.ConfigureHttpsDefaults(o => o.ClientCertificateMode = ClientCertificateMode.RequireCertificate); }).UseElectron(args); // Add services to the container. builder.Services.AddRazorPages(); builder.Services.AddServerSideBlazor(); builder.Services.AddSingleton<WeatherForecastService>(); builder.Services.AddScoped(typeof(IUtilities), typeof(Utilities)); builder.Services.AddScoped(typeof(IHardwareService), typeof(HardwareService)); builder.Services.AddScoped(typeof(IAuthenicationService), typeof(AuthenicationHandler)); builder.Services.AddScoped(typeof(IContractService), typeof(ContractService)); builder.Services.AddScoped(typeof(IPaymentService), typeof(PaymentService)); builder.Services.AddScoped(typeof(ICommunication), typeof(Communication)); var app = builder.Build(); // Configure the HTTP request pipeline. if (!app.Environment.IsDevelopment()) { app.UseExceptionHandler("/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } var scope = app.Services.CreateScope(); Initializer.Provider = scope.ServiceProvider; app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRouting(); app.MapBlazorHub(); app.MapFallbackToPage("/_Host"); // Open the Electron-Window here System.Console.WriteLine("Starting Main window"); Task.Run(() => { var window = Electron.WindowManager.CreateWindowAsync(); }); app.Run(); David @dava2788 Hello all, I'm using Visual Studio 2022 net 6.0 for create a react project. I used the ASP.Net Core with React.JS template But with the latest project change the electronize start is not working. I suspect the error is related to the app.UseStaticFiles I added. Can anyone help with this error, following is my program.cs: using ElectronNET.API; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.FileProviders; using RageWindowsAplication.Models; var builder = WebApplication.CreateBuilder(args); builder.WebHost.UseElectron(args); // Add services to the container. builder.Services.AddControllersWithViews(); //Adding Dependency Injection builder.Services.AddDbContext<QuizDbContext>(options => options.UseSqlServer(builder.Configuration.GetConnectionString("DevConnection"))); var app = builder.Build(); //This config is for allow any external port number appication call the API Methds //app.UseCors(options=> options.WithOrigins("Https://localhost:3000").AllowAnyMethod().AllowAnyHeader()); // Configure the HTTP request pipeline. if (!app.Environment.IsDevelopment()) { // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseHttpsRedirection(); app.UseRouting(); //This is to fix //Enable the statis files for this API //And Be able to Load the Images //for Static file app.UseStaticFiles(new StaticFileOptions { FileProvider = new PhysicalFileProvider(Path.Combine(builder.Environment.ContentRootPath, "Images")), RequestPath = "/Images" }); app.MapControllerRoute( name: "default", pattern: "{controller}/{action=Index}/{id?}"); app.MapFallbackToFile("index.html"); //Add the Electron if (HybridSupport.IsElectronActive) { CreateWindow(); } async void CreateWindow() { var window = await Electron.WindowManager.CreateWindowAsync(); var Webwindow = await Electron.WindowManager.CreateBrowserViewAsync(); window.OnClose += Window_OncClosed; window.OnMaximize += Window_OnMaximize; window.OnMinimize += Window_OnMinimize; }//end CreateWindow void Window_OncClosed() { Electron.App.Exit(); }//end Window_OncClosed void Window_OnMaximize() { Electron.Dialog.ShowErrorBox("Demo Maximized Envent", "Hi, you Just maimixed you Electron App"); }//end Window_OncClosed void Window_OnMinimize() { Electron.Dialog.ShowMessageBoxAsync("Ventana minimizada"); }//end Window_OncClosed app.Run(); PPL-Ryan @PPL-Ryan Hello all, I'm trying to build an application for mac and Windows and I'm running into an issue right now. When I run Electronize start on my mac I get a blank electron window and the console reads the following "(node:14402) electron: Failed to load URL: http://localhost:8002/ with error: ERR_CONNECTION_REFUSED" If I go to the menubar and click refresh the page loads and I get another message "warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3] Failed to determine the https port for redirect." please let me know what information would be helpful in getting past this thank you! PPL-Ryan @PPL-Ryan changing this line var browserWindow = await Electron.WindowManager.CreateWindowAsync(browserWindowOptions); to this async void CreateWindow() { var window = await Electron.WindowManager.CreateWindowAsync(browserWindowOptions); window.OnClosed += () => { Electron.App.Quit(); }; } fixed the issue Chris Hartley @bigredhdl Hello. I'm another person struggling to get this working in .net 6. Right now I'm just trying to get the example running. I built the repo and did  dotnet C:\Users\chris\source\repos\Electron.NET\ElectronNET.CLI\bin\Debug\net6.0\dotnet-electronize.dll start inside the ElectronNET.WebApp folder. I see some errors in the output: npx tsc -p ../../ElectronHostHook ../../ElectronHostHook/connector.ts(2,33): error TS2503: Cannot find namespace 'SocketIO'. ../../ElectronHostHook/excelCreator.ts(1,24): error TS2307: Cannot find module 'exceljs' or its corresponding type declarations. ../../ElectronHostHook/excelCreator.ts(2,37): error TS2307: Cannot find module 'exceljs' or its corresponding type declarations. ../../ElectronHostHook/index.ts(7,25): error TS2503: Cannot find namespace 'SocketIO'. and the demo app fails to launch with: stderr: System.Exception: You need to run once the electronize-h5 start command to bootstrap the necessary files at ElectronNET.API.Electron.Experimental.StartElectronForDevelopment(Int32 webPort, String projectPath, String[] extraElectronArguments, Boolean clearCache) in ?>C:\Users\chris\source\repos\Electron.NET\ElectronNET.API\Electron.Experimental.cs:line 58 at ElectronNET.WebApp.Program.Main(String[] args) in C:\Users\chris\source\repos\Electron.NET\ElectronNET.WebApp\Program.cs:line 22 at ElectronNET.WebApp.Program.<Main>(String[] args) stderr: System.Exception: You need to run once the electronize-h5 start command to bootstrap the necessary files at ElectronNET.API.Electron.Experimental.StartElectronForDevelopment(Int32 webPort, String projectPath, String[] extraElectronArguments, Boolean clearCache) in >C:\Users\chris\source\repos\Electron.NET\ElectronNET.API\Electron.Experimental.cs:line 58 at ElectronNET.WebApp.Program.Main(String[] args) in C:\Users\chris\source\repos\Electron.NET\ElectronNET.WebApp\Program.cs:line 22 at ElectronNET.WebApp.Program.<Main>(String[] args) .NET process exited with code 3762504530 Will quit Electron, as exit code != 0 (got 3762504530) Chris Hartley @bigredhdl Looking at some of the forks on github it is starting to look like others are just fixing issues on their own forks and not opening PRs back to ElectronNET. Luigi Bellanca @g1ga oh wow... why suddenly PrintToPdfAsync crash the application? witlock @witlock hi, any idea on how to solve this witlock @witlock I think the issue is that an iframe is trying to do it schaveyt @schaveyt ATTN: What is holding up the next release of Electron.NET. Patience has run out. Been waiting since March for a new release there is means for the user community to understand when releases will be made or when one is coming. There have been a number of tiny but important PRs from Q4 2021 to Q2 2022 that have been merged into master yet there is no communication from the project owners? And yes, I am a donating and contributing member to this project. How about a Tweet or a Blog post or something to let the user community understand what is going on. billymaat @billymaat How does Electron.NET know that the web api backend has started before opening the window? Luigi Bellanca @g1ga Can we have access to buildVersion as in electron.manifest from code? 1 reply Garrkrom @Garrkrom Does anyone have a solution for running electronize on Ubuntu 22.04. .NET 5.0 is not available here (deprecated). But the command "electronize start" depends on it being installed. Is there some community unstable version available? 9 replies Mitja Stovanje @mitjas:matrix.org [m] Hi, I have one question I have problems with caching old files. So the scenario is that you install version1(packed with electronize build /win), open the application, everything is ok, then install version 2 and somehow I am getting 404 files not found. I am using .net6 and vue. I also manually check if index.html is updated with a newer version and everything looks fine. If the user reloads the application manually using ctr+r everything works fine any idea? I am struggling right now :) Kirill Zhukov @kirill-zhukov Hi guys. I've just started a fresh BlazorServer app and added latest available at nuget electron.net to it (13.5.1). However I can't debug, when I attach to the electronize process and set breakpoint, VS sais there's no debug info available One thing I did is I didn't add .UseEnvironment("Development") since it didn't start any Electron window when it was added. Could it be the case? .NET 6 SDK Rajesh Babu @rajeshbabu:matrix.org [m] Hi Guys, I am facing some issue with Electron builder ERR_ELECTRON_BUILDER_CANNOT_EXECUTE in Windows machine while running npm run dist any suggestions? Yves Schelpe @aredfox So, what is the main difference between ElectronNET and the forked by theolivenbaum (both are on NuGet, and on github at theolivenbaum I see no reason why he forked it, or what the main diff is). I also see the ElectronNET's updates are old, and not so active. So I wonder, which one should I use? 7 replies Dalibor Kundrat @damikun Hello is anyboady familiar with issue when electron work in Debug and Pack in Machine but when i Build .exe in CI and download it open just white window... Cannot debug it.. because normaly all works... 3 replies Neeko @NeekoGta Hi ! I'm starting with ElectroNET, juste waching this video : https://www.youtube.com/watch?v=nuM6AojRFHk But when I run the application, I got this error : TypeError: Error processing argument at index 0, conversion failure from null at Socket ... Any idea? Thanks! :) ividyon @ividyon Hi, I'm having trouble getting Electron.NET to behave nicely in the basic dotnet NET6 ASPNET.Core template app. When running the app normally via its default launch profile, the website connects to the API just fine via localhost:44408/weatherforecast. When running from commandline via electronize start or electronize start /watch, it cannot connect to the API. I do notice, however, that localhost:8001/weatherforecast works, which is the "Electron Port" which I haven't actually set up anywhere. When trying to run the launch profile added by Electron.NET, it results in "catastrophic failure" altogether. Basically, as a newbie, I can't make sense of this port salad and I'm not sure what I'm supposed to be doing, given that I feel I've followed official instructions, but an otherwise unchanged default dotnet app with default api example is failing to work. 6 replies Matthew @Jonez_gitlab Hi, I'm pretty new at using electron anyone have any idea how to get select2 working? Do I have to use hosthook? Currently getting$(...).select2() is not a function.
usingsystem007
@usingsystem007

Hi. I run the application. i got this error "CodeBase is not supported on assemblies loaded from a single-file bundle."

• load 3rd party library (installed nuget package)

i checked and ther is no .dll file in the .exe folder

win32nipuh
@win32nipuh
How to use Electron on NET 6 -NET 7 applications? i.e. using Program without Startup
win32nipuh
@win32nipuh
I develop my Blazor app in Windows. Can I build it for Linux using Electron.NET as it was possible 2 years ago?