good morning I have a app that has been deployed to iis via the publish to folder feature in blazor studio and when I load the page in a web browser It loads kinda but leaves out some css and js files it works 100% when I run it locally so I don't know what I am doing wrong. here's what my page looks like:
The first error is 403 (forbidden) which is returned by your web server for some reason. This usually happens due to security settings. You can check if your web server has permissions to the _content directory and all its contents.
The other error is 404 (not found). You have probably used tilde when including your scripts which won't work in Blazor applications. You should try with / instead e.g. <script src="/js/focus.js"></script> and make sure the focus.js file is in the wwwroot/js directory of your application.
There are other errors which indicate that Blazor failed to start as well - those should be addressed as well. There seems to be an unhandled server-side exception. Those can be seen in the event log of your Windows server (if your server is Windows based of course).
lastly the _content folder is not in the root of the surplus folder on the server could that be causing the issues I am getting here is where that folder is stored
Yes. However it matters what the rendered output of that tag is. It represents the base URL of the application.
That's where the _content folder should be yes. It seems however that your whole application is not properly configured in IIS. I would recommend using deploy to IIS instead of folder. You may have not created a virtual application in IIS which is critical.
I don't have other suggestions. It seems that no files from wwwroot are being returned by your deployed application. Did you check that your application is in fact a virtual application in IIS? It should look as the selected node from this screenshot (Net8Security) and not like a folder (rbsserver for example).
Yes, this is precisely what it is supposed to be. Everything looks fine from application point of view - the <base href> is correctly set, the _content directory is where it is supposed to be. There is no reason I can think of for the JS and CSS files to not be downloaded. Still the 403 error means that there is some security setting involved which is specified either at IIS or file system level. I suggest checking the folder permissions and then the other IIS security settings.
thank you for all the help my last question is that if I am publishing my app to the following directory on my server "C:\inetpub\wwwroot\surplus" could that be causing the issues I am having above? if so what directory would you suggest I publish to?
I still think you have some permission issue (if you are still getting 403 errors). Server configuration issues are hard to debug via forum posts I am afraid Again - check the event log for exceptions and check if the IIS user has access to that directory.
I am afraid I don't have further suggestions. If you think the directory is the problem - deploy to another location to see if it would make any difference. By the way it would be of help if you can provide a URL for us to browse of the deployed application. One last thing - did you try browsing in other browsers or incognito mode? Maybe some browser plugin or policy stops third party JS files from loading.