ConnectionString - issue with .NET Core 2.0
Posted: Mon 27 Nov 2017 23:35
When you check the box "Use the following connection from App.Config" (under model settings).
The following statement is generated in the context file
There is an issue with "System.Configuration.ConnectionStringSettings" this method is missing, it has been forwarded to ConfigurationManager.
The following statement is generated in the context file
Code: Select all
private static string GetConnectionString(string connectionStringName)
{
System.Configuration.ConnectionStringSettings connectionStringSettings = System.Configuration.ConfigurationManager.ConnectionStrings[connectionStringName];
if (connectionStringSettings == null)
throw new InvalidOperationException("Connection string \"" + connectionStringName +"\" could not be found in the configuration file.");
return connectionStringSettings.ConnectionString;
}