ASP.NET Website not rendering StyleSheets nor GIF on IIS 10
Hello,
I have moved my ASP.NET website from Windows Server 2008 R2 IIS 7.5 to 2019 IIS 10.
It seems that the website does not render stylesheets nor GIF files when running on IIS 10(?).
Recompiling the website under VS2019 did not help.
Please advise.
Internet Information Services
ASP.NET Core
-
丁丁大魔王 81 Reputation points
2021-10-10T02:03:30.91+00:00 how did you move website from IIS7.5 to IIS10?
-
Matt Miller 1 Reputation point
2021-10-10T13:22:43.29+00:00 I set up the website from the scratch on the new server.
Is there a way to copy a website setup from one server to another?Also, maybe related to the rendering issue:
New website requires a full URL (default page?) specified http://xxx.intranet.db.com/Login.aspx
otherwise I get 403 error upon login.On new hosting server, needed to add permission for IUSR to website directories, otherwise I was getting 403 error;
Website did not need permission for IUSR on the old server, just IIS_IUSRS.I hope that I am just missing some correct setup option on the website or IIS itself.
-
Bruce Zhang-MSFT 3,736 Reputation points
2021-10-11T06:22:23.383+00:00 Hi @Matt Miller ,
Have you checked the developer mode of your browser? What's the status code and sub status code of CSS files? Then you can check the url of the css file to determine whether the corresponding physical address and file structure are correct.
I recommend you to use web deploy for IIS website migration. It is more simpler and convenient. You can refer to my another answer about how to use web deploy to migrate IIS website.
-
Matt Miller 1 Reputation point
2021-10-11T22:09:26.967+00:00 Hello Bruce,
Thank you for your follow-up.
II am not sure if I follows your instructions correctly, but I have found the following:
- In IE11, my site running on IIS 10 has 2 errors
Sys.WebForms.PageRequestManager._initialize('ctl00$ScriptManager', 'mainForm', [], [], [], 36000, 'ctl00');
SCRIPT5009: 'Sys' is undefined
WebForm_AutoFocus('coreContent_txtUser');
SCRIPT5009: 'WebForm_AutoFocus' is undefined
- In Edge, my site running on IIS 10 has 17 errors
Please advise whether it might be a site/script (Ajax) issue and how to debug it.
Just to clarify it, the same code works OK when website is running on IIS 7.5I will also try your web deploy for IIS website migration next.
-
Matt Miller 1 Reputation point
2021-10-11T22:28:24.617+00:00 i also found suggestions on the web to fix the 'sys' undefined issue;
https://stackoverflow.com/questions/75322/sys-is-undefinedtry to add
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" />
try to add
<asp:ScriptManager ID="ScriptManager1" runat="server" EnableCdn="true" />So I will try them both.
-
Bruce Zhang-MSFT 3,736 Reputation points
2021-10-12T01:39:08.617+00:00 Hi @Matt Miller ,
You can try suggestions on site that is not working. Create a new site to host the application migrated by web deploy. Then try to visit to see which works.
-
Matt Miller 1 Reputation point
2021-10-13T20:23:36.473+00:00 Hi Bruce,
- Migrating the website using Web Deploy 3.6 did not fix the issue;
- Using Web Deploy I exported old and new IIS and discovered that many options on IIS 10 are different:
Example on IIS 10: <installedComponent name="ASPNET" installed="False" />
In Server Roles IIS, I see ASP.NET 4.7 installed but 3.5 is not, I am not sure if it is root of my problem;
Do I need to install ASP.NET 3.5 on the server?
I also tried to import IIS settings into 10 via Web Deploy but it looks like I need to export source(2.0) from IIS 7.5
http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FRAMEWORK_VERSIONS_DO_NOT_MATCH
Please advise.
-
Bruce Zhang-MSFT 3,736 Reputation points
2021-10-14T01:44:18.383+00:00 Hi @Matt Miller ,
Some special features still rely on asp.net 3.5. It is recommended to install both asp.net on server.
Before migration, you need to make sure that the new IIS has installed all modules and features which should be same as old IIS in Server Roles.
If it still cannot work, please provide some error pages and substatus code of css files.
-
Matt Miller 1 Reputation point
2021-10-14T13:21:48.393+00:00 Hi Bruce,
I tried installing 3.5 on Windows Serve 2019 per
https://help.duo.com/s/article/3601?language=en_US
https://support.solarwinds.com/SuccessCenter/s/article/Install-NET-3-5-on-Windows-Server-2019?language=en_US
https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/enable-net-framework-35-by-using-windows-powershellget-windowsfeature web-asp-net
Display Name Name Install State
------------
---- -------------
[ ] ASP.NET 3.5 Web-Asp-Net AvailableINSTALL 3.5
add-windowsfeature web-asp-net
did not work
DISM /Online /Enable-Feature /FeatureName:NetFx3 /All
did not work
Install-WindowsFeature Net-Framework-Core -source \network\share\sxsDo I need to download 3.5?
Is it the correct download? https://www.microsoft.com/en-us/download/details.aspx?id=21Please advise.
-
Bruce Zhang-MSFT 3,736 Reputation points
2021-10-15T01:28:40.813+00:00 Hi @Matt Miller ,
Have you tried to install ASP.NET3.5 through GUI?
-
Matt Miller 1 Reputation point
2021-10-15T14:03:10.587+00:00 Hi Bruce,
Yes, I tried installing 3.5 via GUI, was getting a warning message:Do you need to specify an alternative source path?
One or more installation selections are missing source files on the destination server.and installation failed with 0x80072ee2.
-
Bruce Zhang-MSFT 3,736 Reputation points
2021-10-18T01:54:02.46+00:00 Hi @Matt Miller ,
I checked the 0x80072ee2 and it is an error of windows system. It usually triggered by some OS update components. So it seems that something wrong with your server system make installation failed.
You can ask it as a new question and attach the tag of windows-server so that windows server engineer can help you.
-
Matt Miller 1 Reputation point
2021-10-22T14:49:17.037+00:00 Hi Bruce,
ASP.Net 3.5 components have been installed on the Windows 2019 server but the issue persists.
Please advise.
-
Bruce Zhang-MSFT 3,736 Reputation points
2021-10-25T01:46:29.867+00:00 Hi @Matt Miller ,
After installation, did you reboot the server or IIS?
I need you check the developer mode of your browser to get the sub status code of css and gif file.
If the status code is 200.0, that means files load successfully. The issue is caused by application itself, code don't apply the style. -
Matt Miller 1 Reputation point
2021-10-27T02:07:22.357+00:00 Hi Bruce
My Login.aspx page gets 17 errors starting with:
- Failed to load resource: the server responds with a status of 404 (not found) core.css
- Failed to load resource: the server responds with a status of 404 (not found) WebResource.axd
- Failed to load resource: the server responds with a status of 404 (not found) ScriptResource.axd
- Failed to load resource: the server responds with a status of 404 (not found) buehne_2_flex_en_intra.gif
...
So it seams there are Security/Permission issues on the new server\IIS(?)
D:\InetPub
D:\Websites\CAKEI have been trying to figure out a correct sharing/permissions on D:\Websites\CAKE\App_Themes
-
Bruce Zhang-MSFT 3,736 Reputation points
2021-10-28T03:04:17.187+00:00 Hi @Matt Miller ,
Great! You have get the 404 status code. Then you just need to get sub status code and confirm the physical path of these files.
I don't think it is a permission issue because the status code of permission is 401 or 402.
Check the developer mode of your browser to get the sub status code of css and gif file. Refer to this docs, you will know what specific reason cause 404.
Confirm whether the site on the IIS points to the root directory of the physical folder of the application, and confirm whether the corresponding URL is correct according to the directory structure of the application. If it is correct, please enable directory browsing at the level of folder which contain the gif. Access the folder directly in the browser to check whether the gif information will appear on the page. The page is simliar to the following image. Try to directly click the gif to see if it will load.
-
Matt Miller 1 Reputation point
2021-11-04T23:29:17.167+00:00 Hi Bruce,
- It is only showing me 404 or I do not know how to get a sub code;
- old site works, opens the core.css file
https://uat-mysite.intranet.xx.com/App_Themes/CoreTheme/core.css
works
- old site works, opens the core.css file
new site gets 404
http://dev-mysite.intranet.xx.com/App_Themes/CoreTheme/core.css- On old server, IIS_IUSRS has some IIS APPPOOL... users/accounts;
On new server, IIS_IUSRS has no users.
Do I need to add ApplicationPoolIdentity somehow to IIS_IUSRS?
Pleaser advise.
- It is only showing me 404 or I do not know how to get a sub code;
Sign in to comment