aspx.net gives blank error message - asp.net

What could this blank error message mean? I get it randomly in my LOGS. I am using non-cookie sessions. it occurs randomly in all aspx files..
code handler outputs:
objErr = Server.GetLastError().GetBaseException()
Server.ClearError()
Error Message: & objErr.Message.ToString())
Stack Trace: & objErr.StackTrace.ToString())
output
Error Message:
Stack Trace:
at System.Web.CachedPathData.GetConfigPathData(String configPath) at
System.Web.CachedPathData.GetVirtualPathData(VirtualPath virtualPath, Boolean
permitPathsOutsideApp) at System.Web.HttpContext.GetFilePathData() at
System.Web.HttpContext.GetConfigurationPathData() at
System.Web.HttpContext.get_ImpersonationToken() at
System.Web.ClientImpersonationContext.Start(HttpContext context, Boolean throwOnError) at
System.Web.HttpApplication.ThreadContext.Enter(Boolean setImpersonationContext) at
System.Web.HttpApplication.OnThreadEnterPrivate(Boolean setImpersonationContext) at
System.Web.HttpApplication.ApplicationStepManager.ResumeSteps(Exception error)

Is this an inner exception that you are seeing?
regarding ToString():
If there is no error message or if it is an empty string (""), then no error message is returned. The name of the inner exception and the stack trace are returned only if they are not a null reference
Here's a link

Related

Databases have "Recovery Pending" status every few hours

