An error occurred while starting the application. NopCommerce 4.1 & IIS

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 years ago
I keep getting this error message when attempting to start my published version of NC4.1 on IIS (Windows 2012)
An error occurred while starting the application.
.NET Core 4.6.26628.05 X64 v4.0.0.0    |   Microsoft.AspNetCore.Hosting version 2.1.1-rtm-30846    |    Microsoft Windows 6.2.9200

I set the web.config to output to a log file and see the following in the first line of the log:
Application startup exception: Newtonsoft.Json.JsonReaderException: Bad JSON escape sequence: \S. Path 'DataConnectionString', line 3, position 44.


It appears that the error message is indicating a bad connection string, however, it is set correctly - I tested it in SSMS and the login/pass worked fine. Integrated security worked fine too.

I'm stumped as to why this is happening
5 years ago
Okay - There was several problems

1) The SDK for Core 2.1.x does not include the runtime, so I had to download and install the Runtime and Hosting bundle on the Web Server. https://www.microsoft.com/net/download/thank-you/dotnet-runtime-2.1.2-windows-hosting-bundle-installer

2) I had to change the Build to Release, Any CPU (instead of Mixed Platform)

3) I had to set the Publish Settings to:
Configuration: Release - Any CPU
Target Framework: netcoreapp2.1
Deployment Mode: Framework-Dependent
Target Runtime: Portable


4) I had to escape the backslash in the connection string (My server was ServerName\Instance), but that still didn't work (works on the old json interpreter, but not on the latest - go figure!), so I had to put in the IP address of the SQL Server instead (ServerName\\Instance doesn't work in json -arrggghh!).
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.