2 seperate nopcommerce sites on same IIs Server one works other does not

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Hace 2 años
2019 Windows server, IIs v 10.0 - 2 nopcommerce websites - created 2nd App pool for second site because cannot run 2 sites in same app pool.  First site in original app pool .NET v4.0 works as it should, 2nd site running in app pool .NET v4.0 (2) will not start I get the following message in browser -HTTP Error 500.30 - ASP.NET Core app failed to start - and a bunch of errors in Application event viewer Please picture and event viewer error file attached
Event log-
Log Name:      Application
Source:        .NET Runtime
Date:          9/21/2021 7:54:24 PM
Event ID:      1026
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      WEB1
Description:
Application: w3wp.exe
CoreCLR Version: 5.0.821.31504
.NET Version: 5.0.8
Description: The process was terminated due to an unhandled exception.
Exception Info: System.UnauthorizedAccessException: Access to the path 'D:\oaybc\App_Data\appsettings.json' is denied.
   at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)
   at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.StreamWriter.ValidateArgsAndOpenPath(String path, Boolean append, Encoding encoding, Int32 bufferSize)
   at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding)
   at System.IO.File.WriteAllText(String path, String contents, Encoding encoding)
   at Nop.Core.Infrastructure.NopFileProvider.WriteAllText(String path, String contents, Encoding encoding)
   at Nop.Services.Configuration.AppSettingsHelper.SaveAppSettings(AppSettings appSettings, INopFileProvider fileProvider)
   at Nop.Web.Framework.Infrastructure.Extensions.ServiceCollectionExtensions.ConfigureApplicationServices(IServiceCollection services, IConfiguration configuration, IWebHostEnvironment webHostEnvironment)
   at Nop.Web.Startup.ConfigureServices(IServiceCollection services)
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.InvokeCore(Object instance, IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass9_0.<Invoke>g__Startup|0(IServiceCollection serviceCollection)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.Invoke(Object instance, IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass8_0.<Build>b__0(IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.UseStartup(Type startupType, HostBuilderContext context, IServiceCollection services, Object instance)
   at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass13_0.<UseStartup>b__0(HostBuilderContext context, IServiceCollection services)
   at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()
   at Microsoft.Extensions.Hosting.HostBuilder.Build()
   at Nop.Web.Program.Main(String[] args)
   at Nop.Web.Program.<Main>(String[] args)

Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name=".NET Runtime" />
    <EventID Qualifiers="0">1026</EventID>
    <Level>2</Level>
    <Task>0</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2021-09-21T23:54:24.301213700Z" />
    <EventRecordID>1851</EventRecordID>
    <Channel>Application</Channel>
    <Computer>WEB1</Computer>
    <Security />
  </System>
  <EventData>
    <Data>Application: w3wp.exe
CoreCLR Version: 5.0.821.31504
.NET Version: 5.0.8
Description: The process was terminated due to an unhandled exception.
Exception Info: System.UnauthorizedAccessException: Access to the path 'D:\oaybc\App_Data\appsettings.json' is denied.
   at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)
   at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.StreamWriter.ValidateArgsAndOpenPath(String path, Boolean append, Encoding encoding, Int32 bufferSize)
   at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding)
   at System.IO.File.WriteAllText(String path, String contents, Encoding encoding)
   at Nop.Core.Infrastructure.NopFileProvider.WriteAllText(String path, String contents, Encoding encoding)
   at Nop.Services.Configuration.AppSettingsHelper.SaveAppSettings(AppSettings appSettings, INopFileProvider fileProvider)
   at Nop.Web.Framework.Infrastructure.Extensions.ServiceCollectionExtensions.ConfigureApplicationServices(IServiceCollection services, IConfiguration configuration, IWebHostEnvironment webHostEnvironment)
   at Nop.Web.Startup.ConfigureServices(IServiceCollection services)
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.InvokeCore(Object instance, IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.&lt;&gt;c__DisplayClass9_0.&lt;Invoke&gt;g__Startup|0(IServiceCollection serviceCollection)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.Invoke(Object instance, IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.&lt;&gt;c__DisplayClass8_0.&lt;Build&gt;b__0(IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.UseStartup(Type startupType, HostBuilderContext context, IServiceCollection services, Object instance)
   at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.&lt;&gt;c__DisplayClass13_0.&lt;UseStartup&gt;b__0(HostBuilderContext context, IServiceCollection services)
   at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()
   at Microsoft.Extensions.Hosting.HostBuilder.Build()
   at Nop.Web.Program.Main(String[] args)
   at Nop.Web.Program.&lt;Main&gt;(String[] args)
</Data>
  </EventData>
</Event>
Hace 2 años
Not sure I think you need two seperate Websites not just App Pools ?

But looks like the file protections on the directory are not set for the New App Pool
This is how I do it See https://www.selectsystems.com.au/installing-nopcommerce-tips-and-tricks
Hace 2 años
what apppool account needs SQL login?  Why does first website work and second does not , looked in SQL and first site DB did not create any special login.  Also this is 2 seperate websites different Domain names using Host Headers.
Regards, P.Adkins
Hace 2 años
Your error is
  ... Access to the path 'D:\oaybc\App_Data\appsettings.json' is denied.

That's file access, not DB access.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.