Open freshe opened 7 years ago
The issue is present also on VS2017 RTM
@bricelam this has been fixed for the upcoming release, hasn't it?
No idea. It sounds like Web.config
(or maybe it should be App.config
in ASP.NET Core projects) isn't getting loaded at runtime.
Or it isn't present (which would explain why installing EF6 into the web app makes it work)
The problem is that EntityFramework.SqlServer.dll is not referenced/copied to the bin folder. Which it did prior to VS2017. Thats why it works to nuget in EF to the web project. I don't know if that is a EF issue or a VS issue though.
That sounds like the classic MSBuild issue that's been plaguing us for years: It doesn't copy transitive dependencies unless they are explicitly referenced in the dependent the assembly. The best way to work around this issue is to use NuGet's new MSBuild PackageReference items instead of packages.config
in your DAL project. See their NuGet PackageReference in Visual Studio Project Files article.
Thank you!
"At present, package references are supported in Visual Studio 2017 only, for .NET Core projects, .NET Standard projects".
Replacing my DAL (.NET Framework Class Library) project with a .NET Standard Class Library project and setting TargetFramework to net461 worked. Now using PackageReference instead of packages.config
From NuGet is now fully integrated into MSBuild:
We are hard at work to bring full PackageReference support to these project types. Our goal is to eventually make PackageReference the default and move away from all other formats.
Not sure if this is the right place for this.
I have a ASP.NET Core web project that references a business layer, that references a data layer. The data layer is a .NET 4.6.2 project with EF 6x. [Web (aspnetcore)] --> [BLL (aspnetcore)] --> [DAL (net46)]
This works fine in VS2015/project.json world.
The VS2017 migration went well without errors. I get this error when running the project.
"InvalidOperationException: No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient' Make sure the provider is registered in the 'entityFramework' section of the application config file"
Installing EF6 in my web project solves the problem but that is obviously not a solution.
Advice is appreciated!