No Entity Framework provider found for the ADO provider with invariant name ' System.Data.SqlClient '

Source: Internet
Author: User

Exception Description:

System.Data.Entity.Core.MetadataException:Schema specified is not valid. Errors:
PAYCENTERMODELS.SSDL (2,2): Error 0152:no Entity Framework provider found for the ADO provider with invariant name ' S Ystem. Data.sqlclient '. Make sure the provider are registered in the ' EntityFramework ' section of the application config file. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.
In System.Data.Entity.Core.Metadata.Edm.StoreItemCollection.Loader.ThrowOnNonWarningErrors ()
In System.Data.Entity.Core.Metadata.Edm.StoreItemCollection.Loader.LoadItems (IEnumerable ' 1 xmlreaders, IEnumerable ' 1 sourcefilepaths)
In System.Data.Entity.Core.Metadata.Edm.StoreItemCollection.Loader. ctor (IEnumerable ' 1 xmlreaders, IEnumerable ' 1 sourcefilepaths, Boolean throwOnError, Idbdependencyresolver Resolver)
In System.Data.Entity.Core.Metadata.Edm.StoreItemCollection.Init (IEnumerable ' 1 xmlreaders, IEnumerable ' 1 filepaths, Boolean throwOnError, Idbdependencyresolver Resolver, dbprovidermanifest& providermanifest, DbProviderFactory & ProviderFactory, string& providerinvariantname, string& providermanifesttoken, Memoizer ' 2& Cachedctypefunction)
In System.Data.Entity.Core.Metadata.Edm.StoreItemCollection. ctor (IEnumerable ' 1 xmlreaders, IEnumerable ' 1 filepaths)
In System.Data.Entity.Core.Metadata.Edm.MetadataCache.LoadStoreCollection (Edmitemcollection edmitemcollection, Metadataartifactloader loader)
In system.data.entity.core.metadata.edm.metadatacache.<>c__displayclass5.<>c__displayclass7.< Getmetadataworkspace>b__1 ()
In System.lazy ' 1.CreateValue ()
In System.lazy ' 1.LazyInitValue ()
In System.lazy ' 1.get_value ()
In system.data.entity.core.metadata.edm.metadatacache.<>c__displayclass5.<>c__displayclass7.< Getmetadataworkspace>b__4 ()
In System.data.entity.core.metadata.edm.metadataworkspace.loadandcheckitemcollection[t] (Func ' 1 Itemcollectionloader)
In System.data.entity.core.metadata.edm.metadataworkspace.<>c__displayclass16.<.ctor>b__f ()
In System.lazy ' 1.CreateValue ()
In System.lazy ' 1.LazyInitValue ()
In System.lazy ' 1.get_value ()
In System.Data.Entity.Core.Metadata.Edm.MetadataWorkspace.GetItemCollection (DataSpace DataSpace, Boolean required)
In System.Data.Entity.Core.Metadata.Edm.MetadataWorkspace.GetItemCollection (DataSpace dataspace)
At System.Data.Entity.Core.Objects.ObjectContext.InitializeMappingViewCacheFactory (DbContext owner)
In System.Data.Entity.Core.Objects.ObjectContext. ctor (entityconnection connection, Boolean Isconnectionconstructor, objectqueryexecutionplanfactory Objectqueryexecutionplanfactory, Translator Translator, Columnmapfactory columnmapfactory)
In System.Data.Entity.Internal.InternalConnection.CreateObjectContextFromConnectionModel ()
In System.Data.Entity.Internal.LazyInternalConnection.CreateObjectContextFromConnectionModel ()
In System.Data.Entity.Internal.LazyInternalContext.InitializeContext ()
In System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType (Type entityType)
In System.Data.Entity.Internal.Linq.InternalSet ' 1.Initialize ()
In System.Data.Entity.Internal.Linq.InternalSet ' 1.get_internalcontext ()
In System.Data.Entity.Infrastructure.DbQuery ' 1.system.linq.iqueryable.get_provider ()
In System.linq.queryable.where[tsource] (IQueryable ' 1 source, Expression ' 1 predicate)
In PaymentBLL.NewPayApplyBLL.GetPaidOrder (String OrderNo, thirdpayplatformenums thirdpayplatform) Location D:\SourceProject \infrastructure. Paycenter\trunk\paymentplatform\paymentbll\newpayapplybll.cs: Line No. 30
D:\SourceProject\infrastructure in PaymentBLL.QRCodeBLL.Refund (String requestjson) position. Paycenter\trunk\paymentplatform\paymentbll\qrcodebll.cs: Line No. 132
The location of PaymentPlatform.QRCodeDemo.Refund.submit_Click (Object sender, EventArgs e) is d:\SourceProject\infrastructure. Paycenter\trunk\paymentplatform\paymentplatform\qrcodedemo\refund.aspx.cs: Line No. 63

Workaround:

Right-click the solution → manage nuget packages, select "EntityFramework", click "Manage", select the project to install EF in the pop-up box, tap "OK".

After completion, the following node configuration is more in Web. config:

<Configuration>  <configsections>     < Sectionname= "entityframework"type= "System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, version=6.0.0.0, culture= Neutral, publickeytoken=b77a5c561934e089 "requirepermission= "false" />  </configsections>  <EntityFramework>    <defaultconnectionfactorytype= "System.Data.Entity.Infrastructure.LocalDbConnectionFactory, entityframework">      <Parameters>        <parametervalue= "v11.0" />      </Parameters>    </defaultconnectionfactory>    <providers>      <providerInvariantName= "System.Data.SqlClient"type= "System.Data.Entity.SqlServer.SqlProviderServices, entityframework.sqlserver" />    </providers>  </EntityFramework></Configuration>

At the same time, the reference is more than 2 packets of entityframework:

No Entity Framework provider found for the ADO provider with invariant name ' System.Data.SqlClient '

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.