I want to know why is the exception type is being changed when I dont use method.invoke() or such from System.Reflection
Stack Trace
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an
invocation. ---> System.Web.HttpException: Forbidden
at Global.SetSession() in Global.asax.vb:line 193
at Global.Application_AcquireRequestState() Global.asax.vb:line 292
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig,
Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters,
Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder
binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at System.Web.Util.ArglessEventHandlerProxy.Callback(Object sender, EventArgs e)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously)
what the Stack trace looks like on a similar App in the same scenario
System.Web.HttpException (0x80004005): wazzzup
at Global.SetSession() in Global.asax.vb:line 77
at Global.Application_AcquireRequestState(Object sender, EventArgs e) in Global.asax.vb:line
142
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously)
Related
I recently have this strange issue with IIS. We have an ASP.NET website and recently it fails after an application pool recycle. When I stop the applicationpool, clear the "ASP.NET Temporary Files" and restart the applicationpool. It works again. When i manually recycle it, it breaks again. I can reproduce this every time. The big problem is that our web application recycles every night.
Can I in some way prevent the usage of these ASP.NET Temporary Files? Or how could i fix this issue.
[Edit]
this is a screenshot of the error:
Screenshot
[Edit 2:Full error page]
Server Error in 'WebSite' Application.
Could not load type from string value 'MyOwnClass'.
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.TypeLoadException: Could not load type from string value 'MyOwnClass'.
Source Error:
Line 120: private static void InitalizeApplicationContext()
Line 121: {
Line 122: Spring.Context.Support.ContextRegistry.GetContext();
Line 123: }
Line 124:
Source File: path-to-website\Global.asax Line: 122
Stack Trace:
[TypeLoadException: Could not load type from string value 'MyOwnClass'.]
Spring.Core.TypeResolution.TypeResolver.Resolve(String typeName) +240
Spring.Core.TypeResolution.GenericTypeResolver.Resolve(String typeName) +530
Spring.Core.TypeResolution.CachedTypeResolver.Resolve(String typeName) +411
Spring.Core.TypeResolution.TypeResolutionUtils.ResolveType(String typeName) +85
Spring.Objects.Factory.Support.AbstractObjectDefinition.ResolveObjectType() +39
Spring.Objects.Factory.Support.AbstractObjectFactory.ResolveObjectType(RootObjectDefinition rod, String objectName) +74
[CannotLoadObjectTypeException: Cannot resolve type [MyOwnClass] for object with name 'AuthenticationUtil' defined in file [path-to-website\spring\Utils.xml] line 5]
Spring.Objects.Factory.Support.AbstractObjectFactory.ResolveObjectType(RootObjectDefinition rod, String objectName) +180
Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.PredictObjectType(String objectName, RootObjectDefinition mod) +108
Spring.Objects.Factory.Support.DefaultListableObjectFactory.DoGetObjectNamesForType(Type type, Boolean includeNonSingletons, Boolean allowEagerInit) +879
Spring.Objects.Factory.Support.DefaultListableObjectFactory.GetObjectsOfType(Type type, Boolean includePrototypes, Boolean includeFactoryObjects) +99
Spring.Context.Support.AbstractApplicationContext.GetObjectsOfType(Type type) +51
Spring.Messaging.Core.MessageQueueMetadataCache.Initialize() +78
Spring.Messaging.Core.MessageQueueTemplate.CreateDefaultMetadataCache() +253
Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.InvokeInitMethods(Object target, String name, IConfigurableObjectDefinition definition) +250
Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.ConfigureObject(String name, RootObjectDefinition definition, IObjectWrapper wrapper) +740
Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.InstantiateObject(String name, RootObjectDefinition definition, Object[] arguments, Boolean allowEagerCaching, Boolean suppressConfigure) +637
[ObjectCreationException: Error thrown by a dependency of object 'AddExamSessionToQueueCommand' defined in 'file [path-to-website\spring\Commands.xml] line 22' : Initialization of object failed : Cannot resolve type [MyOwnClass] for object with name 'AuthenticationUtil' defined in file [path-to-website\spring\Utils.xml] line 5
while resolving 'constructor argument with index 0' to 'MsmqExamSessionAccessCodeService' defined in 'file [path-to-website\spring\Services.xml] line 23'
while resolving 'MessageQueueTemplate' to 'ExamSessionAccessCodeMessageQueueTemplate' defined in 'file [path-to-website\spring\MsmqMessageQueueTemplates.xml] line 18']
Spring.Objects.Factory.Support.ObjectDefinitionValueResolver.ResolveReference(IObjectDefinition definition, String name, String argumentName, RuntimeObjectReference reference) +585
Spring.Objects.Factory.Support.ObjectDefinitionValueResolver.ResolvePropertyValue(String name, IObjectDefinition definition, String argumentName, Object argumentValue) +429
Spring.Objects.Factory.Support.ObjectDefinitionValueResolver.ResolveValueIfNecessary(String name, IObjectDefinition definition, String argumentName, Object argumentValue) +19
Spring.Objects.Factory.Support.ConstructorResolver.ResolveConstructorArguments(String objectName, RootObjectDefinition definition, ObjectWrapper wrapper, ConstructorArgumentValues cargs, ConstructorArgumentValues resolvedValues) +327
Spring.Objects.Factory.Support.ConstructorResolver.GetConstructorInstantiationInfo(String objectName, RootObjectDefinition rod, ConstructorInfo[] chosenCtors, Object[] explicitArgs) +263
Spring.Objects.Factory.Support.ConstructorResolver.AutowireConstructor(String objectName, RootObjectDefinition rod, ConstructorInfo[] chosenCtors, Object[] explicitArgs) +80
Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.CreateObjectInstance(String objectName, RootObjectDefinition objectDefinition, Object[] arguments) +216
Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.InstantiateObject(String name, RootObjectDefinition definition, Object[] arguments, Boolean allowEagerCaching, Boolean suppressConfigure) +863
Spring.Objects.Factory.Support.AbstractObjectFactory.CreateAndCacheSingletonInstance(String objectName, RootObjectDefinition objectDefinition, Object[] arguments) +379
Spring.Objects.Factory.Support.AbstractObjectFactory.GetObjectInternal(String name, Type requiredType, Object[] arguments, Boolean suppressConfigure) +1744
Spring.Objects.Factory.Support.DefaultListableObjectFactory.PreInstantiateSingletons() +722
Spring.Context.Support.AbstractApplicationContext.Refresh() +1009
Spring.Context.Support.XmlApplicationContext..ctor(XmlApplicationContextArgs args) +206
_dynamic_Spring.Context.Support.XmlApplicationContext..ctor(Object[] ) +320
Spring.Context.Support.RootContextInstantiator.InvokeContextConstructor(ConstructorInfo ctor) +169
Spring.Context.Support.ContextInstantiator.InstantiateContext() +55
Spring.Context.Support.ContextHandler.InstantiateContext(IApplicationContext parentContext, Object configContext, String contextName, Type contextType, Boolean caseSensitive, String[] resources) +174
Spring.Context.Support.ContextHandler.Create(Object parent, Object configContext, XmlNode section) +476
[ConfigurationErrorsException: Error creating context 'spring.root': Could not load type from string value 'MyOwnClass'.]
System.Configuration.BaseConfigurationRecord.EvaluateOne(String[] keys, SectionInput input, Boolean isTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult) +278
System.Configuration.BaseConfigurationRecord.Evaluate(FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult, Boolean getLkg, Boolean getRuntimeObject, Object& result, Object& resultRuntimeObject) +2095
System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject) +2023
System.Configuration.BaseConfigurationRecord.GetSection(String configKey) +79
System.Configuration.ConfigurationManager.GetSection(String sectionName) +91
Spring.Util.ConfigurationUtils.GetSection(String sectionName) +100
Spring.Context.Support.ContextRegistry.InitializeContextIfNeeded() +68
Spring.Context.Support.ContextRegistry.GetContext() +83
ASP.global_asax.InitalizeApplicationContext() in path-to-website\Global.asax:122
ASP.global_asax.Application_Start(Object sender, EventArgs e) in path-to-website\Global.asax:20
[HttpException (0x80004005): Error creating context 'spring.root': Could not load type from string value 'MyOwnClass'.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +540
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +186
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +402
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +343
[HttpException (0x80004005): Error creating context 'spring.root': Could not load type from string value 'MyOwnClass'.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +539
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +125
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +731
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1590.0
I have a web.config file. We recently change the database that we are using.
The connection string value was encrypted. See below.
<appSettings>
<add key="CommandTimeOut" value="31" />
<add key="ApplicationName" value="Arch" />
<add key="EnableDatabaseAuditing" value="False" />
<add key="LastTransactionIDParameterName" value="LastTransactionID" />
<add key="CurrentDateTimeDB" value="ArchRefDataDB" />
<add key="connString" value="AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAKGHR.........."
I have tried to encrypt the new database and I have the encrypted value and replace the connstring value.
Unfortunately, I'm encountering error.
Here is the error when I tried to access the site... Error Id :421a46fd-2690-4480-a6cb-0794f07f95e3
Error Type: five - ex.InnerException IsNot Nothing
Error Message :An unhandled exception has occurred.
Error InnerException: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: The web server has been unable to contact the Federation Server. at System.Web.Security.SingleSignOn.WSPersistentState.GetPersistentInfo(TrustedRealm& trustedRealm, String& fsAccountName) at System.Web.Security.SingleSignOn.WebSsoAuthenticationModule.AuthenticateWithWSFederationPassive() at System.Web.Security.SingleSignOn.WebSsoAuthenticationModule.OnAuthenticateRequest(Object o, EventArgs args) --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Accenture.Web.Security.Adfs2008ModuleInitiate.InvokeOnEnter(Object source, EventArgs e) at Accenture.Web.Security.IdentityIntegrationModule.OnAuthenticateRequest(Object source, EventArgs e) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Please advise.
Application_End() is invoked when my application pool is stopped which can happen for a number of reasons, including automatic pool recycle or changes in the folder from which the application is served.
The call stack will typically looks like this:
my Application_End(Object sender, EventArgs e)
at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at System.Web.HttpApplication.InvokeMethodWithAssert(MethodInfo method, Int32 paramCount, Object eventSource, EventArgs eventArgs)
at System.Web.HttpApplication.ProcessSpecialRequest(HttpContext context, MethodInfo method, Int32 paramCount, Object eventSource, EventArgs eventArgs, HttpSessionState session)
at System.Web.HttpApplicationFactory.Dispose()
at System.Web.HttpRuntime.Dispose()
at System.Web.HttpRuntime.ReleaseResourcesAndUnloadAppDomain(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
which is completely useless.
How do I programatically find why it was called?
There's System.Web.Hosting.HostingEnvironment.ShutdownReason property that indicates why the application is being terminated. Its value can be retrieved from inside Application_End().
I want to Minus to value in FastReport.Net in footer.
my Code :
private void PageFooter1_BeforeLayout(object sender, EventArgs e)
{
Text22.Text=Convert.ToString(Convert.ToDouble(Text12.Text)-Convert.ToDouble(Text3.Text));
}
and this error was occurs:
FastReport.Net v1.7.33
Exception has been thrown by the target of an invocation.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.FormatException: Input string was not in a correct format.
at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)
at FastReport.ReportScript.PageFooter1_BeforeLayout(Object sender, EventArgs e)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at FastReport.Code.ExpressionDescriptor.Invoke(Object[] parameters)
at FastReport.BandBase.CalcHeight()
at FastReport.Engine.ReportEngine.ShowBandToPreparedPages(BandBase band, Boolean getData)
at FastReport.Engine.ReportEngine.ShowBand(BandBase band, Boolean getData)
at FastReport.Engine.ReportEngine.EndLastPage()
at FastReport.Engine.ReportEngine.RunReportPage(ReportPage page)
at FastReport.Engine.ReportEngine.RunReportPages()
at FastReport.Engine.ReportEngine.RunReportPages(ReportPage page)
at FastReport.Engine.ReportEngine.Run(Boolean runDialogs, Boolean append, ReportPage page)
at FastReport.Report.Prepare(Boolean append)
at FastReport.Design.ReportTab.Preview()
can anyone help me ?
You can try to do DataTextFormatString="{0:Axx}", and put the code into the BeforePrint event.
For example:
private void Text14_BeforePrint(object sender, EventArgs e)
{
Text14.Text=string.Format("{0:N}",((Decimal)Report.GetColumnValue("Table.money"))-((Decimal)Report.GetColumnValue("Table.TRSMONEY")));
}
I got following error whenever anything in project is going to be updated. I am unable to understand what this error message trying to tell. can any body help me in to this.
Server Error in '/' Application.
Unexpected end of file has occurred. The following elements are not closed: hibernate-configuration. Line 1, position 659.
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.Xml.XmlException: Unexpected end of file has occurred. The following elements are not closed: hibernate-configuration. Line 1, position 659.
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:
[XmlException: Unexpected end of file has occurred. The following elements are not closed: hibernate-configuration. Line 1, position 659.]
System.Xml.XmlTextReaderImpl.Throw(Exception e) +76
System.Xml.XmlTextReaderImpl.Throw(String res, String arg) +126
System.Xml.XmlTextReaderImpl.Throw(Int32 pos, String res, String arg) +18
System.Xml.XmlTextReaderImpl.ThrowUnclosedElements() +254
System.Xml.XmlTextReaderImpl.ParseEndElement() +3975442
System.Xml.XmlTextReaderImpl.ParseElementContent() +243
System.Xml.XmlTextReaderImpl.Read() +45
System.Xml.XmlTextReader.Read() +15
System.Xml.XmlCharCheckingReader.Read() +39
System.Xml.XsdValidatingReader.Read() +37
System.Xml.XPath.XPathDocument.LoadFromReader(XmlReader reader, XmlSpace space) +428
System.Xml.XPath.XPathDocument..ctor(XmlReader reader, XmlSpace space) +20
System.Xml.XPath.XPathDocument..ctor(XmlReader reader) +6
NHibernate.Cfg.ConfigurationSchema.HibernateConfiguration..ctor(XmlReader hbConfigurationReader, Boolean fromAppSetting) +80
[HibernateConfigException: An exception occurred during configuration of persistence layer.]
NHibernate.Cfg.ConfigurationSchema.HibernateConfiguration..ctor(XmlReader hbConfigurationReader, Boolean fromAppSetting) +127
NHibernate.Cfg.Configuration.Configure(XmlReader textReader) +118
Application.DataModel.NHibernateDataProviderFactory..ctor(DataProviderFactoryInfo factoryInfo) in C:\#Geeks.Coder\NHibernateDataProvider\NHibernateDataProviderFactory.cs:26
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle._InvokeConstructor(Object[] args, SignatureStruct& signature, IntPtr declaringType) +0
System.RuntimeMethodHandle.InvokeConstructor(Object[] args, SignatureStruct signature, RuntimeTypeHandle declaringType) +15
System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +249
System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +1051
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +111
System.Activator.CreateInstance(Type type, Object[] args) +16
Application.DataModel.Database.RegisterDataProviderFactory(DataProviderFactoryInfo factoryInfo) in C:\#Geeks.Coder\Application.DataModel\DataAccessAPI\Database.ProviderManagement.cs:81
Application.DataModel.Database..cctor() in C:\#Geeks.Coder\Application.DataModel\DataAccessAPI\Database.ProviderManagement.cs:23
[TypeInitializationException: The type initializer for 'Application.DataModel.Database' threw an exception.]
Application.DataModel.Database.Save(Entity entity) in C:\#Geeks.Coder\Application.DataModel\DataAccessAPI\Database.Save.cs:26
Application.DataModel.ApplicationEventManager.RecordException(String description, Exception exception) in C:\#Geeks.Coder\Application.DataModel\Auditing\ApplicationEventManager.cs:183
There is an XML parsing error with the hibernate-configuration element in the config file.
You need to fix the XML so that it is valid and the hibernate-configuration tag is closed properly.