.NET Core Web App Restarting - asp.net-core

I have a .NET core web app (console) hosted in IIS on a Windows machine. In the ConfigureServices method in Startup.cs I have a line of code which sends me an email so that I know when the service is restarted. When a new release is being deployed, I get that email, understandably. But I also receive that email at random times when there was no apparent restart of the machine, the app, or of any IIS component. Would there be any other thing which would cause it to restart? I'm not sure why this is happening.
Thanks,

IIS has a lot of settings for AppPool reset, like e.g. at given time, etc. You can check the advanced settings of your application pool that is set up to run your program and see if there is anything suspicious. It might be some inactivity timeout e.g.

Related

Restarting an asp.net core app with IIS doesnt actually restart the app properly as program.cs doesnt execute

I have deployed an asp.net core web app to an AWS Server running windows and IIS from azure devops. All the app code has updated, the dlls etc had updated but the new code that kickstarts serilog doesnt run.
This is because program.cs/startup.cs have not executed, it's as if the app updated but kept running withoout restarting.
Restarting the app in IIS or doing a full IIS reset, or restarting the IIS app pool does nothing. The app is running on port 80.
If I open powershell and type "dotnet myapp.dll" then the logs appear! because program.cs executed but that starts another instance on a different port and is nothing to do with IIS.
How do you properly restart a .net core app with IIS that actually makes it start up again?
Thanks
This is all because IIS didnt have permissions to write to the log folder.. lol. All ok now.

IIS, application pool stop Automatically

I am running WCF services on IIS 7.5 with .NET framework version 4.5 and it is in integrated mode. Whenever I deploy new code on IIS, it causes application pool to crash resulting in 503 error. I tried to dig into code but I am not able to figure out the root cause of the problem because of the large code base. I have ensured that it is not because of any server or IIS setting (as reverting the build makes IIS normal). I have also looked into event logs but not able to find anything, I am already logging application error but nothing is helping. Is there anyway I can trap the event or error just before crashing pool as I am running it integrated mode? Any help will be appreciated.

Silverlight Login page work on machine but not on other machine (window 7)

I face some strange issue in Silverlight 5 on machine which use window 7.
I have a Silverlight app and after deploying it, it works fine on all user machine but on some of user machine it does not working.
For Example My Username : Test and password is Test.
Now when I use this info to login my app on my machine and also some of other machine then it works fine but when I use same info on other machine (Window 7) it does not work.
I have set mesg for invalid login info in wcf service and return mesg to user. I found that when I use invalid logininfo then it display mesg which I set in wcf method.
I also uninstall old Silverlight and install new on window 7 machine but then also not working.
I think there are something which block to response of wcf service. I am stuck into this issue.
Thanks,
Hitesh
I ran into the similar issue once
When you are talking about the WCF service not working on some machines,
the first thing I would check is the time on that machine(some users set their own time, which is different from the standard time in that particular time zone, WCF service just does not accept the requests from these machines) and then the security level of the WCF service and on the User machine.
Hope this info helps..

Migrate WCF service from IIS to self host. How and should I?

I'm currently hosting a WCF service on an IIS 7.5.
Problem is I need to save data for the duration of the session (using static members) but the AppPool recycle keeps deleting all the cached data.
For my understanding my only solution is to self host the service.
I have no clue on how to do that and what are the pros and cons.
is this really my only option?
UPDATE
Looks like there was a different problem.
I changed hosting from IIS to self-hosting on a console application and I found a bug that was crashing the app. I'm guessing this was the reason for the loss of data and not the app pool recycling...
That does not seem like a good reason to migrate from IIS to Windows service . why not to disable app Pool recycling by
Idle Time-out(minutes) = 0
"Regular time Interval(minutes)" = 0
so it will never recycle
Also
Disable Recycling for configuration Changes = true
these settings live in advanced settings of AppPool
Update: how about
"Disable Overlapped Recycle" = true
AppPool Recycle settings
If this is the problem, I think you are storing the cache in memory. We can store the store the cache in disk,database or any your customized location. so there is no need move your application from IIS to self-host.
http://weblogs.asp.net/scottgu/archive/2010/01/27/extensible-output-caching-with-asp-net-4-vs-2010-and-net-4-0-series.aspx

Restart a WCF service after a server reboot

Is there some mechanism in WCF that can be used to "pre-start / warm-up" WCF services that are hosted in IIS ?
- something like the warm-up scripts for SharePoint sites
I have the situation where servers are re-booted over night and next day there is a long delay while the WCF services spin-up. I can't change the time-out in various applications that use the services, so the first users are reporting errors in the morning when they go to use their applications
This is on Windows 2003 Server and IIS 6.0, so the IIS Application Pool Warm-Up Module, http://www.iis.net/download/applicationwarmup, as that's for IIS 7.5
NOTE: the module seems to have been temporarily withdrawn, see details on ... IIS Forum
I know you will don't like the answer and I think I repeat myself because it is not the first time I'm posting it. The way to warm-up anything in IIS prior to version 7.5 is using scheduled console application to ping your web site / services and warm them up. It is ugly solution but it works, it is easy and I saw it on every project which had to deal with this requirement.
WCF services should be instantly ready when they start. Just make sure the services are set to automatically start when the server boots.
You can use Windows Server AppFabric, it has Auto Stat feature to keep the service always on. But you need to be on IIS 7.5 to install App Fabric.