.net 6 Blazor Server app - Not working after deployment

Viewed 76

This is driving me crazy , I have an app that works local but when deployed to windows server 2019 I get the error that say

enter image description here

and when I inspect the browser console I get this

enter image description here

I get no errors in the windows event logs , I have installed .net 6 hosting bundle, when run the console app alone it does not have any errors.

Has anyone came across this?

2 Answers

I have tested it in my local and can't reproduce the issue. But you can follow my suggestions to troubleshoot.

enter image description here

Suggestions

  1. You also need install .net core runtime at the beginning. For more details, you can read this blog.

  2. Please make sure you can run your project with IIS Express model successfully, like below

    enter image description here

  3. After the steps you have tried, if you still facing some issue, please try to re-publish the project, make sure the content is latest.

  4. You can enable stdoutLogEnabled="true" to check the logs.

  5. If you have free trial in azure, you can try to deploy it, and if it can run normally, that mean your server has some issue or wrong settings.

So this ended up being an access issue. For whatever reason the exception was not being logged, and since the response was coming back as HTML it explains the "unexpected token" error in the browser console.

So far , I really love blazor , but debugging is a little cumbersome.

Related