I recently noticed that most of the databases on my SQL Server are getting the Recovery Pending status after running for a few hours (sometimes 6, sometimes more). I can't imagine this being the expected outcome, so I decided to post about it here.
I opened the Event Log viewer and decided to find some more info about what's going on. It seems that all my databases are "Starting up" every few minutes or so (as cam be seen here). Some of them get started multiple times in a row. Is that supposed to work like that?
After scrolling a bit more, I found this warning from one of my IIS websites:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 4/11/2018 9:32:05 AM
Event time (UTC): 4/11/2018 7:32:05 AM
Event ID: 7911bb726cd34d36941e8232ad78b059
Event sequence: 18
Event occurrence: 3
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/5/ROOT-1-131679051910980983
Trust level: Full
Application Virtual Path: /
Application Path: C:\inetpub\x\
Machine name: WIN-IV6CMBTUQ4N
Process information:
Process ID: 2400
Process name: w3wp.exe
Account name: IIS APPPOOL\x
Exception information:
Exception type: HttpException
Exception message: The remote host closed the connection. The error code is 0x80070057.
at System.Web.Hosting.IIS7WorkerRequest.RaiseCommunicationError(Int32 result, Boolean throwOnDisconnect)
at System.Web.Hosting.IIS7WorkerRequest.ExplicitFlush()
at System.Web.HttpResponse.Flush(Boolean finalFlush, Boolean async)
at System.Web.HttpWriter.WriteFromStream(Byte[] data, Int32 offset, Int32 size)
at Microsoft.Owin.Host.SystemWeb.CallStreams.OutputStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at Microsoft.AspNet.SignalR.Owin.ServerResponse.Write(ArraySegment`1 data)
at Microsoft.AspNet.SignalR.Hosting.ResponseExtensions.End(IResponse response, String data)
at Microsoft.AspNet.SignalR.TaskAsyncHelper.TaskRunners`2.<>c__DisplayClass2_0.<RunTask>b__0(Task t)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Owin.Mapping.MapMiddleware.<Invoke>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.StageAsyncResult.End(IAsyncResult ar)
at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Request information:
Request URL: http://91.134.116.40:8003/signalr/start?clientProtocol=1.4&transport=webSockets&connectionData=[{"Name":"ChatHub"}]&connectionToken=/y39a+1XOv/u7X/ZFYw5ACLQu58FVNl0hbkMwPHCw1EQ9gdCbpFxPQzPuJVDxRywoP2AaI6akuXxQIxM2Wwa0OLO4cWd/e3csUBetjb9nROsisQnavw52ulTHWVOjK/j&user=User-14D
Request path: /signalr/start
User host address: 24.13.101.142
User:
Is authenticated: False
Authentication Type:
Thread account name: IIS APPPOOL\x
Thread information:
Thread ID: 14
Thread account name: IIS APPPOOL\x
Is impersonating: False
Stack trace: at System.Web.Hosting.IIS7WorkerRequest.RaiseCommunicationError(Int32 result, Boolean throwOnDisconnect)
at System.Web.Hosting.IIS7WorkerRequest.ExplicitFlush()
at System.Web.HttpResponse.Flush(Boolean finalFlush, Boolean async)
at System.Web.HttpWriter.WriteFromStream(Byte[] data, Int32 offset, Int32 size)
at Microsoft.Owin.Host.SystemWeb.CallStreams.OutputStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at Microsoft.AspNet.SignalR.Owin.ServerResponse.Write(ArraySegment`1 data)
at Microsoft.AspNet.SignalR.Hosting.ResponseExtensions.End(IResponse response, String data)
at Microsoft.AspNet.SignalR.TaskAsyncHelper.TaskRunners`2.<>c__DisplayClass2_0.<RunTask>b__0(Task t)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Owin.Mapping.MapMiddleware.<Invoke>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.StageAsyncResult.End(IAsyncResult ar)
at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Custom event details:
Seems like there's something wrong with SignalR, so it shouldn't have any direct relation with the database, but there aren't any other errors/warnings there.
Am I missing something here?
Thank you!
Do you have "auto close" enabled on the database?
Best practice is to have it OFF
ALTER DATABASE <mydb> SET AUTO_CLOSE OFF
I would also check AUTO_SHRINK while I was there

How can I specify the ASP.NET probing path for automatic C++/CLI appdomains?

I have a C++/CLI DLL that needs to run in the context of an ASP.NET WebApi action.
The action is affected by an ActionFilter that uses log4net's LogicalThreadContext to set a property containing a request ID; this works nicely to write the request ID into the log entries.
The problem is that ASP.NET seems to be creating an appdomain when it's time to load the class from the C++/CLI dll. (I can't seem to find any documentation on how that works; I'd love to find some.) When the appdomain plumbing tries to deserialize everything, it chokes because it can't find log4net.dll (see stack trace below).
Fusion logs show that it's looking in C:\Windows\System32\inetsrv, which is incorrect... I would expect it to look in the probing path or along the %PATH% environment variable.
A few data points:
log4net.dll is available in the web app's bin directory and works fine for everything else I'm using it for.
The C++/CLI code has no dependencies on log4net.
If I comment out my calls to log4net.LogicalThreadContext.Properties[...], everything works fine.
If I copy log4net.dll from my bin folder to C:\Windows\system32\inetsrv, everything works fine.
The web.config file specifies the probing path with a <probing privatePath="bin"/> element.
My Application_Start method in global.asax.cs prepends the web app's bin directory to the %PATH% environment variable:
var currentPathEnvVar = Environment.GetEnvironmentVariable("PATH");
var binPath = Path.Combine(Server.MapPath("~") ?? String.Empty, "bin");
_log.DebugFormat("Prepending paths to PATH: [{0}]", binPath);
Environment.SetEnvironmentVariable("PATH", String.Concat(binPath, Path.PathSeparator, currentPathEnvVar));
The log shows that the %PATH% is getting prepended correctly:
2015-06-05 17:07:48,816 1 DEBUG MyNamespace.WebApiApplication (null) Prepending paths to PATH: [C:\Program Files\MyCompany\MyApp\web\bin]
So how do I get the appdomain that ASP.NET creates to look in the right place to load assemblies?
Thanks.
Here's the stack trace that gets logged when all this goes down.
2015-06-05 17:08:41,148 23 ERROR MyNamespace.MyController (null) Controller action failed
System.TypeInitializationException: The type initializer for '<Module>' threw an exception. ---> <CrtImplementationDetails>.ModuleLoadException: The C++ module failed to load while attempting to initialize the default appdomain.
---> System.Runtime.Serialization.SerializationException: Unable to find assembly 'log4net, Version=1.2.13.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a'.
Server stack trace:
at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name)
at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm)
at System.Runtime.Remoting.Messaging.SmuggledMethodCallMessage.FixupForNewAppDomain()
at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoDispatch(Byte[] reqStmBuff, SmuggledMethodCallMessage smuggledMcm, SmuggledMethodReturnMessage& smuggledMrm)
at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoTransitionDispatchCallback(Object[] args)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at System.AppDomain.IsDefaultAppDomain()
at <CrtImplementationDetails>.GetDefaultDomain() in f:\dd\vctools\crt\crtw32\h\minternal.h:line 367
at <CrtImplementationDetails>.DoCallBackInDefaultDomain(IntPtr function, Void* cookie) in f:\dd\vctools\crt\crtw32\h\minternal.h:line 401
at <CrtImplementationDetails>.DefaultDomain.Initialize() in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 278
at <CrtImplementationDetails>.LanguageSupport.InitializeDefaultAppDomain(LanguageSupport* ) in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 343
at <CrtImplementationDetails>.LanguageSupport._Initialize(LanguageSupport* ) in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 546
at <CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* ) in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 703
--- End of inner exception stack trace ---
at <CrtImplementationDetails>.ThrowModuleLoadException(String errorMessage, Exception innerException) in f:\dd\vctools\crt\crtw32\h\minternal.h:line 194
at <CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* ) in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 713
at .cctor() in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 754
--- End of inner exception stack trace ---
at MyNamespace.MyController.MyAction(String foo, Int64 bar, String baz)
This helped me to resolve similar issue:
https://blogs.msdn.microsoft.com/jorman/2007/08/31/loading-c-assemblies-in-asp-net/
Faced option 2.a and proposed solution worked fine:
protected void Application_Start(object sender, EventArgs e){
String _path = String.Concat(System.Environment.GetEnvironmentVariable("PATH"), ";",
System.AppDomain.CurrentDomain.RelativeSearchPath);
System.Environment.SetEnvironmentVariable("PATH", _path, EnvironmentVariableTarget.Process); }

DNN 7 General Exception

I am creating Costume DNN Module but I have "General Exception" happening recently. just want to ask if anyone get this error " General Exception" and how to fix it
AssemblyVersion: 7.0.5
PortalID: -1
PortalName:
UserID: -1
UserName:
ActiveTabID: -1
ActiveTabName:
RawURL:
AbsoluteURL:
AbsoluteURLReferrer:
UserAgent:
DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke
ExceptionGUID: 19286ea9-9154-4453-93d3-f58e3e143f64
InnerException: Error Creating BusinessControllerClass 'DotNetNuke.Modules.ResourceModule.Components.FeatureController' of module(ResourceModule) id=(637) in tab(144) and portal(0)
FileName:
FileLineNumber: 0
FileColumnNumber: 0
Method: System.Activator.CreateInstance
StackTrace:
Message: System.Exception: Error Creating BusinessControllerClass 'DotNetNuke.Modules.ResourceModule.Components.FeatureController' of module(ResourceModule) id=(637) in tab(144) and portal(0) ---> System.ArgumentNullException: Value cannot be null. Parameter name: type at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Activator.CreateInstance(Type type) at DotNetNuke.Services.Search.ModuleIndexer.GetModuleList(Int32 PortalID) --- End of inner exception stack trace --- at DotNetNuke.Services.Search.ModuleIndexer.GetModuleList(Int32 PortalID)
Source:
Server Name:
That is an easy one, fixed in the next Template release. https://christoctemplate.codeplex.com/discussions/440995
Basically, update your .DNN file to include the proper namespace for your BusinessController class, I left a hardcoded one in there by mistake in one of the templates.

asynchronous task _dlgt.EndInvoke(ar) Object reference not set to an instance of an object

I am working on an application that need to do asynchronous tasks.
I use two times the code given at http://msdn.microsoft.com/fr-fr/library/system.web.ui.page.executeregisteredasynctasks.aspx
I simply copy and paste it in my application.
Unfortunately I have an error thrown on one time while the other one works perfectly.
The error is :
Object reference not set to an instance of an object.
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.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 46:
Line 47: _taskprogress = "Asynchronous task completed."
Line 48: _dlgt.EndInvoke(ar)
Line 49:
Line 50: End Sub
Source File: clsFormAsync.vb Line: 48
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
Samples.AspNet.VB.Controls.MyAsyncTask.OnEnd(IAsyncResult ar) in clsFormAsync.vb:48
System.Web.UI.PageAsyncTask.CompleteTask(Boolean timedOut, Boolean syncTimeoutCaller) +365
[HttpException (0x80004005): Exception of type 'System.Web.HttpException' was thrown.]
System.Web.UI.Page.ExecuteRegisteredAsyncTasks() +11440805
ViewProtocols.btnRefreshForm_Click(Object sender, EventArgs e) in ViewProtocols.aspx.vb:98
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +154
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3707
I really don't know how to get out of this error, help will be welcome.

Crystal Report,VB.NET,ASP.NET

Can help to get rid of this error in the Production website.This error is showing when i click on the Reports(Crystal Report)
Error Message:
The maximum report processing jobs limit configured by your system administrator has been reached
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:
[COMException (0x80041016): The maximum report processing jobs limit configured by your system administrator has been reached.]
CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options) +0
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options) +87
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +279
[Exception: Load report failed.]
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +341
CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob) +869
CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename) +73
Default3.Page_Init(Object sender, EventArgs e) +142
System.Web.UI.Control.OnInit(EventArgs e) +2069644
System.Web.UI.Page.OnInit(EventArgs e) +9
System.Web.UI.Control.InitRecursive(Control namingContainer) +321
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +692
This typically happens when you have to many Report instances open. We had the same issue using C#/Crystal Reprots trying to generate multi threaded reporting. You have to ensure that you close and dispose of the report properly once done with them.

Resources