IIS Web Farm No owin.Environment item was found in the context - asp.net

I am trying to set load balancing with IIS ARR but getting this error when I try to login, It works find if I test it outside ARR
Server Error in '/' Application. No owin.Environment item was found in the context. 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.InvalidOperationException: No owin.Environment item was found in the context.
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.
ADDITIONAL INFORMATION:
After lots and lots of investigation and googling for answer, I still did not find answer why that error was happening. At last I tried fresh project and moved all my files to it and it worked.
It must have been some settings or anything, I don't know really. but creating new solution solved it.
if anyone knows exact reason why this happen, I would still like to know this.

After lots and lots of investigation and googling for answer, I still did not find answer why that error was happening. At last I tried fresh project and moved all my files to it and it worked.
It must have been some settings or anything, I don't know really. but creating new solution solved it.
if anyone knows exact reason why this happen, I would still like to know this.

Related

MessengerInstance.Send raises System.Reflection.TargetInvocationException on non-dev machines

My application is raising the following exception:
System.Reflection.TargetInvocationException was unhandled
Message: An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
Additional information: Exception has been thrown by the target of an invocation.
When using MessengerInstance.Send from our home view. The code that raises the exception is here.
The exception does not occur on our development machines, it only occurs on the machines of our testers. At first the exception would crash the application, when I added the exception handler the exception would be caught the first time a user selected an archive to analyze and the application would work (not throwing an exception) with any archives selected afterwards.
You may be able to recreate this behavior with the latest release from GitHub, which does not have the try-except block (so the application will crash when an archive is selected).
We don't really know what's causing this bug, it's pretty odd. Our next step in testing is to send an entire package (with pdb, xml, and manifest files) to our testers to see if that changes anything. Any help would be most appreciated!

Cause of event id 1309 asp.net 4.0 unhandled exception in asp.net

I am working on website, yesterday i faced a problem i.e server got down. i have checked the event log files then i came to know that it was due to "event id 1309 asp.net 4.0 unhandled exception" error. i just restore the back up of the website and restart the website it got worked.
Now my concern is why i got this error: is the criteria i had followed is actual way to recover from this error. i am asking this because might be we will not have latest code back up in future then what will we do? so i am asking to experts
why this errors occurred, what is exact caused for this.?
Best way to overcome this.
I have read theThis link and came to know this is due to
This problem occurs because the public headers properties of the Request.Headers property and of the Response.Headers property become non-serializable after you install the MS07-040 security update
But i have not used "Request.Headers".. please guide me.

'SysUtcDateTime' error during nopCommerce install - ASP.NET

Having bought a copy of the shop made in nopCommerce (files and database) we are trying to implement it on our server. After copy, such mistake appears:
SysUtcDateTime' is not a recognized built-in function name.
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.Data.SqlClient.SqlException: 'SysUtcDateTime' is not a recognized built-in function name.
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.
I found out here that it might be connected with the wrong version of SQL server in Nop.BusinessLogic. So, after simple edit in Notepad++ I changed '2008' to '2005', but no effects : (
Any ideas?
Anyway...I know that the topic of nopcommerce is not that popular, but maybe someone will look here for similiar solution.
I've got bad news - it turned out that the server I was trying to use had some old and outdated services. Only tip I can give:
Check the requirements of nopcommerce here, make sure that the
.NET Framework is consistent with your current source code, as well as
the version of the database).
Or change the server provider that supports nopcommerce solutions - as I did and solved the problem.

How to debug "An unhandled exception occurred and the process was terminated" error

I am seeing error in IIS Log, Is there any way to know more info about this? We have multiple .NET apps running on IIS.
An unhandled exception occurred and the process was terminated.
Application ID: DefaultDomain
Process ID: 7284
Exception: System.AppDomainUnloadedException
Message: Attempted to access an unloaded AppDomain.
StackTrace:
http://support.microsoft.com/kb/919789
Get crash dumps first, and then use Debug Diag or WinDbg to analyze the dumps. You will see all necessary information from it if you are familiar with the tools.
Microsoft support guys can also help if you open a support case via http://support.microsoft.com
You need to start looking deeper. Perhaps with logging and perhaps running the application in isolation with probes.
Is it a problem? If not stop perhaps?
First check the windows logs and look for more information.
Next check the IIS logs to see if anything is recorded there
Next if you can duplicate the error, try and narrow down to the steps to the bare minimum.
Does it occur on one machine, many machines, on euser many users etc etc...
Try run the app in isolation.
Attach a debugger to the IIS process and see if you can catch this exception alone. If you can then perhaps rebuild the code with symbols to give more information.
Try all these and see if you can find it.

w3p.exe terminated due to stack overflow - how to track down the issue?

we are getting a stack overflow in production ~ 2-4 times / day
We cannot reproduce this is in dev environment, nad given this is a web app with probably ~100 concurrent users at any one time, I'm struggling to work out how best to track this down.
Is there anyway to get any more info from event viewer - happy to install some form of listener tool - even if i can just get teh thread identity (set to the current user) that'll help - although the dll + class / function woudl be great!
Or is it just a matter of digging, trying to reproduce or adding some tracing in??
There is an IISDiag tool that you can run on production IIS to analyze crashes. Some information here:
http://support.microsoft.com/kb/919790
It's not just for leaks -- it dumps something like a CORE file that you can analyze later.
Slap on Elmah for exception logging. Adding logging of unhandled exceptions using Elmah only require you to drop in the assembly into the application bin folder and to add Elmah section in the web config for a basic logging scenario.
If the logs is not enough to determine the error source you can create memory dumps of the state of the failing application using DebugDiag. There is a guide on how to use it here.
You can put a global exception handler in the global.asax file. Put an exception handler in and then write the stack trace to the event log. This article has a pretty good summary of how to do it though I'm sure there are a lot of others too. Once you know where the error is occurring you can put in some additional logging in the function that the error is occurring in and hopefully narrow it down until you find the specific problem.

Resources