MVC-Fehler bei der Datenbank-Entitäten
Hallo zusammen ich arbeite momentan an einem MVC-Projekt habe ich die folgenden Fehler, es ist ein multi-layer-Projekt, das ich arbeite auf
Eine Ausnahme des Typs " System.InvalidOperationException' ist in EntityFramework.dll wurde aber nicht behandelt werden, in Benutzer-code Zusätzliche Informationen: Keine Verbindung Zeichenfolge mit dem Namen 'AssignmentEntities' gefunden werden kann, in die Anwendung config-Datei.
Nun habe ich kopiert Sie die Verbindungszeichenfolge aus der gemeinsamen Schicht auf der Anwendungsschicht jedoch bin ich noch immer der Fehler. Was denkst du ist der Fehler???
Dies ist die app.config code
<?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>
<connectionStrings>
<add name="AssignmentEntities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string="data source=mathis;initial catalog=""Trader'sMarketplace"";integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
</configuration>
Dies ist das Internet.config-Datei
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=301880
-->
<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>
<connectionStrings>
<add name="AssignmentEntities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string="data source=mathis;initial catalog=""Trader'sMarketplace"";integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
<appSettings>
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<system.web>
<authentication mode="None" />
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<system.webServer>
<modules>
<remove name="FormsAuthenticationModule" />
</modules>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-5.1.0.0" newVersion="5.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IProductsBL" />
<binding name="BasicHttpBinding_IUserBL" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:63717/ProductsBL.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IProductsBL" contract="ProductsService.IProductsBL" name="BasicHttpBinding_IProductsBL" />
<endpoint address="http://localhost:63717/UserBL.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IUserBL" contract="UsersService.IUserBL" name="BasicHttpBinding_IUserBL" />
</client>
</system.serviceModel>
</configuration>
danke für Eure Hilfe Jungs ich habe versucht, Sie zu lösen dieses Problem für die letzten paar Tage und bekommen nicht, wo.
InformationsquelleAutor Matthias McCarthy | 2014-12-26
Du musst angemeldet sein, um einen Kommentar abzugeben.
Sicherzustellen, dass Sie gespeichert haben, änderungen in
Web.config
(wenn Sie WebApplication) oderApp.config
(wenn desktop-Anwendung).Fehler sagt:
No connection string named 'AssignmentEntities' could be found in the application config file
Müssen Sie die Konfiguration ändern eines starter-Projekts.
InformationsquelleAutor opewix
Also ich habe das problem gelöst, das problem, das ich hatte, war dass es keine Verbindung Zeichenfolge innerhalb der BL-Services-Bibliothek, die ich benutze Für Service-Verweise. Ich habe schlug meinen Kopf für die letzten paar Tage für nichts. Jetzt kann ich sagen, dass es funktioniert.
InformationsquelleAutor Matthias McCarthy