異常: Unable to determine the provider name for provider factory of type 'MySql.Data.MySqlClient.MySqlClientFactory'.


 

報錯信息:

異常: Unable to determine the provider name for provider factory of type 'MySql.Data.MySqlClient.MySqlClientFactory'. Make sure that the ADO.NET provider is installed or registered in the application config.
6. 來源: EntityFramework
7. 實例:    在 System.Data.Entity.Utilities.DbProviderFactoryExtensions.GetProviderInvariantName(DbProviderFactory factory)
   在 System.Data.Entity.Infrastructure.DependencyResolution.DefaultInvariantNameResolver.GetService(Type type, Object key)
   在 System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   在 System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   在 System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   在 System.Data.Entity.Infrastructure.DependencyResolution.RootDependencyResolver.GetService(Type type, Object key)
   在 System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   在 System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   在 System.Data.Entity.Infrastructure.DependencyResolution.CompositeResolver`2.GetService(Type type, Object key)
   在 System.Data.Entity.Infrastructure.DependencyResolution.DbDependencyResolverExtensions.GetService[T](IDbDependencyResolver resolver, Object key)
   在 System.Data.Entity.Utilities.DbConnectionExtensions.GetProviderInvariantName(DbConnection connection)
   在 System.Data.Entity.Internal.InternalConnection.get_ProviderName()
   在 System.Data.Entity.Internal.DefaultModelCacheKeyFactory.Create(DbContext context)
   在 System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
   在 System.Data.Entity.Internal.InternalContext.Initialize()
   在 System.Data.Entity.Internal.LazyInternalContext.get_ObjectContext()
   在 System.Data.Entity.Internal.InternalContext.GetStateEntry(Object entity)
   在 System.Data.Entity.Internal.InternalEntityEntry..ctor(InternalContext internalContext, Object entity)
   在 System.Data.Entity.DbContext.Entry[TEntity](TEntity entity)
   在 Qianchen.DataBase.MySqlEx.Database.Insert[T](T entity)
   在 Qianchen.Application.Base.SystemModule.LogService.WriteLog(LogEntity logEntity)

  Web.config文件加入配置解決:

<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />

  

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM