3

I'm just starting into blazor (coming from mvc). I created my first server side test project in Visual Studio 2022, following two tutorials, and I didn't create or change any content so far. I've choosen windows authentification, as this will be the required authentification type for most of my projects. When I try to run (i. e. debug) this project in firefox, there's nothing shown but an empty page. When I check the console output, there's only one error message:

The character encoding of the plain text document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the file needs to be declared in the transfer protocol or file needs to use a byte order mark as an encoding signature.

When I try to reload the page I'm getting a http error 401 (unauthorized) on top.

Project options:

  • .net 6.0
  • windows authentification
  • Configure for HTTPS: true

I had visual studio create a test certificate when I first tried to run the application.

I'm used to be asked for login data when debugging a mvc project using firefox, but I don't get a prompt when I try to debug my blazor project. Cross check: I can run the application in Edge; as far as I know Edge fetches the windows login on its own out of the box, while firefox needs to be configured to do it. But making firefox fetch the windows login on its own is not a solution to my issue.

2
  • Have you tested with Chrome? Maybe this is a bug...
    – Grizzlly
    Commented Dec 1, 2021 at 13:47
  • No, I didn't. As described in my answer below, in the given configuration Visual Studio opened the app for debug in a way that firefox couldn't handle. Changing the configuration solved the problem. But thanks anyway. Commented Dec 1, 2021 at 17:16

1 Answer 1

0

A co-worker of mine found the solution: I had to check the "IIS Express" option in the menu under the debug button. So it was an issue of compatibility between the way of authentication used by visual studio and firefox.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.