Is it possible to run Blazor Client in Kestrel mode at Windows 8.1?

631 views Asked by At

I am trying to run Blazor Web Assembly App on my Windows 8.1 machine without any succeided. Because of the fact that Kestrel mode is not recommended for Windows 8.1 OS, I used in my others samples project (at MVC, Razor Page, Blazor Server and API) such hardcoded in appsettings.js notation:

  "Kestrel": {
    "EndpointDefaults": {
      "Protocols": "Http1"
    }
  }

and it was worked very nice. But on Blazor Web Assembly App there is no any appsettings.js file. Instead of appsettings.js there is an launcheSettings.json file with such an default structure:

  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:55974",
      "sslPort": 44318
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "BlazorClientDemoApp": {
      "commandName": "Project",
      "launchBrowser": true,
      "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
      "applicationUrl": "https://localhost:5001;http://localhost:5000",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }

When I try to hardcode the Kestrel's code mentioned above the application does not appear on the browser.

Is it possible to do it on Windows 8.1 OS.?

specification:

Windows 8.1 64bit
VisualStudio 2019: 16.7.6 version,
SDK 3.1.403 Core,
Microsoft .NET Framework Wersja 4.8.03761,
ASP.NET and Web Tools 2019   16.7.532.,
ASP.NET Core Razor Language Services   16.1.0.,
ASP.NET Web Frameworks and Tools 2019   16.7.532.28833


1

There are 1 answers

0
greenoldman On

I am not sure if I understood, but you could use "wwwroot/appsettings.json" as counterpart of regular "appsettings.json". When you call something like builder.Configuration.GetValue... from your "Program.cs" the values will be taken from this json file.