Application Initialization IIS - Log Files - asp.net

I have configured the Application Initialization for a Web App running on Azure, the reason for that is to improve the "warm up", because I have some issues with Scale-out, the instance is not ready for the connection then I got some servers errors.
There is a good doc from Microsoft about that:
https://learn.microsoft.com/en-us/iis/get-started/whats-new-in-iis-8/iis-80-application-initialization
I am not sure how to check if Application Initialization is working.
Are there any logs that I can check?

IIS doesn’t provide separate log files for each modules and function, but for each website. So application initialization for a web to improve the “warm up”, can be checked by some function.
Advanced Logging is helpful and analyze the log file of the website which applied application initialization module. You can get it from here
Fail Request Tracing also can help you to trace request when you try to access the website to test whether the initialization is successful, especially using url rewrite with application initialization. Enable fail request tracing from here.

Related

How to create custom error handler for Mule domain project

I would like to catch exceptions when run/start domain project.
I have HTTP listeners configured in domain project, if port already used I want to catch those errors.
In Mule 4 you can not catch errors not related to the execution of a flow, ie System Errors. Those errors maybe printed in the log by the runtime, but their handling is not configurable. Even if it were there is no way to recover that kind of error. I recommend to setup some monitoring system to be sure the applications are behaving correctly. For example, to check that the port is open and listening to requests.

WCF service - what could cause it to randomly shut-down?

In IIS, I have an ASP.net web application that makes many behind-the-scenes calls to an IIS-hosted WCF service.
I never had any issues during development. However, since deploying to a few test servers at work, our tester was reporting that some of the calls were seemingly randomly failing. I verified that indeed, some of those behind the scenes webapp->service calls were failing with a "(417) Expectation Failed". Hitting the back-button and attempting the action again always worked.
A common solution I kept seeing online was https://stackoverflow.com/a/7358457/1669011
After adding that to my web config, the error continued to happen, but instead of returning a 417, would end up returning the results of my web.config's applicationInitialization remapManagedRequestsTo page.
I feel like the web.config fix I mentioned above has just allowed my web application to accept the full body of the response rather than failing when it realised it wasn't the wcf response it was expecting.
So if random services in WCF are returning the results of remapped requests that occur during Application Initialization, does that indicate that my WCF services in IIS are constantly totally shutting down?
What might cause my WCF service to randomly be in a state of "application initialization"? I'm hoping this is just a server issue and nothing to do with my application, as this has come out of nowhere and is risking an upcoming deploy.
Thanks for any assistance
My guess would be time (or very serious exceptions).
Specifically, if the server hosting the WCF service is not being hit often enough, it will shut down the application. Follow the instructions here to ensure the WCF site is not being unloaded: How to keep a WCF site online?.
If it's exceptions, you have not provided enough information to diagnose the issue.

Web service call failing with 5xx type errors

We've inherited a .asmx web service without source code (my favourite).
We've run tests (calling it from a console app with fiddler attached) both internally and externally and it runs clean every time - as it does for the vast majority of our clients.
However, one user is reporting 5xx type errors. We've tried all the usuals (event viewer and IIS logs) but they're all clean. We can't get it to fail at all.
What further options do we have?
Can the clients replicate the error at will?
The error is most likely data related. Have you tested it with the same data that your client is to produce the error.
The error may also be at the client's end during serialization/deserialization of the call in their auto-generated asmx wrapper.
Has there been a change to the WSDL?
Things like ELMAH are great for logging all unhanded exceptions.
add logging to web config, log everything.
decompile the webservice and find the reason.

Getting exception information from unhandled exception from external (running) process

I have an ASP.NET-based web app on Azure with a Web API. Yesterday, I started to get exceptions from the app whenever one of the API calls was invoked.
I don't have an exception logger intercepting application exceptions at the moment, however, I do have audit logging on each of the API calls which 99% of the time catches exceptions and reports problems to me.
In this particular case, it appears an exception is occurring further up the stack from the audit logging. There's not much code I have written which is invoked above there to be honest. There is also an IIS error page configured, so exception information is not passed down to the client. I have had a look in the event log and there's nothing in there.
In reaction to the problem, I spun up a new Azure instance, made that live and relegated the problematic instance to staging. The new instance works fine. If I restart the (now) staging instance by reconfiguring web.config to disable IIS errors then that instance will also work fine!
So does anyone know how I can extract unhandled exception information from a running app domain without having to restart it or affect it in any way?
I will be putting exception logging in soon, don't worry :-) But if there is a way to crack this without having to wait for another occurrence of the problem then that would be great!
UPDATE:
I logged onto the server and managed to get the following information from the "detailed response":
HTTP Error 500.0 - Internal Server Error The page cannot be displayed
because an internal server error has occurred. Detailed Error
Information:
Module ManagedPipelineHandler
Notification ExecuteRequestHandler
Handler System.Web.Http.WebHost.HttpControllerHandler
Error Code 0x00000000
Requested URL http:// 10.77.52.122:80/api/Login
Physical Path E:\sitesroot\0\api\Login
Logon Method Anonymous
Logon User Anonymous
Request Tracing Directory
C:\Resources\directory\34c6b40352d4449d8a19274caa328300.Web.UI.DiagnosticStore\FailedReqLogFiles\Web
I then configured Failed Request Tracing - which promptly made the error go away!
Anyone have any ideas? I'm probably going to have to wait for it to happen again, but by then there'll be some more exception logging.
thanks
Kris

Error while adding service reference for a wcf service

I am getting an error when i try to add a service reference of a WCF service. Error details is below. My web service is hosted on a different server and my client is on different server. When i run the service directly from IE i can see the service but adding it in .net web application i get error. Please advise
There was an error downloading
'http://193.11.33.66/coverscanservice/DownloadCoverScan.svc'.
The request failed with HTTP status
503: Service Unavailable. Metadata
contains a reference that cannot be
resolved:
'http://193.11.33.66/coverscanservice/DownloadCoverScan.svc'.
The HTTP service located at
http://193.11.33.66/coverscanservice/DownloadCoverScan.svc
is too busy. The remote server
returned an error: (503) Server
Unavailable. If the service is defined
in the current solution, try building
the solution and adding the service
reference again.
If you open up the properties of the application pool assigned to this service, you can turn off the rapid fail protection for this pool with the checkbox. This may alleviate the 503 error but it won't diagnose your true problem.
You'll need to install the windows debugging tools and/or Debug Diagnostics for IIS in order to find the true source of the problem. Something is causing your w3wp.exe process to crash repeatedly, and it can't recover. Also, check your event log for items related to the w3wp.exe stopping unexpectedly. There may be helpful information there.
In ASP .NET Web Application after Adding the WCF Webservice reference .Right click on that reference check the Configure Service Reference change setting like in collection type set "System.collection.ObjectModel.ObservableCollection".Also change Reuse types in specified referenced assemblies set "Microsoft.Web.Infrastructure" .
After that Build the project Call the Service Methods used it and Run it.

Resources