我遇到了Entity Framework的问题。 我创建了一个数据模型,一切似乎在我的本地调试机器上正常工作,但是当我发布时,我得到以下消息
System.Data.ProviderIncompatibleException:商店提供程序工厂类型“MySql.Data.MySqlClient.MySqlClientFactory”未实现IServiceProvider接口。使用实现此接口的商店提供程序。位于System.Data.Metadata.Edm.StoreItemCollection.Loader.InitializeProviderManifest(Action 3 addError) at System.Data.Metadata.Edm.StoreItemCollection.Loader.OnProviderManifestTokenNotification(String token, Action
3 addError)的System.Data.Common.DbProviderServices.GetProviderServices(DbProviderFactory factory)处于System.Data.EntityModel.SchemaObjectModel.Schema.HandleProviderManifestTokenAttribute (XmlReader reader)位于System.Data.EntityModel.SchemaObjectModel.Schema.HandleAttribute(XmlReader reader)的System.Data.EntityModel.SchemaObjectModel.SchemaElement.ParseAttribute(XmlReader reader)System.Data.EntityModel.SchemaObjectModel.SchemaElement.Parse(XmlReader)的System.Data.EntityModel.SchemaObjectModel.Schema.HandleAttribute(XmlReader reader)读者)位于System.Data.EntityModel.SchemaObjectModel.Schema.Parse的System.Data.EntityModel.SchemaObjectModel.Schema.InternalParse(XmlReader sourceReader,String sourceLocation)中的System.Data.EntityModel.SchemaObjectModel.Schema.HandleTopLevelSchemaElement(XmlReader reader)。的XmlReader sourceReader,字符串sourceLocation)在System.Data.EntityModel.SchemaObjectModel.SchemaManager.ParseAndValidate(IEnumerable的1 xmlReaders, IEnumerable
1个sourceFilePaths,SchemaDataMo delOption数据模型,AttributeValueNotification providerNotification,AttributeValueNotification providerManifestTokenNotification,ProviderManifestNeeded providerManifestNeeded,IList的1& schemaCollection) at System.Data.Metadata.Edm.StoreItemCollection.Loader.LoadItems(IEnumerable
1个xmlReaders,IEnumerable的1 sourceFilePaths) at System.Data.Metadata.Edm.StoreItemCollection.Init(IEnumerable
1个xmlReaders,IEnumerable的1 filePaths, Boolean throwOnError, DbProviderManifest& providerManifest, DbProviderFactory& providerFactory, Memoizer
2及cachedCTypeFunction)在System.Data.Metadata.Edm.StoreItemCollection..ctor(IEnumerable的1 xmlReaders, IEnumerable
1个文件路径)在System.Data.Metadata.Edm.MetadataCache.StoreMetadataEntry.LoadStoreCollection(EdmItemCollection edmItemCollection,MetadataArtifactLoader装载机)在System.Data .Metadata.Edm.MetadataCache.StoreItemCollectionLoader.LoadItemCollection(StoreMetadataEntry条目)在System.Data.Metadata.Edm.MetadataCache.LoadItemCollection [T](IItemCollectionLoader 1 itemCollectionLoader, T entry) at System.Data.Metadata.Edm.MetadataCache.GetOrCreateStoreAndMappingItemCollections(String cacheKey, MetadataArtifactLoader loader, EdmItemCollection edmItemCollection, Object& entryToken) at System.Data.EntityClient.EntityConnection.LoadStoreItemCollections(MetadataWorkspace workspace, DbConnection storeConnection, DbProviderFactory factory, DbConnectionOptions connectionOptions, EdmItemCollection edmItemCollection, MetadataArtifactLoader artifactLoader) at System.Data.EntityClient.EntityConnection.GetMetadataWorkspace(Boolean initializeAllCollections) at System.Data.EntityClient.EntityConnection.InitializeMetadata(DbConnection newConnection, DbConnection originalConnection, Boolean closeOriginalConnectionOnFailure) at System.Data.EntityClient.EntityConnection.Open() at System.Data.Objects.ObjectContext.EnsureConnection() at System.Data.Objects.ObjectQuery
1.GetResults(可空1 forMergeOption) at System.Data.Objects.ObjectQuery
1.系统。 _Default.Page_Load(Object sender,EventArgs e)上的Collections.Generic.IEnumerable.GetEnumerator()
答案 0 :(得分:0)
似乎是一个库版本的东西。您在开发和生产中运行的每个服务器和库的版本是什么?
答案 1 :(得分:0)
看起来您的MySQL数据提供程序与EF不兼容。您使用的是this连接器吗?
答案 2 :(得分:0)
我希望这会对某人有所帮助。
我需要添加另一个DLL MySql.Data.Entity.dll