There was an error starting the Nop4.0 version

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
I'm using Nop4.0 and Windows Server 2008
When I publish and run on windows server 2008 there is an error:

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

I see in the error log file :

Application startup exception: Newtonsoft.Json.JsonReaderException: Bad JSON escape sequence: \S. Path 'DataConnectionString', line 3, position 56.
   at Newtonsoft.Json.JsonTextReader.ReadStringIntoBuffer(Char quote)
   at Newtonsoft.Json.JsonTextReader.ReadStringValue(ReadType readType)
   at Newtonsoft.Json.JsonTextReader.ReadAsString()
   at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
   at Nop.Core.Data.DataSettingsManager.LoadSettings(String filePath, Boolean reloadSettings) in D:\PROJECTS\NgoiSaoNhi.Nop4.00\Libraries\Nop.Core\Data\DataSettingsManager.cs:line 93
   at Nop.Core.Data.DataSettingsHelper.DatabaseIsInstalled() in D:\PROJECTS\NgoiSaoNhi.Nop4.00\Libraries\Nop.Core\Data\DataSettingsHelper.cs:line 19
   at Nop.Web.Framework.Infrastructure.Extensions.ServiceCollectionExtensions.AddThemes(IServiceCollection services) in D:\PROJECTS\NgoiSaoNhi.Nop4.00\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ServiceCollectionExtensions.cs:line 135
   at Nop.Web.Framework.Infrastructure.NopCommonStartup.ConfigureServices(IServiceCollection services, IConfigurationRoot configuration) in D:\PROJECTS\NgoiSaoNhi.Nop4.00\Presentation\Nop.Web.Framework\Infrastructure\NopCommonStartup.cs:line 56
   at Nop.Core.Infrastructure.NopEngine.ConfigureServices(IServiceCollection services, IConfigurationRoot configuration) in D:\PROJECTS\NgoiSaoNhi.Nop4.00\Libraries\Nop.Core\Infrastructure\NopEngine.cs:line 193
   at Nop.Web.Framework.Infrastructure.Extensions.ServiceCollectionExtensions.ConfigureApplicationServices(IServiceCollection services, IConfigurationRoot configuration) in D:\PROJECTS\NgoiSaoNhi.Nop4.00\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ServiceCollectionExtensions.cs:line 51
   at Nop.Web.Startup.ConfigureServices(IServiceCollection services) in D:\PROJECTS\NgoiSaoNhi.Nop4.00\Presentation\Nop.Web\Startup.cs:line 44
--- 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
Newtonsoft.Json.JsonReaderException: Bad JSON escape sequence: \S. Path 'DataConnectionString', line 3, position 56.
   at Newtonsoft.Json.JsonTextReader.ReadStringIntoBuffer(Char quote)
   at Newtonsoft.Json.JsonTextReader.ReadStringValue(ReadType readType)
   at Newtonsoft.Json.JsonTextReader.ReadAsString()
   at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
   at Nop.Core.Data.DataSettingsManager.LoadSettings(String filePath, Boolean reloadSettings) in D:\PROJECTS\NgoiSaoNhi.Nop4.00\Libraries\Nop.Core\Data\DataSettingsManager.cs:line 93
   at Nop.Core.Data.DataSettingsHelper.DatabaseIsInstalled() in D:\PROJECTS\NgoiSaoNhi.Nop4.00\Libraries\Nop.Core\Data\DataSettingsHelper.cs:line 19
   at Nop.Web.Framework.Infrastructure.Extensions.ServiceCollectionExtensions.AddThemes(IServiceCollection services) in D:\PROJECTS\NgoiSaoNhi.Nop4.00\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ServiceCollectionExtensions.cs:line 135
   at Nop.Web.Framework.Infrastructure.NopCommonStartup.ConfigureServices(IServiceCollection services, IConfigurationRoot configuration) in D:\PROJECTS\NgoiSaoNhi.Nop4.00\Presentation\Nop.Web.Framework\Infrastructure\NopCommonStartup.cs:line 56
   at Nop.Core.Infrastructure.NopEngine.ConfigureServices(IServiceCollection services, IConfigurationRoot configuration) in D:\PROJECTS\NgoiSaoNhi.Nop4.00\Libraries\Nop.Core\Infrastructure\NopEngine.cs:line 193
   at Nop.Web.Framework.Infrastructure.Extensions.ServiceCollectionExtensions.ConfigureApplicationServices(IServiceCollection services, IConfigurationRoot configuration) in D:\PROJECTS\NgoiSaoNhi.Nop4.00\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ServiceCollectionExtensions.cs:line 51
   at Nop.Web.Startup.ConfigureServices(IServiceCollection services) in D:\PROJECTS\NgoiSaoNhi.Nop4.00\Presentation\Nop.Web\Startup.cs:line 44
--- 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\wwwroot\novalife.vn
Now listening on: http://localhost:23029
Application started. Press Ctrl+C to shut down.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://novalife.vn/  
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 78.963ms 500 text/html; charset=utf-8
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://novalife.vn/favicon.ico  
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 0.2063ms 500 text/html; charset=utf-8
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://www.novalife.vn/  
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 0.1474ms 500 text/html; charset=utf-8
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://www.novalife.vn/favicon.ico  
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 0.2083ms 500 text/html; charset=utf-8

I hope to receive help to resolve this issue
6 years ago
Did you manually modify your \App_Data\dataSettings.json file?  Check the syntax.
6 years ago
Can you please share your connection string?

So,I can assist you.
6 years ago
Thank you. I have already resolved the error
6 years ago
khoaphamnet wrote:
Thank you. I have already resolved the error


Glad to know you found cause of the issue.
6 years ago
New York wrote:
Did you manually modify your \App_Data\dataSettings.json file?  Check the syntax.


As you say, Error by file \ App_Data \ dataSettings.json. Is due to my misconfiguration
6 years ago
Hi.
I am also getting this same issue due to modfying the DataConnectionString in the dataSettings.json file. I'm only modfying this file because i'm at my wit's end trying to work out why once i deploy the site via IIS it doesn't work :(

If i undo my changes to dataSettings then it only works when running Nop.Web.Exe manually (via http://localhost:5000)

I cannot :( get my site to work via IIS as it keeps saying "No database instance" no matter what i try.

Running Nop v4.0

Any ideas please?


Steve
6 years ago
SteveEdwards wrote:
Hi.


I cannot :( get my site to work via IIS as it keeps saying "No database instance" no matter what i try.

Steve



Hello,

Than mistake is in connectionstring.

Could you please check once.

And let me know.
6 years ago
Hi,
Here is a copy of my dataSettings.json file: -

{
  "DataProvider": "sqlserver",
  "DataConnectionString": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=WHOLESALE;Integrated Security=False;Persist Security Info=False;User ID=WEBUSER;Password=XXXXX",
  "RawDataSettings": {}
}

It's worth pointing out that these settings are for a development machine. The production server isn't localdb and uses a server name as the Data Source but also still gets the same problem.

Steve
4 years ago
Hello There,

I am getting same issue. anyone can help me?

Thanks
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.