question

CaR-6387 avatar image
0 Votes"
CaR-6387 asked cooldadtx commented

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

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

windows-server-iis
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

cooldadtx avatar image
1 Vote"
cooldadtx answered

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

CaR-6387 avatar image
0 Votes"
CaR-6387 answered cooldadtx commented

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

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Open the Dev Tools in the browser (F12), go to the network tab. Then refresh the page. The first item that appears is the page request. Look at the response and headers coming back. Note that if you created a web app under the default site then the URL you should be using will be something like http://myserver/myapp. I'm assuming here you are using HTTP. If you're using HTTPS then make sure your IIS server was configured to enable SSL.

While it shouldn't happen on a clean server, check the site bindings to ensure it isn't binding to anything other than the machine name.

The app pool you selected for your app is running right? If you are targeting a specific .NET version then you did install the ASP.NET runtime (if necessary) and restart IIS as discussed in the installation document?

All this is under the default website of your IIS server right? You didn't create a new website and then have the app hosted under it? Can you post a screenshot of the IIS manager section?

0 Votes 0 ·

When I browse to the page (as you said, I use http://myserver/prod) it stays blank and it doesn't let me open the developer tools.
What I did realize now though is that the "Network Collection Agent" has been disabled, so I can't even go from a working webpage to the non working one.
I only have IE11 setup on the server, might be able to have them install chrome and enable the network collection.

Checked the Site Bindings, looks good (http 80 *)

The App Pool is running, the specific .NET version has been installed, the Server has been restarted.

Exactly this is all under the default website, see the attached screenshot.141474-screenshotiis.png


0 Votes 0 ·
screenshotiis.png (81.9 KiB)

I don't understand your comment about "doesn't let me open the developer tools". This is a browser thing and has nothing to do with your site. Just press F12 on the browser when it starts. It doesn't matter what URL you are at. Switch to the Network tab in the dools. Then type the URL to your web app in the address bar of the browser to navigate to it. Once the navigation is finished you should be able to see the request from the browser to the server and what came back for the response headers/body.



0 Votes 0 ·
CaR-6387 avatar image
0 Votes"
CaR-6387 answered cooldadtx commented

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

· 6
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

The "network collection agent" thing and F12 not responding seems like a machine issue. So hopefully after your IT team resolves that problem you can proceed.

If http://localhost isn't working but *:80 is then that seems like a binding problem to me. IIS listens on port 80 for HTTP by default so it should never been needed, unless you have custom bindings. localhost is the local machine so http://localhost and http://localhost:80 are the same URL. You said you checked your bindings via the Edit Bindings on the default site. I'm also assuming that neither of the child apps has bindings defined.

Have you tried browsing to http://localhost:80/test which should send you to the child app?

0 Votes 0 ·

That‘s what I thought too, will have another look tomorrow and check with the IT guys.

Thanks for all your help and i will update tomorrow.

Cheers
CR

0 Votes 0 ·

@CaR-6387 Has your problem been solved?

0 Votes 0 ·
Show more comments

Hi Cooldadtx

Sorry for the long wait.
Checked with the IT guys, they said they will have another look at it.
When I logged back in the whole IIS was wiped, no default web site nothing.

So I started setting everything up and it seems to work, unfortunately I got locked out of their stupid system so I'll have to check back tomorrow.

It feels like they found something that wasn't set up properly and just reset everything.
Unfortunately I can't tell you what they changed, they won't tell where they screwed up I guess :P
As long as it works I'm happy.

Thanks again for all your help and patience
CR

0 Votes 0 ·

Glad to hear you got it resolved (??)

0 Votes 0 ·