1 year ago

#370614

test-img

Ned Flanders

Cannot debug Blazor (ElectronNET) in JetBrains Rider

I have a Blazor Server Side Application, which is electronized.

The Problem

When I start the Application via 'electronize start' on the terminal everything is fine.

But when I try to Run/Debug the Electron Profile from Rider, I get the following error messages.

Output Run Window

/home/NedFlanders/.dotnet/tools/electronize start
Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

File name: 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at System.Reflection.RuntimeAssembly.GetType(QCallAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type, ObjectHandleOnStack keepAlive, ObjectHandleOnStack assemblyLoadContext)
   at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase) in /_/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs:line 188
   at System.Reflection.Assembly.GetType(String name, Boolean throwOnError) in /_/src/libraries/System.Private.CoreLib/src/System/Reflection/Assembly.cs:line 106
   at System.StartupHookProvider.CallStartupHook(StartupHookNameOrPath startupHook) in /_/src/coreclr/src/System.Private.CoreLib/src/System/StartupHookProvider.cs:line 128
   at System.StartupHookProvider.ProcessStartupHooks() in /_/src/coreclr/src/System.Private.CoreLib/src/System/StartupHookProvider.cs:line 93

Process finished with exit code 134.

Output Debug Window

/usr/bin/mono-sgen --debug --debugger-agent=transport=dt_socket,server=y,suspend=y,address=127.0.0.1:55556,setpgid=y /home/sebastiNedFlandersan/.dotnet/tools/electronize start
Cannot open assembly '/home/NedFlanders/.dotnet/tools/electronize': File does not contain a valid CIL image.

Process finished with exit code 2.

My Setup

  • Fedora 35
  • .NET 6 SDK
  • JetBrains Rider
  • ElectronNET
  • Minimal out of the box electronized Blazor Server App

electron.manifest.json

{
  "executable": "BlazorApp1",
  "splashscreen": {
    "imageFile": ""
  },
  "name": "BlazorApp1",
  "author": "",
  "singleInstance": false,
  "environment": "Production",
  "build": {
    "appId": "com.BlazorApp1.app",
    "productName": "BlazorApp1",
    "copyright": "Copyright © 2020",
    "buildVersion": "1.0.0",
    "compression": "maximum",
    "directories": {
      "output": "../../../bin/Desktop"
    },
    "extraResources": [
      {
        "from": "./bin",
        "to": "bin",
        "filter": [ "**/*" ]
      }
    ],
    "files": [
      {
        "from": "./ElectronHostHook/node_modules",
        "to": "ElectronHostHook/node_modules",
        "filter": [ "**/*" ]
      },
      "**/*"
    ]
  }
}

launchSettings.json

{
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:47071",
      "sslPort": 44341
    }
  },
  "profiles": {
    "Electron.NET App": {
      "commandName": "Executable",
      "executablePath": "electronize",
      "commandLineArgs": "start",
      "workingDirectory": "."
    },
    "BlazorApp1": {
      "commandName": "Project",
      "dotnetRunMessages": true,
      "launchBrowser": true,
      "applicationUrl": "https://localhost:7251;http://localhost:5181",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
  }
}

.net-core

electron

blazor-server-side

fedora

jetbrains-rider

0 Answers

Your Answer

Accepted video resources