.NET application not showing images after server updates on windows 2022
After server updates, .NET application running in IIS is not showing any images and unable to connect to any js, css resources
ASP.NET API
-
SurferOnWww • 3,886 Reputation points
2025-02-22T00:55:34.66+00:00 What is your app? Is it ASP.NET Web API as you tagged "ASP.NET API"? If so, why do you need to show images?
-
XuDong Peng-MSFT • 11,336 Reputation points • Microsoft Vendor
2025-02-24T03:01:15.9466667+00:00 Hi @Sushil Biswas,
After the update, does the same problem occur in local?
unable to connect to any js, css resources
Are you referring to 404 response error for static resources? If this is the case, maybe you can try to check the MIME type setting in IIS. If not, could you please provide more details about this issue?
-
Sushil Biswas • 0 Reputation points
2025-02-24T13:15:31.0433333+00:00 Issue is, our application is developed using asp.net and it was loading all css and js files but all of sudden it is not loading anymore; hence UI of the website is mess, i am suspecting latest windows update did that, i update windows server using azure update manager... i am trying to raise ticket on azure support, but they are not providing any option to raise one.
-
Sushil Biswas • 0 Reputation points
2025-02-24T13:17:23.83+00:00 Issue is, our application is developed using asp.net and it was loading all css and js files but all of sudden it is not loading anymore; hence UI of the website is mess, i am suspecting latest windows update did that, i update windows server using azure update manager... i am trying to raise ticket on azure support, but they are not providing any option to raise one.
-
Sushil Biswas • 0 Reputation points
2025-02-24T13:18:24.9433333+00:00 Also in developer tools it is giving this error for all css and js file resources
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
-
AgaveJoe • 29,866 Reputation points
2025-02-24T15:00:25.6333333+00:00 While it's theoretically possible a Windows update could affect the rendering of static files like images, CSS, and JavaScript, it's improbable.
To begin troubleshooting, please first perform a hard refresh by pressing Ctrl+F5. This will ensure we eliminate browser caching as a potential cause.
If the issue persists, we'll need to use standard troubleshooting methods. Assuming these files are served statically and not through a handler, please open your browser's developer tools and navigate to the Network tab. Examine the requests for the static files. If you observe 404 errors, this indicates the files are not being found.
In such cases, please verify the URLs that generated the 404 errors and compare them to the actual location of the static files on the host. This will help us identify any discrepancies in file paths or missing files
Also in developer tools it is giving this error for all css and js file resources Failed to load resource: the server responded with a status of 500 (Internal Server Error)
Static files, by definition, do not execute code. Therefore, I need to confirm: are you using a handler (code) to render these static files? Given that this post is tagged as Web API, which typically doesn't directly serve static files, could you please clarify the type of application you're experiencing issues with? It's possible you're hosting a Single Page Application (SPA) alongside the Web API, which would explain the presence of static files. Providing more context about your application setup will help us troubleshoot effectively.
-
Sushil Biswas • 0 Reputation points
2025-02-24T15:10:42.4133333+00:00 issue is not only inside server but users accessing the site from multiple devices, i also checked using seperate browser but still same.
Resources are still on the server as i can see in the application directory,
attached is the errors in network tabs in dev tools
-
Bruce (SqlWork.com) • 71,696 Reputation points
2025-02-24T16:46:04.19+00:00 the 500 error suggests you are not using IIS static file module, but some module / handler of your own design that is failing.
-
Sushil Biswas • 0 Reputation points
2025-02-24T16:48:55.4633333+00:00 can you suggest how to check that?
-
AgaveJoe • 1,510 Reputation points
2025-02-25T00:24:26.27+00:00 can you suggest how to check that?
If I understand correctly, we're trying to help you figure out how your application handles static files programmatically. To do that, we need to look at your code. First though, we need to know what type of application you are building. If you are using a .NET Framework web application, you should look in your web.config file for configurations related to serving static files. If that is not where the files are being served from, you should look for generic handlers, or classes that inherit from handlers. These are common ways to programmatically serve static files in .NET.
Sign in to comment