Why asp web site on IIs10 hangs after migration? - asp.net

I have an asp website with framework.net 4. I change the server to 2019 with IIs 10. after migration my web site hangs. my application pool is classic. I check the network but I can not find the reason. I have virtual network for server.
What is the problem? How can I check the truble?

Open the EventView on server and see what are the asp.net errors there.
Usually when you setup a new server, and you have a new pool, the settings on the pool is to stay down if too many errors appears, and if for example can connect to the database, it may stay down...
So find your error on event viewer, then check the settings of you pool to see if have set to stay down after some errors.

Related

How do you restart an asp.net web forms application?

I am getting this error after publishing my application:
The directory '/App_GlobalResources/' is not allowed because the application is precompiled.
My googling has yielded many recommendations to "restart my application" only I have no idea how to do this.
To restart your application you can open web.config in an editor, add a space somewhere, and save it. Please be aware that if you are using in-process session state the application pool will recycle, causing session state to be lost. However, this method has the benefit of not affecting web applications in other application pools.
If you want only this application to be affected, you could place it in its own application pool, or use one of the other session-state modes. Session State Modes
Refresh your website and Restart your application pool from IIS.
If you're developing locally, open a command prompt and type iisreset If you do this on a production machine you're going to take ALL the sites on that machine down during the reset. It's usually quick, but some sites can't have downtime during peak hours...
On a server, stop the app and app pool, then start them again.

Running ASP.net application on IIS - timeout error

I was running my asp.net application on localhost in the internal IIS for Visual Studio and for Testing purposes I was trying to host my website on my LAN at home. I obviously had to switch to use the custom IIS web server. I followed all the steps to do this i.e. I turned on IIS from the windows features in control panel and added my web application to IIS and configured VS settings to use that server and gave it a start URL.
However when I run my project I am getting an error message:
Unable to start debugging on the web server. The web server did not
respond in a timely manner. This may be because another debugger is
already attached to the web server.
What is the cause of this error and how can I solve it?
Thanks
One workaround is to make an empty page and you call the debugger from it as
System.Diagnostics.Debugger.Launch();
To solve it and make possible to start the debugger from the VS you must configure the start up page to see the local IIS on the properties of your project. Also I have notice that if you do not have default browser the IE it may also fail. So for me, to move on, call the debugger from the page.
I have the same problem and I solved it by reseting iis from cmd => "iisreset"

Cannot start IIS default site (version 7)

I am developing on my local machine (Windows 7), and using IIS 7. I usually create a new website by right clicking on sites -> Add New Site. Then do the usual stuff by pointing to the physical files, and I'd stop all other websites which I didnt need. I could then run the site on port 80 without any binding conflicts.
I then recently started doing some ASP.NET development. When I published from my VS 2010 to local host I could run the website, and it all worked great. I then stopped the site (asp.net) but I couldnt start any of the other sites (not even the default). I am not sure why.
I started to read about App Pools and someone said to remove all the application pools. So I removed all my application pools (except the default app pool), and I also removed all the websites (as they had a red x next to them).
I now cannot start the default site as the restart, start and stop are greyed out. I cannot find out any way to reset the IIS server. One error I have received is;
the object identifier does not represent a valid object iis7
I dont know really know what this means, and when I search for this error it seems that many people have come across this error but in different contexts.
Is there any way to reset IIS so I can build simple websites again? Do I need to uninstall IIS and reInstall?
Uninstall IIS and reinstall would probably be the easiest and fastest way to accomplish this.
Other than that check the event logs see if you can find any clues there.
You'll want to ensure there is a one-to-one relationship between the number of sites & the app pools that host them. If they are 32-bit apps hosted on a 64-bit server, you'll need to enable this property (set it to True) on the app pool you want to use for your site. You'll want to run:
C:\inetpub\AdminScripts>cscript adsutil SET W3SVC/AppPools/Enable32bitapponWin64 1
The .NET Framework obviously needs to be installed, but then the separate step of running the ASP installation command needs to be done (C:\Windows\Microsoft.NET\Framework\v2.0.xxxx\aspnet_regiis.exe -i). If it already is, re-install them - it could be malfunctioning/corrupt.
After all that, I noticed IIS 7 puts on this generic app pool identity account to run the app pool with. I created a service account, gave this account Admin rights just to see if the site would run, and added it onto the app pool as the "Custom account". I no longer get the HTTP 503 error. The account should have the "Log on as a service" and "Log on as a batch job" rights. If it will be using impersonation and going out to a SQL database, the "Impersonate client after authentication" and "Allow log on locally" rights are also needed (hence why I like just giving it admin privileges to see if it works, first).

iis7 application pool hanging

I have a .net 4.0 website that was running on physical Windows server 2003 boxes on IIS6 32bit just fine. We have migrated to new virtual servers running Windows Server 2008 32 bit with IIS7. The application pool is running in classic mode.
Since the move, I at random get a situation where the application hangs. The request queue rockets and then I get 503 errors. If the application pool is recycled, then the error goes away till the next time it occurs.
There are no entries in the event logs relating to it except that it notes when the application pool took to long to shut down during the recycle process. I have reporting in my .net application that logs to a DB and sends me errors but it sends me nothing when this application is hanging.
What tools can I use to diagnose the problem and figure out what is causing it?
In opinion, whatever the structure of application is, if you're pretty sure that there is no bug, changing sort of properties on the application pool might solve the problem.
First on the 'Advanced Settings...' menu of the application pool change the 'Enable 32-Bit Applications' to the relevant value. If the platform used for building application is x86 then the value should be 'True'.
Second if your application demands to access disk resources, also you should the relevant security context for running the application pool in the 'Identity' property. The identity should access all the directories that your application wants to change or list.
After doing all the things, in case the problem existed, you should let me know about the platform of your application. Is it .NET or ISAPI?
Cheers

Execute a dll function in ASP.Net Bin not working, II7

I am developing a remote control application where a client (aspx page in a browser) can request a server to "launch a notepad" (for testing purpose, for real life, turning off a light bulb, etc). So I created a dll with a simple function for launching the notepad (on the server side) and dropped this dll in the root bin folder.
It worked fine when the aspx page is running under ASP.NET development server (launched from Visual Studio). But when I tested the same aspx page under a FireFox browser, it did not work (launch the notepad) even though it did call for the same function (I stepped through in debugger).
Is this a permission issue? How do I set this up in IIS manager, or even better in web.config?
Please help.
Yes, it sounds like a permission issue.
The application pool in IIS 7 that your site is running under is probably using the default identity, which is the most restrictive. You can change the identity in IIS Manager by right-clicking on the app pool (probably called DefaultAppPool) and selecting Advanced Settings. From there change the Identity value to Local Service or Network Service. If neither of those work, making it Local System should allow your page to work.
I assume the Visual Studio integrated web server runs under the context of the account you are logged in with on the machine, which likely has a lot more rights.
When you say:
it did not work (launch the notepad)
Did you mean it through an exception or you didn't see a notepad window open. If it was a permissions issue I would expect you that you would get an exception. Chris is right on when he says:
The application pool in IIS 7 that
your site is running under is probably
using the default identity, which is
the most restrictive.
and
I assume the Visual Studio integrated
web server runs under the context of
the account you are logged in with on
the machine, which likely has a lot
more rights.
and if this is a permissions issue he is right on. However, the user your running under (when not debugging in Visual Studio) most likely cannot access the desktop of the logged in user. Maybe you should try your test with an app that doesn't need to interact with the desktop.

Resources