ElectronNET with Dotvvm

Hey,
Someone already tried to run ElectronNET with DOTVVM ?

I’m using current version for both and setup using Normal-API for ElectronNET. I have been trying to make them run together but I can only have a blank window on Electron.
In the console logs I get a “The assembly DotVVM.Framework was not found” and I can’t run the dotvvm website anymore neither.

Something broke after instaling ElectronNET? Someone is able to make Dotvvm run with electron?

Current Program.cs

Best regards,

Can you post the entire exception including the stack trace?
Is the exception in the server-side log, or in the dev tools console log in the Electron window?
How does the Startup.cs file look like?

For the Startup.cs, I have the default one, I just added the following code at the end of Configure():
Electron.WindowManager.CreateWindowAsync();

This exception appears in the command line after running ‘electronize start’. In the console log of the electron window I only get an error 500 (electron window with blank page.)

I tried to remover the Electron.WindowManager.CreateWindowAsync() from Startup.cs e remove the useElectron() from the Program.cs and when I run the project and the website stopped working.

I’ve probably found the issue. The electronize start command publishes the app as a single file which is not supported by DotVVM right now. Also, there is ReadyToRun option - I don’t know how well DotVVM supports it.

I got it work using the following command:
electronize start /PublishSingleFile false /PublishReadyToRun false

I am not sure whether it is possible to set these arguments via some configuration file.

2 Likes

Thank you for the help and explanation, I’ve been searching and it looks like the only way is by running your command. The electronize config file has nothing to config that.

You can definitely use ReadyToRun with DotVVM. Although it might not have a high impact on the real startup time, since DotVVM cannot precompile the View.

I suppose the problem with single-file deployment is that DotVVM has to have access to the dothtml files. If you really want to avoid shipping the Views folder, you can add them as embedded resources and then reference them as embedded://Assembly/ResourceName. We have it described for controls Markup Control Registration | DotVVM Documentation, but it should work for normal views too.

There was also some problem with assembly loading. I am afraid that we don’t have this scenario covered by tests, so there may be more things that won’t work.

Spliting into 2 separate projects and using Electron IPC to communicate with the port where the dotvvm “frontend” project is running is a solution or not so good idea?
They would be published separately too…

I think this is quite a common solution. It depends on whether you want to embed the DotVVM application and ship it with the Electron app, or whether the DotVVM app should run on the server and the Electron is just a “window” in which the application appears.