An error occurred while starting the application

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
An error occurred while starting the application.

.NET Framework 4.6.1590.0 X86 v4.0.0.0    |   Microsoft.AspNetCore.Hosting version 2.0.0-rtm-26452    |    Microsoft Windows 6.3.9600    |   Need help?


This is my log file content:

Application startup exception: System.ApplicationException: No database instance
   at Nop.Data.Initializers.CreateTablesIfNotExist`1.InitializeDatabase(TContext context)
   at System.Data.Entity.Internal.InternalContext.<>c__DisplayClassf`1.<CreateInitializationAction>b__e()
   at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
   at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()
   at System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c)
   at System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input)
   at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action)
   at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase()
   at System.Data.Entity.Internal.InternalContext.Initialize()
   at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
   at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
   at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
   at System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider()
   at System.Linq.Queryable.Where[TSource](IQueryable`1 source, Expression`1 predicate)
   at Nop.Services.Tasks.ScheduleTaskService.GetAllTasks(Boolean showHidden)
   at Nop.Services.Tasks.TaskManager.Initialize()
   at Nop.Web.Framework.Infrastructure.Extensions.ServiceCollectionExtensions.ConfigureApplicationServices(IServiceCollection services, IConfigurationRoot configuration)
   at Nop.Web.Startup.ConfigureServices(IServiceCollection services)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
crit: Microsoft.AspNetCore.Hosting.Internal.WebHost[6]
      Application startup exception
System.ApplicationException: No database instance
   at Nop.Data.Initializers.CreateTablesIfNotExist`1.InitializeDatabase(TContext context)
   at System.Data.Entity.Internal.InternalContext.<>c__DisplayClassf`1.<CreateInitializationAction>b__e()
   at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
   at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()
   at System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c)
   at System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input)
   at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action)
   at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase()
   at System.Data.Entity.Internal.InternalContext.Initialize()
   at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
   at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
   at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
   at System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider()
   at System.Linq.Queryable.Where[TSource](IQueryable`1 source, Expression`1 predicate)
   at Nop.Services.Tasks.ScheduleTaskService.GetAllTasks(Boolean showHidden)
   at Nop.Services.Tasks.TaskManager.Initialize()
   at Nop.Web.Framework.Infrastructure.Extensions.ServiceCollectionExtensions.ConfigureApplicationServices(IServiceCollection services, IConfigurationRoot configuration)
   at Nop.Web.Startup.ConfigureServices(IServiceCollection services)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
Hosting environment: Production
Content root path: C:\inetpub\Sites\OkTour24_ir
Now listening on: http://localhost:27509
Application started. Press Ctrl+C to shut down.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://www.oktour24.ir/  
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://www.oktour24.ir/  
fail: Microsoft.AspNetCore.Server.Kestrel[13]
      Connection id "0HLA5E7BHE602", Request id "0HLA5E7BHE602:00000001": An unhandled exception was thrown by the application.
System.ArgumentNullException: Value cannot be null.
Parameter name: values
   at System.String.Join(String separator, IEnumerable`1 values)
   at Microsoft.Extensions.RazorViews.BaseView.EndWriteAttribute()
   at Microsoft.AspNetCore.Hosting.Views.ErrorPage.<ExecuteAsync>d__6.MoveNext()
--- 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.Extensions.RazorViews.BaseView.<ExecuteAsync>d__29.MoveNext()
--- 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 System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Frame`1.<ProcessRequestsAsync>d__2.MoveNext()
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 98.3162ms 500 text/html; charset=utf-8
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 102.2595ms 500
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://www.oktour24.ir/  
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 1.876ms 500 text/html; charset=utf-8
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://www.oktour24.ir/  
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 0.1454ms 500 text/html; charset=utf-8
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://www.oktour24.ir/  
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 0.4275ms 500 text/html; charset=utf-8
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://www.oktour24.ir/  
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 0.1678ms 500 text/html; charset=utf-8
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://www.oktour24.ir/?  
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 0.3756ms 500 text/html; charset=utf-8
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://www.oktour24.ir/?  
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 0.4382ms 500 text/html; charset=utf-8
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://www.oktour24.ir/?  
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 0.8616ms 500 text/html; charset=utf-8
6 years ago
My site has been working correctly but I don't know what happened that this error appeared two days ago.
6 years ago
Hi asdo,

Please check DataConnectionString and database, make sure everything is correct.
6 years ago
https://www.nopcommerce.com/boards/t/49851/serious-iis-application-pool-recycling-bugdesign-flaw.aspx
6 years ago
timmit wrote:
https://www.nopcommerce.com/boards/t/49851/serious-iis-application-pool-recycling-bugdesign-flaw.aspx

It's not somehow related to this forum topic (DLL locking). This error clearly says - "No database instance"
6 years ago
summonier wrote:
Hi asdo,

Please check DataConnectionString and database, make sure everything is correct.


Hi summonier

Thanks alot
I checked my Connection String it had been broken
I changed my connection string manually and It worked.
6 years ago
Help me please. I can't start 4.0, and I have no clue why.

Where is this " DataConnectionString" exactly?
6 years ago
picur wrote:
Help me please. I can't start 4.0, and I have no clue why.

Where is this " DataConnectionString" exactly?


Go through app_data/datasettings.json

This Jon file content connection string.
6 years ago
Hi, i have the same problem when trying to run the site via IIS. I've tried setting the Application Pool setting "Disable Overlapped Recycle" to True but i still have the same issue in that when i hit the site it comes back with: -

An error occurred while starting the application.
.NET Framework 4.7.2633.0 X86 v4.0.0.0    |   Microsoft.AspNetCore.Hosting version 2.0.0-rtm-26452    |    Microsoft Windows 10.0.16299    |   Need help?


The StdOut log file shows: -

Application startup exception: System.ApplicationException: No database instance
   at Nop.Data.Initializers.CreateTablesIfNotExist`1.InitializeDatabase(TContext context)
   at System.Data.Entity.Internal.InternalContext.<>c__DisplayClassf`1.<CreateInitializationAction>b__e()
---- snip ----


I've checked dataSettings.json within App_Data and all looks fine. And this is the interesting thing; if i goto my install folder and run Nop.Web.Exe manually, it successfully loads the site and i can browse it via http://localhost:5000 yet if i add a site via IIS i get the above errors.

Surely it's using the same dataSettings.json configuration file if i run Nop.Web.Exe manually or i load it via IIS ?

I don't understand - can someone assit plz?

Thanks.


Steve
4 years ago
Yes, _very frustrating! An error occurred while starting the application . . .
".NET Core 4.6.27521.02 X64 v4.0.0.0    |   Microsoft.AspNetCore.Hosting version 2.2.0-rtm-35687    |    Microsoft Windows 10.0.14393". I successfully published two(2) 4.2 solutions. However, the 3rd one produced the [above] error. There was no significant changes other than product and database. _ALL permissions were checked and rechecked. Can anyone offer advice? (Please don't suggest checking permissions (fileshare, db, etc.), connectionstring, etc. [again] :o)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.