Unable to find provider assembly with name Microsoft.EntityFrameworkCore.SqlServer. Ensure the specified name is correct and is referenced by the project.
See original GitHub issueSteps to reproduce
- Create a class Library-.Net core
- Add Following Dependencies:
"Microsoft.EntityFrameworkCore.Tools": "1.1.0-preview4-final",
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.0",
"Microsoft.EntityFrameworkCore.Design": "1.1.0",
The issue
When performing Scaffold-Dbcontext towards a SqlServerDB like below, Microsoft.EntityFramework.SqlServer dll is not resolved… Scaffold-DbContext “Server={ConnectionString}” Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -verbose
Exception message:
Stack trace:
Microsoft.EntityFrameworkCore.Design.OperationException: Unable to find provider assembly with name Microsoft.EntityFrameworkCore.SqlServer. Ensure the specified name is correct and is referenced by the project. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.EntityFrameworkCore.SqlServer, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at Microsoft.EntityFrameworkCore.Design.Internal.DesignTimeServicesBuilder.GetProviderDesignTimeServices(String provider, Boolean throwOnError)
--- End of inner exception stack trace ---
at Microsoft.EntityFrameworkCore.Design.Internal.DesignTimeServicesBuilder.GetProviderDesignTimeServices(String provider, Boolean throwOnError)
at Microsoft.EntityFrameworkCore.Design.Internal.DesignTimeServicesBuilder.Build(String provider)
at Microsoft.EntityFrameworkCore.Design.Internal.DatabaseOperations.ScaffoldContextAsync(String provider, String connectionString, String outputDir, String dbContextClassName, IEnumerable`1 schemas, IEnumerable`1 tables, Boolean useDataAnnotations, Boolean overwriteFiles, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.<ScaffoldContextImpl>d__22.MoveNext()
at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source, Int32& length)
at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.<>c__DisplayClass4_0`1.<Execute>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
Unable to find provider assembly with name Microsoft.EntityFrameworkCore.SqlServer. Ensure the specified name is correct and is referenced by the project.
Further technical details
EF Core version: (found in project.json or packages.config) Operating system: Visual Studio version: (e.g. VS 2013 or n/a)
Project.json:
{
"version": "1.0.0-*",
"dependencies": {
"Microsoft.EntityFrameworkCore.Tools": "1.1.0-preview4-final",
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.0",
"Microsoft.EntityFrameworkCore.Design": "1.1.0",
"NETStandard.Library": "1.6.1"
},
"frameworks": {
"netcoreapp1.0": {
},
"netstandard1.6": {
"imports": "dnxcore50"
}
},
"tools": {
"Microsoft.EntityFrameworkCore.Tools.DotNet": "1.0.0-preview3-final"
},
"buildOptions": {
"emitEntryPoint": false,
"preserveCompilationContext": true
}
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:21 (9 by maintainers)
Top Results From Across the Web
Unable to find provider assembly with name Microsoft. ...
Unable to find provider assembly with name Microsoft. ... SqlServer. Ensure the specified name is correct and is referenced by the project.
Read more >Unable to find provider assembly with name Microsoft. ...
SqlServer, I get the error message: "Unable to find provider as. ... Ensure the specified name is correct and is referenced by the...
Read more >The dotnet dbcontext Scaffold ef and ...
Unable to find provider assembly 'Microsoft.EntyFrameworkCore.SqlServer'. Ensure the name is correct and it's referenced by the project.
Read more >Unable to find provider assembly with name Microsoft ...
Unable to find provider assembly with name Microsoft.EntityFrameworkCore.SqlServer. Ensure the specified name is correct and is referenced by the project.
Read more >Unable to find provider assembly with name Microsoft. ...
I was getting this error: Unable to find provider assembly with name Microsoft.EntityFrameworkCore.SqlServer. Ensure the specified name is correct and is ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@rowana16 -
Microsoft.EntityFrameworCore.SqlServer
this is spelling error. The correct name isMicrosoft.EntityFrameworkCore.SqlServer
. I tried your repro steps and upon providing correct provider package name, it works fine.I got this error as well, but… as smitpatel commented on May 15, 2018 that solution worked for me 😃 Have a great night coding 👍