question

HamedVaziri-4770 avatar image
0 Votes"
HamedVaziri-4770 asked YiyiYou-MSFT commented

Facing problem when debugging Blazor & WebApi projects together!

Hi
In my solution, i Have 3 project types :

Shared (Class library for models)
Web (Asp.net core web for dbContext & api)
Client (Blazor wasm for UI)

My problem is when i run my projects (Blazor & web api) together, i'm facing an empty blank page! when i press f12 to review console errors, this error display :

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.

But when i run my webApi alone, it works!
Where is my problem & how to solve it?

I have vs 2019 (16.9.2) & .net 5.0
Thanks

dotnet-aspnet-core-blazordotnet-aspnet-core-webapi
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@HamedVaziri-4770
For the error
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.
You can try to add <meta charset="UTF-8"> to your <head>.

0 Votes 0 ·

0 Answers