Thanks Logan
Here is my appsettings.json
****************************
{
"Logging": {
"LogLevel": {
"Default": "Warning"
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
//"AdventureWorks": "Host=192.168.1.21;Database=AdventureWorks;Port=5433;Username=postgres;Password=pass;TCP Keepalive Time=0;Keepalive=0;Command Timeout=30;TCP Keepalive Interval=0;Timeout=15;Connection Pruning Interval=10;Connection Idle Lifetime=300;Maximum Pool Size=100;Minimum Pool Size=0;Internal Command Timeout=-1;Read Buffer Size=8192;Socket Receive Buffer Size=8192;Pooling=True;Socket Send Buffer Size=8192;Max Auto Prepare=0;Auto Prepare Min Usages=5;Use Perf Counters=False;No Reset On Close=False;Convert Infinity DateTime=False;Write Buffer Size=8192;Persist Security Info=False;Include Realm=False;Enlist=False;Integrated Security=False;Encoding=UTF8;Trust Server Certificate=False;Check Certificate Revocation=False;SSL Mode=Disable"
"AdventureWorks": "Data Source=EliteJava\SQL2012;Initial Catalog=AdventureWorks2012;Integrated Security=False;User ID=sa;Password=pass;Pooling=False;Min Pool Size=0;Max Pool Size=100;ApplicationIntent=ReadWrite"
}
}
***********************
First connection [commented] to connect Postgres, which get connected.
Second one [ non-commented] to connect SQLServer, which gives me error
The message which I get while running Test of SampleController.cs is
Failed to start the Web API Tester. Please check the output error message.
The following is the error message
**************************************************
Web API Tester->The test service has started and is listening on port 65533.
Host-> Host failed to start: System.FormatException: Could not parse the JSON file.
Host-> ---> System.Text.Json.JsonReaderException: 'S' is an invalid escapable character within a JSON string. The string should be correctly escaped. LineNumber: 9 | BytePositionInLine: 45.
Host-> at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan`1 bytes)
Host-> at System.Text.Json.Utf8JsonReader.ConsumeStringAndValidate(ReadOnlySpan`1 data, Int32 idx)
Host-> at System.Text.Json.Utf8JsonReader.ConsumeString()
Host-> at System.Text.Json.Utf8JsonReader.ConsumeValue(Byte marker)
Host-> at System.Text.Json.Utf8JsonReader.ReadSingleSegment()
Host-> at System.Text.Json.Utf8JsonReader.Read()
Host-> at System.Text.Json.JsonDocument.Parse(ReadOnlySpan`1 utf8JsonSpan, Utf8JsonReader reader, MetadataDb& database, StackRowStack& stack)
Host-> at System.Text.Json.JsonDocument.Parse(ReadOnlyMemory`1 utf8Json, JsonReaderOptions readerOptions, Byte[] extraRentedBytes)
Host-> at System.Text.Json.JsonDocument.Parse(ReadOnlyMemory`1 json, JsonDocumentOptions options)
Host-> at System.Text.Json.JsonDocument.Parse(String json, JsonDocumentOptions options)
Host-> at Microsoft.Extensions.Configuration.Json.JsonConfigurationFileParser.ParseStream(Stream input)
Host-> at Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider.Load(Stream stream)
Host-> --- End of inner exception stack trace ---
Host-> at Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider.Load(Stream stream)
Host-> at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload)
Host-> --- End of stack trace from previous location where exception was thrown ---
Host-> at Microsoft.Extensions.Configuration.FileConfigurationProvider.HandleException(ExceptionDispatchInfo info)
Host-> at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload)
Host-> at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load()
Host-> at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList`1 providers)
Host-> at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()
Host-> at Microsoft.Extensions.Hosting.HostBuilder.BuildAppConfiguration()
Host-> at Microsoft.Extensions.Hosting.HostBuilder.Build()
Host-> at SnapDevelop.WebApiTester.Host.TargetFrameworkHost_3x.Initialize(String[] args)
Host-> at SnapDevelop.WebApiTester.Host.WebApiTesterHost..ctor(String[] args)
Host-> at SnapDevelop.WebApiTester.Host.Program.Main(String[] args)
Host->
The process has exited.
Host->Web API Tester stop.
************************************************
Any idea ?
As suggested, snapdevelopa application works after modifying data source to EliteJava\\SQL2012 in appsettings.json. But the issue remains while connecting the database from DB Server Explorer. Same change (EliteJava\\SQLServer2012) is not working. Any suggestion ?
Regards, Logan