Request timed out on IIS - c#

I am creating a payroll application and i have to do processing of over 500 employees. When I run the application on my local machine, it would run the application and produce correct information. It would take close to 3-4 mins to complete the processing of data. When i deploy my application to IIS and try to run it, i would get the following error below:
Server Error in '/' Application.
Request timed out.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Request timed out.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): Request timed out.]
I tried changing the connection time out (seconds) to 600 in the advance setting for IIS for that particular Site but that didnt work. Any suggestion?

Try to change web.config parameter <httpRuntime executionTimeout="90"/>
90 - is default value in seconds
you need to set greater value

Related

I am trying to use local service(.svc) in web.config endpoints but I got an error in SettingServiceCLient.cs functions

I am new in TFS and WCF,
I hope someone can help me.
This is the error message
Server Error in '/' Application.
One or more errors occurred. Description: An unhandled exception
occurred during the execution of the current web request. Please
review the stack trace for more information about the error and where
it originated in the code.
Exception Details:
System.ServiceModel.FaultException`1[[System.ServiceModel.ExceptionDetail,
System.ServiceModel, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089]]: One or more errors occurred.
Source Error:
Line 37: Line 38: public List
GetCompanyCarrierSettings(string companyId) { Line 39:
return Channel.GetCompanyCarrierSettings(companyId); Line 40:
} Line 41:
Source File: C:\Users\63917\Desktop\Custom - RW source\Customs -
Integrated
Dashboard\IntegrationDashboard\CCN.IntegrationDashboard.Web\Proxies\SettingServiceClient.cs
Line: 39
It seems that there something wrong with the client invocation, which is commonly achieved by a client proxy. The error typically indicates the destination URL service does not work properly. Is the service address right? It should be the base address of the WCF service. We could verify it by accessing the service creation page on the client-side.
Http://vabqia969vm:21011/service1.svc
If the page is working properly, we should check if the client service URL is right.
Here is an example of calling WCF service by using a WCF client.
https://learn.microsoft.com/en-us/dotnet/framework/wcf/accessing-services-using-a-wcf-client
Feel free to let me know if the problem still exists.

How can I solve Server Error in '/' Application Index has not been initialized?

If I access my home page, show error like this :
Server Error in '/' Application.
Index has not been initialized.
Description: An unhandled exception occurred.
Exception Details: System.InvalidOperationException: Index has not been initialized.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
The error above occurs when I restart Porta Azure like this :
How can I solve this problem?
Before I restarted the azure portal, there was no error
1.Check the Index View with its Controller.
2.Maybe your Object reference is not to an instance of an Object.
3.Check the Controller.
This Error generate from the controller.

Can't connect to Azure Blob Storage from App Service

I am trying to connect to a Azure Blob Storage account from an App Service hosted within the same location and in the same resource group. However when attempting to create a container during startup I get the following exception:
System.AggregateException: One or more errors occurred. (An error
occurred while sending the request.) --->
Microsoft.WindowsAzure.Storage.StorageException: An error occurred
while sending the request. ---> System.Net.Http.HttpRequestException:
An error occurred while sending the request. --->
System.Net.Http.WinHttpException: A connection with the server could
not be established
The inner exception is:
Microsoft.WindowsAzure.Storage.StorageException: An error occurred while sending the request. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.WinHttpException: A connection with the server could not be established
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Threading.Tasks.RendezvousAwaitable`1.GetResult()
at System.Net.Http.WinHttpHandler.d__105.MoveNext()
--- End of inner exception stack trace ---
I have double checked the account name, URL and access keys. I have also tried cycling the access keys to be sure. I have tried connecting to another storage account from the same app service and that also fails.
There are no app firewalls or VNets in place on either resource and I am at a loss as to what could be causing the issue.

The given path's format is not supported.

In my localhost it works correctly when I publish it and up to sever this error happens
path = string.Format(#"{0}{1}\{2}", Server.MapPath("~"), #"Files\Images", ShortImage.FileName.ToString());
ShortImage.InputStream.ResizeImage(150, 150, path, Utilty.ImageComperssion.Normal);
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NotSupportedException: The given path's format is not supported.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
This might be a long shot but if your path somewhere where your website cannot access? Granted, you as a windows user may be able to access the "E" drive, but, assuming you are running this from a published site that is not located on E drive or maybe limited to maybe just it's directory, there may be an access issue. Best way to test it is to put the path to something inside the project folder and see what happens.

Thread being aborded error

We have an application that can create e-books.
This application has an export module that creates an AIR file but this can take a while (some books have 2500 pages).
If we export we get the following error:
Thread was being aborted.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Threading.ThreadAbortException: Thread was being aborted.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ThreadAbortException: Thread was being aborted.]
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +501
System.Web.ApplicationStepManager.ResumeSteps(Exception error) +564
System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +141
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +436
I've changed my runtime executiontimeout to 3600 secs but it keeps crashing arround 3 minutes.
so it is time related ... everytime we approach the 3 minutes it crashes, I hope someone can help me out.
I think Paul is right about the cause of the exception. Both IIS and ASP.NET have settings that limit the maximum amount of time a request can take. For ASP.NET it's in the Machine.Config file (look for the httpRuntime element, executionTimeout attribute). It's set to 90 seconds on my development machine.
I would however not advise you to change that setting as it's there to make sure your application doesn't hang on a bad request.
Long running tasks should use asynchronous execution. With async execution, the actual work is handled on a separate thread. This frees the thread that handles the request to handle other requests which is good for the overall performance of your application.
There are some good articles on this available. For example : http://msdn.microsoft.com/en-us/magazine/cc163725.aspx
Quite often, this error actually occurs from an OutOfMemory exception.
Is there an InnerException available?
IIS has a 'run-away' thread protection that will kill a thread/appdomain if it runs for too long.

Categories

Resources