I sent an app for production but I'm getting what appears to be a connection error.
And this is the error when I invoke the api URL
Win32Exception: The parameter is incorrect.
Unknown locationSqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 25 - Connection string is not valid)
The error itself is pretty self-explanatory but as far as I understand the connection string is OK
Here's the appsettings.json
in C#:
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"Hawk": "Data Source=Hawk.db",
"HawkSQLServer": "Server=vgcserver2\\MSSQLSERVER;Database=HawkNew;User Id=sa;Password=password;"
}
}
The database is named HawkNew
and user sa
has the same password from the connection string (SQL Server 2014).
The server's web.config
file:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*"
modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\BackEnd.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
</system.webServer>
</location>
</configuration>