Not able to run F# Core MVC projects #533

Closed
opened 2026-01-29 16:42:15 +00:00 by claunia · 1 comment
Owner

Originally created by @kojo12228 on GitHub (Jul 19, 2020).

  • Version: 9.31.2

.NET Core Version: 3.1
Node.js Version: 12.13.0

  • Target: Windows (10)

First of all, this is a very interesting project that I'm excited to experiment with for building small projects.

The application doesn't work for F# ASP.NET Core MVC applications, or Blazor (using Bolero). While electronize init throws an exception due to only .csproj projects being searched, manually filling the fields of the manifest file to match an equivalent C# project caused electronize start to hang just after outputting stdout: Use Electron Port:

Steps to Reproduce:

  1. Run dotnet new mvc -lang F#
  2. Add ElectronNET project with dotnet add package ElectronNET.API
  3. Add webBuilder.UseElectron(args) |> ignore to Program.fs
  4. Add async { do! Electron.WindowManager.CreateWindowAsync() |> Async.AwaitTask |> Async.Ignore } to Startup.fs
  5. Run electronize init, manually correct "executable", "name", "apiId" and "projectName" to match equivalent C# project
  6. Add CopyToOutputDirectory for electron.manifest.json in *.fsproj
  7. Run electronize start
Originally created by @kojo12228 on GitHub (Jul 19, 2020). <!-- Please search existing issues to avoid creating duplicates. --> <!-- Which version of Electron.NET CLI and API are you using? --> <!-- Please always try to use latest version before report. --> * **Version**: 9.31.2 <!-- Which version of .NET Core and Node.js are you using (if applicable)? --> .NET Core Version: 3.1 Node.js Version: 12.13.0 <!-- What target are you building for? --> * **Target**: Windows (10) <!-- Enter your issue details below this comment. --> <!-- If you want, you can donate to increase issue priority (https://donorbox.org/electron-net) --> First of all, this is a very interesting project that I'm excited to experiment with for building small projects. The application doesn't work for F# ASP.NET Core MVC applications, or Blazor (using Bolero). While `electronize init` throws an exception due to only `.csproj` projects being searched, manually filling the fields of the manifest file to match an equivalent C# project caused `electronize start` to hang just after outputting `stdout: Use Electron Port:` Steps to Reproduce: 1. Run `dotnet new mvc -lang F#` 2. Add ElectronNET project with `dotnet add package ElectronNET.API` 3. Add `webBuilder.UseElectron(args) |> ignore` to Program.fs 4. Add `async { do! Electron.WindowManager.CreateWindowAsync() |> Async.AwaitTask |> Async.Ignore }` to Startup.fs 5. Run `electronize init`, manually correct "executable", "name", "apiId" and "projectName" to match equivalent C# project 6. Add `CopyToOutputDirectory` for `electron.manifest.json` in `*.fsproj` 7. Run `electronize start`
claunia added the bug label 2026-01-29 16:42:15 +00:00
Author
Owner

@kojo12228 commented on GitHub (Jul 22, 2020):

I realised that step 4 didn't actually run the async code, so it should be:

async {
    do!
        Electron.WindowManager.CreateWindowAsync()
        |> Async.AwaitTask
        |> Async.Ignore
} |> Async.RunSynchronously

I'll make a pull request to fix the electronize init issue with .fsproj projects.

@kojo12228 commented on GitHub (Jul 22, 2020): I realised that step 4 didn't actually run the async code, so it should be: ```fsharp async { do! Electron.WindowManager.CreateWindowAsync() |> Async.AwaitTask |> Async.Ignore } |> Async.RunSynchronously ``` I'll make a pull request to fix the `electronize init` issue with .fsproj projects.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#533