1

I've followed the steps for hosting a .NET Blazor application multiple times now in IIS and keep running into the same issue where the app seems to load, but nothing actually renders.

To be clear, I have done the following:

  • installed the .NET Core Runtime on the remote machine
  • installed the Hosting Bundle on the remote machine
  • published the Blazor application
  • moved the publish folder to the remote machine
  • configured the application as a new Site
  • referenced the app's publish folder's physical path
  • configured the Application Pool, No Managed Code, all that

Now, when everything is configured and spun up, I can navigate to the site, but nothing is being rendered. When I F12 to debug, I'm shown this markup:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <base href="/" />
    <link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
    <link href="css/site.css" rel="stylesheet" />
    <link href="mysite.styles.css" rel="stylesheet" />
    <!--Blazor:{"sequence":1,"type":"server","descriptor":"CfDJ8KNqOmGyWyhPhIIFwukK1C/CnKpDLhpYQZqSNqT0Z3du\u002Be1r4DsBAeNEyocAzmxKbOFsO1aYADSLcTUItO1JIvurbvcT3FBFjoWJ8THw/fK09yKdQ2uTdUOyM0c0wHWNDt8Ld2FxpnMSvHIfDChdEBoYNK6mr4RaWPY5eZVa7P5lSisk2bF\u002BKoEqLmLTqWwmcZZVPvziHvaD3Rgxp/JuGB15UIJSwEdrjW2r8xBgRZKQqn4gR7EBsB0QsCLYnM9/J8QmyhA20s9oNbwuVKtjyvmILVOnUZ0JpemM\u002BJQ3RfzNgxF\u002B28ANPxpNJC14MfaLMJQ4utcU/xcCS/\u002BzDaM5HguhXxZMnNJI2MIbL4LhxpLoB3/93krxzK8x9NBtsj8vB9wHIo7ODkCCweYouLWpeWHSVltbW3WmIC7SgvF3FPn5"}-->


</head>
<body>
    
<!--Blazor:{"sequence":0,"type":"server","descriptor":"CfDJ8KNqOmGyWyhPhIIFwukK1C8ohNoHAz/Z481LO5ATRXyA9JaqSOzKBE412QFZEQt4p6UBA6ikaOkcqbuDqs1MIdWBeIc7XWweyGhv4S\u002Beb/nFnncgyj6yz07\u002B4DkPKt46iSvn/vsYZsMVzNf0DIu5AAr2O0GzxpRVHtDiqcueozZZvraWAyFWw6PYf\u002ByyMgYEWQ5rDcm2kup2kANZcbofIkZe3Dz4WPwPfax7JMAuYYPi9v\u002Bwub9jAOy8X0MVxx95M1eU8z1QvaYCjS4KoGt\u002BtYnaljK4gocB2lx5\u002BDHgJkFxJ2wgj4ZH3dJV\u002BKdwsd8qlJchAG3xCE4sRpWUAimM33QLWrLt4GQuJ8\u002BhRI3mpgRV"}-->


    <script src="_framework/blazor.server.js"></script>
</body>
</html>

So it seems as though I'm accessing something, but none of the code that actually renders any of my site is running. I have confirmed that the site works perfectly fine on IIS Express in Visual Studio.

I am seeing nothing of use in my event viewer, no errors in the browser console.

Please advise if further information about my situation would be helpful.

3
  • Have you tried publishing the default Blazor site? I suspect you're missing some lines in Startup.cs. Commented Dec 8, 2022 at 0:38
  • I tried deploying a default Blazor website locally and everything works fine, I can't reproduce your issue. Please try republishing your project to make sure the content is up to date, you can refer this blog to deploy: c-sharpcorner.com/article/deploying-a-blazor-application-on-iis and please enable stdoutLogEnabled="true" to check the logs. Commented Dec 8, 2022 at 5:53
  • @Bennyboy1973 NET 6.0 doesn't include a Startup.cs @YurongDai In referencing this blog and going through the process several times, I narrowed it down to the fact that js interop is a cruel mistress. Commented Dec 9, 2022 at 14:10

1 Answer 1

1

In going through the publish/deploy process several times, I narrowed down my issue to JS Interop problems within the application. At some point early on in development, I had swapped the render mode from ServerPreRendered to Server to test out some JS Interop functions. Ultimately I had to refactor that functionality so that I could have all of my components initialize correctly while making async calls to js functions.

At any rate, I appreciate the feedback.

Sign up to request clarification or add additional context in comments.

1 Comment

I'm glad your problem was solved, if you can mark your answer later, it will lead more people in the right direction.

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.