I have the code below in my global.asax file (in my asp.net application) ...
and I have the error below in stack trace:
[NullReferenceException: Object reference not set to an instance of an object.]
Digita.Tustena.Global.Application_Start(Object sender, EventArgs e) +133
[HttpException (0x80004005): Object reference not set to an instance of an object.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +3985477
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +191
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +325
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +407
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +375
[HttpException (0x80004005): Object reference not set to an instance of an object.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11524352
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4782309
What is the problem with my code? I appriciate your helps ...
Look in the method Application_Start in the file Global.asax.cs. You have a null reference there. Put a try/catch and use the debugger to see which object is null.
If you deploy the pdb files with your dll the stack trace will also contain the line number. Also do set the Debug Info to full: Project Properties -> Build -> Advanced -> Debug Info (http://stackoverflow.com/a/3791997/57369)
Related
i updated Newtonsoft.Json package as 9.0.1
and at my local server publish file working very well.but my boss said it is not working on live server.Could you please solve this issue.
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 7/13/2021 7:46:08 AM
Event time (UTC): 7/13/2021 7:46:08 AM
Event ID: 90c697ce232647939806d6e807833f1e
Event sequence: 2
Event occurrence: 1
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/2/ROOT-2-132706359680241249
Trust level: Full
Application Virtual Path: /
Application Path: C:\inetpub\wwwroot\DRS\
Machine name: EC2AMAZ-7HRKLBA
Process information:
Process ID: 8776
Process name: w3wp.exe
Account name: IIS APPPOOL\DRS
Exception information:
Exception type: TargetInvocationException
Exception message: Exception has been thrown by the target of an invocation.
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 Owin.Loader.DefaultLoader.<>c__DisplayClass12.b__b(IAppBuilder builder)
at Owin.Loader.DefaultLoader.<>c__DisplayClass1.b__0(IAppBuilder builder)
at Microsoft.Owin.Host.SystemWeb.OwinAppContext.Initialize(Action1 startup) at Microsoft.Owin.Host.SystemWeb.OwinBuilder.Build(Action1 startup)
at Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint()
at System.Threading.LazyInitializer.EnsureInitializedCore[T](T& target, Boolean& initialized, Object& syncLock, Func1 valueFactory) at Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init(HttpApplication context) at System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) at System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) at System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) at System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) Could not load file or assembly 'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) at Hangfire.Common.SerializationHelper.Serialize(Object value, Type type, SerializationOption option) at Hangfire.Storage.InvocationData.SerializeJob(Job job) at Hangfire.RecurringJobEntity.GetChangedFields(Nullable1& nextExecution)
at Hangfire.RecurringJobEntity.IsChanged(IReadOnlyDictionary2& changedFields, Nullable1& nextExecution)
at Hangfire.RecurringJobManager.AddOrUpdate(String recurringJobId, Job job, String cronExpression, RecurringJobOptions options)
at Hangfire.RecurringJob.AddOrUpdate[T](Expression`1 methodCall, String cronExpression, TimeZoneInfo timeZone, String queue)
at Comsol.Champ.DRS.Web.Startup.Configuration(IAppBuilder app) in D:\Projects\DRS\DRS\DRS\DRS\DRS.Web\Startup.cs:line 29
Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Request information:
Request URL: http://referal.champdonate.ie/
Request path: /
User host address: 185.233.17.193
User:
Is authenticated: False
Authentication Type:
Thread account name: IIS APPPOOL\DRS
Thread information:
Thread ID: 10
Thread account name: IIS APPPOOL\DRS
Is impersonating: False
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 Owin.Loader.DefaultLoader.<>c__DisplayClass12.b__b(IAppBuilder builder)
at Owin.Loader.DefaultLoader.<>c__DisplayClass1.b__0(IAppBuilder builder)
at Microsoft.Owin.Host.SystemWeb.OwinAppContext.Initialize(Action1 startup) at Microsoft.Owin.Host.SystemWeb.OwinBuilder.Build(Action1 startup)
at Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint()
at System.Threading.LazyInitializer.EnsureInitializedCore[T](T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory)
at Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init(HttpApplication context)
at System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers)
at System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context)
at System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context)
at System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext)
Custom event details:
Look in your web.config or app.config for any sections that look like this. It will force your web server to use an older version of a DLL.
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="4.5.0.0" />
</dependentAssembly>
You can fix it by, First, making a backup of your config file. Next, remove the bindingRedirect line.
Hi everybody i am stuck at this point hope someone got the answer
Server Error in '/' Application.
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:
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:
[NullReferenceException: Object reference not set to an instance of an object.]
Umbraco.Web.Runtime.WebRuntime.Boot(IRegister register) in D:\a\1\s\src\Umbraco.Web\Runtime\WebRuntime.cs:55
[HttpException (0x80004005): Object reference not set to an instance of an object.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +517
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +185
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +168
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +277
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +369
[HttpException (0x80004005): Object reference not set to an instance of an object.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +532
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +111
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +714
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3650.0
My solution was to give full control permission on the 'httpdocs' folder on the host server
I am facing an issue with Dependency Injection (Simple Injector), but it only seems to occur when the application is deployed to a server running IIS, and only after it has been running for some time. Based on the below StackTrace, it seems that there is a NullReference Exception that occurs during dependency injection.
The interesting part is that if I restart the IIS Application, the application seems to continue working for some time. At a later point, presuming that no one has accessed the website, the following StackTrace is displayed:
[NullReferenceException: Object reference not set to an instance of an
object.]
DevOps.Data.DevOpsDbConnectionLoader.GetObjectInstanceInternal(Assembly
dbAssembly, String objectTypeName, Boolean isStatic) +16
DevOps.Data.DevOpsDbConnectionLoader.GetEntityDbProviderServices()
+156 NWatch.NWatchDbConfiguration..ctor(DevOpsDbConnectionLoader loader) +239 NWatch.NWatchEntityApplication.Init() +429
BranchCircuits_Web.MvcApplication.RegisterTypes(Container container)
+298 BranchCircuits_Web.MvcApplication.Application_Start() +299
[HttpException (0x80004005): Object reference not set to an instance
of an object.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext
context, HttpApplication app) +12601949
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr
appContext, HttpContext context, MethodInfo[] handlers) +175
System.Web.HttpApplication.InitSpecial(HttpApplicationState state,
MethodInfo[] handlers, IntPtr appContext, HttpContext context) +304
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr
appContext, HttpContext context) +404
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr
appContext) +475
[HttpException (0x80004005): Object reference not set to an instance
of an object.] System.Web.HttpRuntime.FirstRequestInit(HttpContext
context) +12618996
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context)
+159 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest
wr, HttpContext context) +12458613
Below is the Global.asax contents that is in charge for the dependency injection.
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
var webApiContainer = new Container();
webApiContainer.Options.DefaultScopedLifestyle = new WebApiRequestLifestyle();
RegisterTypes(webApiContainer);
webApiContainer.RegisterWebApiControllers(GlobalConfiguration.Configuration);
webApiContainer.Verify();
GlobalConfiguration.Configuration.DependencyResolver =
new SimpleInjectorWebApiDependencyResolver(webApiContainer);
}
private void RegisterTypes(Container container)
{
var virtualPath = HostingEnvironment.ApplicationVirtualPath.Substring(1);
string baseName = null;
if (!string.IsNullOrEmpty(virtualPath)) {
baseName = HostingEnvironment.SiteName + "_" + virtualPath;
} else {
baseName = HostingEnvironment.SiteName;
}
var nWatchApp = new NWatchEntityApplication(GetNWatchConfig());
Trace.Listeners.Add(new DevOps.Diagnostics.DevOpsLogTraceListener(baseName));
container.RegisterSingleton<INWatchApplication>(nWatchApp);
container.Register<NWatchDbContext>(() => nWatchApp.GetDbContext(), Lifestyle.Scoped);
}
private INWatchConfiguration GetNWatchConfig()
{
Configuration rootConfig =
System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(HostingEnvironment.ApplicationVirtualPath);
return new NWatchSystemConfiguration(rootConfig);
}
Has anyone experienced this when deploying to IIS? What is the root cause, and how can it be resolved?
I'm trying to install Bonobo on Windows 7/IIS 7/.Net 4.5 but I'm having trouble with SQLite. I get the following error when I load up the page in a browser
unable to open database file
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.SQLite.SQLiteException: unable to open database file
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:
[SQLiteException (0xe): unable to open database file]
System.Data.SQLite.SQLite3.Open(String strFilename, SQLiteConnectionFlags connectionFlags, SQLiteOpenFlagsEnum openFlags, Int32 maxPoolSize, Boolean usePool) +731
System.Data.SQLite.SQLiteConnection.Open() +445916
System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +102
[EntityException: The underlying provider failed on Open.]
System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +11430327
System.Data.EntityClient.EntityConnection.Open() +142
System.Data.Objects.ObjectContext.EnsureConnection() +97
System.Data.Objects.ObjectContext.ExecuteStoreCommand(String commandText, Object[] parameters) +53
Bonobo.Git.Server.Data.Update.AutomaticUpdater.UpdateDatabase() +444
Bonobo.Git.Server.MvcApplication.Application_Start() +145
[HttpException (0x80004005): The underlying provider failed on Open.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +12962661
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +175
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +304
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +404
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475
[HttpException (0x80004005): The underlying provider failed on Open.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12979668
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12819261
I have SQLite installed now (though, I don't think that matters... Bonobo comes with its own SQLite dlls. I AM running on a 64 bit system. I don't know if that has anything to do with compatability. I've followed the installation instructions on the Bonobo site to the tee, but I still get this error and Google hasn't provided any answers for me. Could anyone point me in the right direction?
You should try to set the right security options for your IIS.
From http://bonobogitserver.com/install/
My application is running by:
ASP.NET
MVC 3
Framework 4.0
When I run the application on my computer (localhost:...) it's runs successfully.
Now, is the first time, I run application on windows server 2008 R-2.
The error is: "Compiler executable file csc.exe cannot be found"
What could be the problem?
(.net4 installed correctly, and csc.exe file is exists in: "C:\Windows\Microsoft.NET\Framework\v4.0\").
Please, send complete stack trace, just like this below:
"[InvalidOperationException: Compiler executable file csc.exe cannot be found.]
System.CodeDom.Compiler.RedistVersionInfo.GetCompilerPath(IDictionary`2 provOptions, String compilerExecutable) +8675071
Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch(CompilerParameters options, String[] fileNames) +739
Microsoft.CSharp.CSharpCodeGenerator.FromSourceBatch(CompilerParameters options, String[] sources) +3293761
Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromSourceBatch(CompilerParameters options, String[] sources) +64
HibernatingRhinos.Profiler.Appender.Util.GenerateAssembly.Compile(String fileName, String[] sources, IEnumerable`1 assembliesToReference) +1252
HibernatingRhinos.Profiler.Appender.Util.GenerateAssembly.CompileAssembly(IEnumerable`1 sourcesResources, IEnumerable`1 assembliesToReference, String assemblyName) +118
HibernatingRhinos.Profiler.Appender.EntityFramework.EntityFrameworkProfiler.SetupDatabaseDefaultConnectionFactoryIfNeeded() +929
HibernatingRhinos.Profiler.Appender.EntityFramework.EntityFrameworkProfiler.SetupEntityFrameworkIntegration() +80
HibernatingRhinos.Profiler.Appender.EntityFramework.EntityFrameworkProfiler.Initialize(EntityFrameworkAppenderConfiguration configuration) +47
HibernatingRhinos.Profiler.Appender.EntityFramework.EntityFrameworkProfiler.Initialize() +73
Web4.MvcApplication.Application_Start() +17
[HttpException (0x80004005): Compiler executable file csc.exe cannot be found.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +12864673
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +175
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +304
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +404
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475
[HttpException (0x80004005): Compiler executable file csc.exe cannot be found.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12881540
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext "
If you are using HibernatingRhinos, you should try a new dll build:
http://hibernatingrhinos.com/builds like discussed in this post:
https://groups.google.com/forum/#!topic/nhprof/XY4e3tm-ONc
It solved my issue.