0

I am currently building a Blazor server application that needs to be hosted in an iframe. Whenever I load the hosting iframe with the application, the Blazor server application does not run as expected because the blazor.server.js path is trying to be loaded relative to the domain of the hosting application. In other words, if my Blazor server runs at https://myblazorapp.com and my hosting application runs at https://hostingapp.com, the blazor.server.js file tries to get loaded from https://hostingapp.com/_framework/blazor.server.js. This obviously won't work since those files are not on the server of the hosting app. The same is happening for all static files of my blazor server application. What am I doing wrong in the setup of my blazer app?

mreyeros
  • 4,359
  • 20
  • 24
  • I just created a new server based blazor project and it works like normally in a iframe. I only tested with two localhost (with different ports of course) project. Is your base url tag like this in your _Layout.cshtml? Can you test it with a new server base blazor project and compare it with your current one? It is maybe a little bit difficult to answer without seeing any code or errors. – Oscar Veldman Sep 19 '22 at 21:56

0 Answers0