question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dashes in a hosted Blazor WebAssembly project name break OIDC security

See original GitHub issue

Describe the bug

I have created multiple Blazor WASM apps with ASP.NET hosting and Individual Authentication from the base template, but none of them run upon initial creation. I always get the following error:

image

It doesn’t happen with Standalone Blazor WASM apps with Individual Authentication and it doesn’t happen with Blazor WASM apps with ASP.NET Hosting and NO authentication. Just when both are used.

The Client project is created fine and exists in the solution. I don’t know why the Server project can’t find it.

To Reproduce

  1. Open Visual Studio 2019 and select Create New Project.
  2. Select Blazor WebAssembly App project Template.
  3. Enter a name for the project.
  4. Check the ASP.Net Hosted option box.
  5. Select Individual Authentication for the Authentication type.
  6. Create Project.
  7. Wait for Solution to load then run Server project.
  8. Browser opens and shows a partial Blazor page then the Exception is hit.

Exceptions (if any)

System.InvalidOperationException: Client 'Blazor-WASM-Hosted-Auth-Demo.Client not found

Further technical details

  • ASP.NET Core version 5.0
    • Visual Studio 2019 16.11.0
  • Output of dotnet --info
.NET SDK (reflecting any global.json):
 Version:   5.0.400
 Commit:    d61950f9bf

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19042
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\5.0.400\

Host (useful for support):
  Version: 5.0.9
  Commit:  208e377a53

.NET SDKs installed:
  3.1.412 [C:\Program Files\dotnet\sdk]
  5.0.302 [C:\Program Files\dotnet\sdk]
  5.0.400 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.18 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.18 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.18 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

cc: @guardrex

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
pranavkmcommented, Aug 26, 2021

Will this issue be addressed with a framework update such that dashes will be permitted at some point in the future

We don’t plan on changing the behavior since the workaround is trivial. A bot usually closes resolved issues after it gives the users time to respond.

1reaction
Cmohancommented, Aug 17, 2021

I tried both BlazorWasmHostedAuthDemo and Blazor_Wasm_Hosted_Auth_Demo as project names and those both worked fine. It definitely doesn’t like the dashes then.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Secure a hosted ASP.NET Core Blazor WebAssembly app ...
Avoid using dashes ( - ) in the app name that break the formation of the OIDC app identifier (see the earlier WARNING)....
Read more >
Blazor webassembly tutorial net 7. We also have ...
Avoid using dashes (-) in the project name that break the formation of the … In this video, I have explained the complete...
Read more >
Blazor manualresetevent. Close [] This method is the public ...
When running a hosted Blazor WebAssembly solution in Visual Studio, ... Avoid using dashes (-) in the project name that break the formation...
Read more >
How to Build Securely with Blazor WebAssembly (WASM)
Set the Project name to “Okta Blazor WASM” and click Create. Select Blazor WebAssembly App and check Progressive Web Application. We are ...
Read more >
How to Build and Secure Web Applications with Blazor
Learn how to build client-side Web apps using Blazor and how to secure them with Auth0 authentication and authorization features.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found