0

I working on web application with blazor app with .net core 7 . I build my application and

run it on my local machine it working perfect without any issues and display and retrieve data .

when publish it on IIS after that I test application I get error 404 error

so how to solve this error please ?

error details

Failed to load resource: the server responded with a status of 404 (Not Found)
GET http://localhost:245/BlazorUI.styles.css net::ERR_ABORTED 404 (Not Found)
Dashboard:13          GET http://localhost:245/css/site.css net::ERR_ABORTED 404 (Not Found)
Dashboard:20          GET http://localhost:245/~/assets/lib/bootstrap/dist/css/bootstrap.min.css net::ERR_ABORTED 404 (Not Found)
DevTools failed to load source map: Could not load content for http://localhost:245/assets/css/dashboard-free.css.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
blazor.server.js:1 [2023-02-23T13:48:46.310Z] Information: Normalizing '_blazor' to 'http://localhost:245/_blazor'.
blazor.server.js:1 [2023-02-23T13:48:46.341Z] Warning: Failed to connect via WebSockets, using the Long Polling fallback transport. This may be due to a VPN or proxy blocking the connection. To troubleshoot this, visit https://aka.ms/blazor-server-using-fallback-long-polling.
log @ blazor.server.js:1
dr @ blazor.server.js:1
await in dr (async)
ur @ blazor.server.js:1
await in ur (async)
(anonymous) @ blazor.server.js:1
(anonymous) @ blazor.server.js:1
blazor.server.js:1          GET http://localhost:245/~/assets/lib/bootstrap/dist/css/bootstrap.min.css net::ERR_ABORTED 404 (Not Found)

updated original post

what error message display and how to handle and solve it .

error message Warning: Failed to connect via WebSockets, using the Long Polling fallback transport. This may be due to a VPN or proxy blocking the connection.

Updated answer

I check answer links on comments reply

I can't implement or apply the following

To fix this problem, I changed in the site-configuration (/etc/nginx/sites-available) of nginx the following variables:

so can you tell me from which place i can access this path

ahmed abdelaziz
  • 427
  • 1
  • 8

1 Answers1

0

here are some suggestions for you.

To resolve this problem, verify that the file requested in the browser's URL exists on the IIS computer and that it is in the correct location. Then, check MIME types. Open IIS->Your site->MIME types. If there has the Extension of .css.

This error may be a permission issue. You can try giving the IIS_IUSRS a Full Control permission. refer to this link: IIS_IUSRS and IUSR permissions in IIS8

If it still does not work, you can refer to official doc and try to publish it on IIS again. Or user FRT generate logs for more detail error messages.

Hope my advice could help you. To solve your problem also needs to base on your actual situation.

TengFeiXie
  • 176
  • 5
  • can you please also tell me how to solve error Warning: Failed to connect via WebSockets, using the Long Polling fallback transport. This may be due to a VPN or proxy blocking the connection. To troubleshoot this, visit https://aka.ms/blazor-server-using-fallback-long-polling. – ahmed abdelaziz Feb 27 '23 at 08:04
  • Base on: https://github.com/aspnet/Announcements/issues/470, Long Polling is a fall-back transport utilized when WebSockets aren't available. You can refer to https://learn.microsoft.com/en-us/answers/questions/1162114/blazor-server-side-app-failed-to-connect-via-webso and https://stackoverflow.com/questions/70937709/net-6-0-new-blazor-project-throws-websocket-error. – TengFeiXie Feb 27 '23 at 08:25