I have 2 projects: Console app and dll. In dll i am using EntityFramework. I have this app.config file:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<connectionStrings>
<add name="NorthwindConnection" connectionString="Data Source=ВЛАДИСЛАВ-ПК\SQLEXPRESS;Initial Catalog=Northwind;User ID=sa;Password=sa;" providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
I am calling EntityFramework from console app, but i have this error message: "No connection string named "NorthwindConnection" could be found in the application config file.".
This is console app.config file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>