Autor Beitrag
Schafschaf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 63
Erhaltene Danke: 2

Windows 10
C# (VS 2015)
BeitragVerfasst: Mo 07.12.15 11:43 
Hallo liebe Community,

meine EF Code First Anwendung erstellt trotz Connection String in der App.config die Datenbank immer auf dem lokalen SQL Server statt auf dem Server den in dem Connection String angebe.
In anderen Projekten hat das bisher auch funktioniert, hat jemand eine Ahnung warum EF in dieser Anwendung den Connection String ignoriert?
Habe es schon in beiden Projekten probiert, also in der Projektmappe sind 2 Projekte, eine Class Library und eine Console Application. In beiden App.config Dateien hab ich es schon ausprobiert, es hilft nix :(
So sieht das Fragment der App.config aus:

ausblenden XML-Daten
1:
2:
3:
4:
5:
<connectionStrings>
    <add name="DefaultConnection"
          providerName="System.Data.SqlClient"
          connectionString="Source=servername;Catalog=dbname;Integrated Security=True;"/>    
  </connectionStrings>


LG Schafschaf
Ralf Jansen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 4700
Erhaltene Danke: 991


VS2010 Pro, VS2012 Pro, VS2013 Pro, VS2015 Pro, Delphi 7 Pro
BeitragVerfasst: Mo 07.12.15 12:20 
Das ist ein normaler SQL Server Connection string. Ein Entity Framework Connection string sieht anders aus. Siehe msdn.microsoft.com/e...ibrary/cc716756.aspx

Für diesen Beitrag haben gedankt: Schafschaf
Schafschaf Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 63
Erhaltene Danke: 2

Windows 10
C# (VS 2015)
BeitragVerfasst: Mo 07.12.15 12:51 
Oh, da hab ich mal wieder den Wald vor lauter Bäumen nicht gesehn :D Mit dem anderen Connection String funktioniert es. Danke :)
Hier mal wie ich es gemacht habe:

ausblenden XML-Daten
1:
2:
3:
4:
5:
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="Data Source=servername; Integrated Security=True; MultipleActiveResultSets=True"/>
      </parameters>
</defaultConnectionFactory>