IIS shutsdown website even though timeout for app pool is set to 0 - asp.net-core

Title pretty much says it all. I have created a simple ASP.NET core 3.1 website which runs a MQTT subscriper. My problem is that after a while I see message in event viewer:
Application 'MACHINE/WEBROOT/APPHOST/MYWEBSITE' has shutdown.
Is there something I should add in the website itself or in IIS to make the website always running?

I found a complete step to step guide how to fix this from:
https://www.taithienbo.com/how-to-auto-start-and-keep-an-asp-net-core-web-application-and-keep-it-running-on-iis/
The missing part from my config was to add application initialization to server roles.

I had same problem before and solved with set Rapid-Fail protection to false.
If you trust to your server performance
or increase failure and maximum failures count.

Related

ASP.NET Core - Failed to start application '/LM/W3SVC/3/ROOT', ErrorCode '0x8007023e'

I'm currently encountering a problem when I deploy my ASP.NET Core program on IIS, and I have no idea how to fix it. Could somebody tell me why?
Probably missing some server roles or features.
Checking the Application Event Log I found the error '0x8007023e'
Checking the System Event Log I found a WAS (Windows Process Activation Service) communication error:
Then I installed the following roles and features:
Also I reinstalled ASP.NET Core Module
Finally I had to reassign the app pool to the site, and everything worked
In my case, the application had been assigned to a different app pool, somehow. Changing it back fixed the issue.
IIS > {Application} > Advanced Settings > General > Application Pool

Persits ASPPDF ImportFromUrl ServerXMLHTTP Error: The request has timed out

We have a test website that uses Persits ASPPDF to build a PDF using the ImportFromUrl method. It works fine on our test domain, but when I use the same code on another domain (and crucially perhaps, a sub-domain) I get the "MSXML2::ServerXMLHTTP Error: The request has timed out." error.
This leads me to think its related to the problem outlined in
https://support.persits.com/show.asp?code=PS080709171
"the calling Active Server Page (ASP) should not send requests to an ASP in the same virtual directory or to another virtual directory in the same pool or process. This can result in poor performance due to thread starvation."
So perhaps the config of the two servers hosting the two sites (test and live) are different - and if so what would that be? - Or you can't run this method on a sub-domain? Any guidance out there please?
I've had the same issue for weeks and finally found out what the problem was. In my case, it was because I had set to True the options that allow the debug of classic ASP code, without which I could not debug using visual studio. Setting those options back to False fixed the issue.

ASP .NET Core IIS Support often hangs / how enable log

I use IIS Support at development-time.
Its works.
But often are hangs.
I kill the "dotnet" process and continue work
How solve a hangs?
How enable logs to detect problem?
I am not really sure what you mean with the term hangs but if you want to enable logging on IIS please take a look at the following post. At a minimum, change the stdoutLogEnabled property to true and do not forget to manually create a folder called logs at the same level as the web.config file.

ASP.NET gurus - small issue when setting app domain name for sharing SQL session in scale-out scenario

We have scaled-out some portions of our ASP.NET app to run on one server, and other portions to run on another server (& under a subdomain).
The two servers share (SQL Server) Session. We used this MS article to create a tiny HTTP Module to sync app domain name between the two servers (sans the cookie domain code, which can be configured in the web.config. I later found this CodeProject article which is essentially the same.)
Everything's working well, except for a small issue: deployment changes or web.config tweaks require a manual app pool recycle (the auto-recycle no longer works - instead we get the "web server is currently unavailable / hit refresh" error).
I tried moving the app domain naming code from the HTTP Module into the Application_Start section of the Global.asax (maybe this is a better place for it?) - but received the same problem.
I know that one solution is to hard-code the app name in one of the SQL Server Session stored procedures; but am a bit hesitant to do this.
Edit: The app is ASP.NET 3.5 under IIS 6.0 (thanks #Chris & #bzlm)
You should check if proper Recycling Events are turned on in IIS, maybe this can help http://support.microsoft.com/kb/332088
Update. We opened a tech support case with Microsoft about this. After a week or so of back & forth, they said they had reproduced the issue in their environment and understand the cause (a timing issue deep inside the ASP.NET internals) - but that there is no resolution that they're aware of. I complained that the HTTP module is Microsoft code, but they said that this code is under "FAST PUBLISH" terms - intended to help & advise customers; yet not warranted.
Ah well. We now just manually recycle the app pool after making a web.config change.

Slow web service (and WCF service) calls from Windows 7

I am building a .NET 3.5 Winforms app that uses WCF services (wsHttp binding) to communicate to my server which gets data from SQL Server and passes it back to the Winforms app (Smart Client). I noticed since running Windows 7 RTM there is about a 30 second delay the first time the WCF communicates, from that point forward it's normal as before.
I noticed another application (Desaware licensing system) that uses ASMX services also experiences this same problem, a startup delay then all is fine.
This first time startup is not a .NET complilation/JIT issue, I can close the app right away and do it again. The server is running Windows 2003/IIS 6. All was fine prior to Windows 7.
I tried removing my anti-virus software, same issue. I cannot figure out why there is this initial delay, a significant one at that. I notice too in the Debug window as the application is starting up a delay as the System.IdentityModel line, it looks as if there is a security/authentication change on Windows 7 I presume that is causing this delay.
Anyone have any suggestions on how to resolve this issue? VS 2008 / .NET 3.5.
Thank you.
I added the following entry into the binding configuration and it appears to have solved the issue.
useDefaultWebProxy="false"
I was experiencing the same problem. I create my proxy using a ChannelFactory object, and found that in addition to specifying useDefaultWebProxy for the binding server-side, it was also necessary to specify the option client-side:
HttpTransportBindingElement httpTransport = new HttpTransportBindingElement
{
MaxBufferPoolSize = int.MaxValue,
MaxBufferSize = int.MaxValue,
MaxReceivedMessageSize = int.MaxValue,
AuthenticationScheme = System.Net.AuthenticationSchemes.Ntlm,
UseDefaultWebProxy = false
}
I found that the issue only occured when using the current Windows credentials. If you pass specific credentials then the performance was as expected. However, setting the UseDefaultWebProxy client side fixed the problem.
Hope this helps someone, somewhere!
A 30 second delay, sounds like it is waiting for something and then timing out after 30 seconds.
It is probably something to do with the authentication between your windows 7 machine and the server. Checking the event log would be a good place to start.
This worked for my Windows 7 and connecting to a WebServer
useDefaultWebProxy="false"
Thank You
Douglas