Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Connection ID required when deploying blazor server in different folder

$
0
0

I'm trying to publish / deploy a blazor interactive server application using an Apache server that is serving in different folders.

So, I'm trying to move the application to a specific folder.

For this, I'm following these instructions Host and deploy ASP.NET Core Blazor.

But when I run the application I get the error Connection ID required. The URL open is correct (http://localhost:5401/email2db) where email2db is the path where I want the application.

I have googled, and I see different alternatives, and I'm testing (allow CORS, specific routing mapping, ...) but I want to imagine that is very more simple than this.

What I have done until now:

  1. I have modified the App.razor file adding the <base>tag
@inject WebOptions webOptions <!DOCTYPE html><html lang="en"><head>...<!-- base href="/email2db/" /--><base href="/@(webOptions.PathBase)" />

NOTICE: Here I'm using an injected configuration, but I have also tested with hardcoded value

  1. I have modified the program.cs adding the MapBlazorHub
        app.MapBlazorHub(webConfiguration.GetValue<String>("PathBase")!);

NOTICE: Again, here I use a configuration, but also tested hard coded

  1. I have modified the Properties/launchSettings.json
"profiles": {"http": {"commandName": "Project","dotnetRunMessages": true,"launchBrowser": true,"applicationUrl": "http://localhost:5104","launchUrl": "http://localhost:5104/email2db/","environmentVariables": {"ASPNETCORE_ENVIRONMENT": "Development"        }      },...

Any suggestion/guide will be welcome. Have I to continue with CORS? Or with Map(...And another annoying tip. With this configuration, the server try to serve the pages from both paths http://localhost:5104/pages/mypage and http://localhost:5104/email2db/pages/mypage


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>