Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to determine the provider name for provider factory of type 'System.Data.SqlClient.SqlClientFactory'. Make sure that the ADO.NET provider is installed or registered in the application config. #4283

Closed
rmsohailarshad opened this issue Feb 13, 2019 · 11 comments

Comments

@rmsohailarshad
Copy link

I am designing Core 2.2 Web Api using Abp framework. I've setup App.Core, App.EntityFramework, App.Application. My goal is to expose App.Application & others to App.CoreWebApi project, and my clients uses only App.CoreWebApi which eventually deployed on some server. My clients includes multiple platforms mobile ui, web ui, and desktop ui. Everything is setup and in place but recieveing annoying error with database context class:

image

image

image

Message

Unable to determine the provider name for provider factory of type 'System.Data.SqlClient.SqlClientFactory'. Make sure that the ADO.NET provider is installed or registered in the application config.

Stacktrace

at System.Data.Entity.Utilities.DbProviderFactoryExtensions.GetProviderInvariantName(DbProviderFactory factory) at System.Data.Entity.Infrastructure.DependencyResolution.DefaultInvariantNameResolver.GetService(Type type, Object key) at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) at System.Linq.Enumerable.SelectArrayIterator2.MoveNext()
at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable1 source, Func2 predicate, Boolean& found) at System.Data.Entity.Infrastructure.DependencyResolution.ResolverChain.GetService(Type type, Object key) at System.Linq.Enumerable.SelectArrayIterator2.MoveNext() at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable1 source, Func2 predicate, Boolean& found) at System.Data.Entity.Infrastructure.DependencyResolution.ResolverChain.GetService(Type type, Object key) at System.Data.Entity.Infrastructure.DependencyResolution.CompositeResolver2.GetService(Type type, Object key) at System.Data.Entity.Infrastructure.DependencyResolution.DbDependencyResolverExtensions.GetService[T](IDbDependencyResolver resolver, Object key) at System.Data.Entity.Utilities.DbConnectionExtensions.GetProviderInvariantName(DbConnection connection) at System.Data.Entity.Internal.InternalConnection.get_ProviderName()
at System.Data.Entity.Internal.DefaultModelCacheKeyFactory.Create(DbContext context)
at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
at System.Data.Entity.Internal.InternalContext.Initialize()
at System.Data.Entity.Internal.InternalContext.ForceOSpaceLoadingForKnownEntityTypes()
at System.Data.Entity.DbContext.System.Data.Entity.Infrastructure.IObjectContextAdapter.get_ObjectContext() at Abp.EntityFramework.AbpDbContext.RegisterToChanges() in D:\Github\aspnetboilerplate\src\Abp.EntityFramework\EntityFramework\AbpDbContext.cs:line 148
at Hoorain.EntityFramework.HoorainDbContext..ctor(String nameOrConnectionString) in C:\Users\Admin\Downloads\Hoorain\4.1.0\src\Hoorain.EntityFramework\EntityFramework\HoorainDbContext.cs:line 34
at lambda_method(Closure , Object[] )
at Castle.Core.Internal.ReflectionUtil.Instantiate[TBase](Type subtypeofTBase, Object[] ctorArgs)
at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstanceCore(ConstructorCandidate constructor, Object[] arguments, Type implType)`

@ismcagdas
Copy link
Member

@rmsohailarshad are you using EF 6 ?

@rmsohailarshad
Copy link
Author

Yes.

@ismcagdas
Copy link
Member

And is your project .NET Core ? If so, this is not supported yet, see dotnet/ef6#623 (comment)

@rmsohailarshad
Copy link
Author

Following is the exact version I am using:
<package id="EntityFramework" version="6.2.0" targetFramework="net461" />

@ismcagdas
Copy link
Member

I mean your project's target framework not the EF's version.
You can check value of TargetFramework item in your csproj file.

@rmsohailarshad
Copy link
Author

It is Core 2.2
image

@acjh
Copy link
Contributor

acjh commented Feb 14, 2019

As mentioned by @ismcagdas, .NET Core does not support EF 6 yet.

@rmsohailarshad
Copy link
Author

can I deploy my Hoorain.Application project as webapi, if I enable Dynamic Api?
image

@ismcagdas
Copy link
Member

you need to deploy WebApi project, Hoorain.Application is a class library.

@rmsohailarshad
Copy link
Author

@ismcagdas is there any help manual to configure Web Api 2?

@maliming
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants