gpt4 book ai didi

c# - Entity Framework 错误消息 MYSQL,在发布时无法在本地计算机上运行

转载 作者:行者123 更新时间:2023-11-29 03:47:13 25 4
gpt4 key购买 nike

我在使用 Entity Framework 时遇到了问题。我创建了一个数据模型,一切似乎在我的本地调试机器上工作正常,但是当我发布时,我收到以下消息

System.Data.ProviderIncompatibleException:存储提供程序工厂类型“MySql.Data.MySqlClient.MySqlClientFactory”未实现 IServiceProvider 接口(interface)。使用实现此接口(interface)的商店提供程序。在 System.Data.Common.DbProviderServices.GetProviderServices(DbProviderFactory 工厂) 在 System.Data.Metadata.Edm.StoreItemCollection.Loader.InitializeProviderManifest(操作 3 addError) at System.Data.Metadata.Edm.StoreItemCollection.Loader.OnProviderManifestTokenNotification(String token, Action 3 addError) 在 System.Data.EntityModel.SchemaObjectModel.Schema.HandleProviderManifestTokenAttribute(XmlReader读取器)在 System.Data.EntityModel.SchemaObjectModel.Schema.HandleAttribute(XmlReader 读取器)在 System.Data.EntityModel.SchemaObjectModel.SchemaElement.ParseAttribute(XmlReader 读取器)在 System.Data.EntityModel.SchemaObjectModel.Schema.HandleTopLevelSchemaElement(XmlReader 阅读器) 在 System.Data.EntityModel.SchemaObjectModel.Schema.InternalParse(XmlReader sourceReader,String sourceLocation) , String sourceLocation) 在 System.Data.EntityModel.SchemaObjectModel.SchemaManager.ParseAndValidate(IEnumerable 1 xmlReaders, IEnumerable 1 sourceFilePat hs,SchemaDataModelOption dataModel,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 filePaths) 在 System.Data.Metadata.Edm.MetadataCache.StoreMetadataEntry.LoadStoreCollection(EdmItemCollection edmItemCollection, MetadataArtifactLoaderData loader) 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.System.Collection.IEgenerable .GetEnumerator() at _Default.Page_Load(Object sender, EventArgs e)

最佳答案

似乎是库版本的东西。您在开发和生产环境中运行的每个服务器和库的版本是什么?

关于c# - Entity Framework 错误消息 MYSQL,在发布时无法在本地计算机上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1725079/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com