Web Forms Project runs only under Root Web Site, but not as an application

CaR 21 Reputation points
2021-10-18T15:59:29.903+00:00

Hi Everyone

I'm maintaining a rather old Web Forms application, which needs to move to a new Server.
The Server is up and running and when I deploy the Web Forms Project to wwwroot everything works fine under the Default Web Site.
I now wanted to replicate the setup of the old server, where we had the prod and test system running side-by-side in folders inside wwwroot (not the best idea, I know, but it worked so far and the client doesn't see the need of changing anything).
If I move the Web Forms Project to a subfolder in wwwroot, e.g. wwwroot/prod, go to IIS and change the prod folder to an application I can't access the page anymore (when navigating to localhost/prod).

In the logs I find the following:
#Software: Microsoft Internet Information Services 10.0
#Version: 1.0
#Date: 2021-10-19 12:13:39
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referrer) sc-status sc-substatus sc-win32-status time-taken
2021-10-19 12:13:39 ::1 GET /prod - 80 - ::1 Mozilla/5.0+(Windows+NT+10.0;+WOW64;+Trident/7.0;+Touch;+rv:11.0)+like+Gecko - 301 0 0 12958

Does anybody have any idea what I need to add? The Web.config is the same as on the old server?
One difference that I've seen (apart from the IIS Version itself, old is 7 new is 10) is that the new one is missing the URL Rewrite Module.

Thanks in advance for any help, hope I'm in the right place here.

Cheers
CR

Internet Information Services
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,162 questions
0 comments No comments
{count} votes

Accepted answer
  1. Michael Taylor 48,046 Reputation points
    2021-10-18T18:13:21.423+00:00

    301 is the status code which indicates a redirect. If installed, go to the URL Rewrite feature for the app. Ensure that any redirect rule is pointing to the correct server and endpoint now. If you copied the web.config from the old app then it will be using the old settings which could be wrong. You should do the same thing on the website that is hosting your subapps as it might have its own redirect rules. Compare these to the original server's settings.

    Also ensure your permissions are correct. After you convert the site to an application, then right click the app and select Edit Permissions. Then ensure the web app has the appropriate permissions. Depends on what app pool and auth you're running under though. For a Basic Auth app you should be able to just ensure that IIS_IUSRS has read/execute permissions on the folder. Also go into the Authentication feature of the app and make sure you have enabled the appropriate authentication options. If you copied your web.config from the old project then this should already be configured properly most likely, depends on how old the app is.

    If none of this helps then please post what error(s) you're seeing in the browser in addition to the log entries.

    1 person found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. CaR 21 Reputation points
    2021-10-18T19:36:29.443+00:00

    Hey cooldadtx

    Thank you very much for your reply.

    I did a quick test and created a completely fresh standard project (the standard project that comes with Visual Studio when you create a new project).
    Built it and deployed it to the server, just to check how it reacts and I get the same issues as with the old web app.

    Thank you for the tip about the permissions, forgot to check that, but unfortunately those seem to be all set up correctly.

    I don't have the URL rewrite feature on the new Server, and I checked the web.config for any rewrites (and also why I copied a blank project to the server).
    Didn't find anything special there either.

    Checked the Authentication feature, where Anonymous Authentication is enabled, and everything else is disabled.

    As far as the browser goes I only get a blank page (can't even open the console or the network panel), so not really any clues there either.

    Anything else you can think of that I could try? I could probably get my client's IT to install the URL Rewrite feature, if you think that helps in any way.

    Would love to hear if you have any other ideas.

    Cheers
    CR


  2. CaR 21 Reputation points
    2021-10-18T21:28:07.14+00:00

    Sorry, not my best explanation.

    If I open the Browser, then open the Developer Tools and go to Network tab, it shows me an Error "The network collection agent failed to start", which seems to be a policy issue, I will see if my clients IT can remove this policy tomorrow, I don't have the rights to do that myself and it's after workhours here. After that I can retest the Network Tab.

    On the other hand, if I "Browse *:80" in IIS, it shows a blank page, and neither pressing F12, nor going to the menu and choose "F12 Developer Tools" will open the Console, it seems as if the browser is frozen. I can still enter a new URL and it will take me there, but as long as I'm on the page it doesn't let me do anything and I get the busy ring next to my cursor.

    Hope that makes a bit more sense. Otherwise just let me know.

    The last thing I tried is that I moved the content from the Test Folder to wwwroot and it's being displayed fine, at least when I go there via the IIS button "Browse *:80", if I just enter http://localhost it doesn't load either. Does that tell you anything?

    If you need me to clarify anything else, please let me know.

    Thanks already for your time
    CR

    PS: wasn't able to reply to the thread