EntityFrameworkCore does not exist - VS2017 - UWP

entity-framework-core visual-studio-2017

Question

I just installed VS2017 Enterprise, attempted to create blank UWP project. Then I added a class derived from DbContext

using Microsoft.EntityFrameworkCore;

namespace Test
{
    public class TestContext : DbContext
    {
    }
}

The compiler does not like the simple class above and complained that:

Severity    Code    Description Project File    Line    Suppression State
Error   CS0234  The type or namespace name 'EntityFrameworkCore' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

Although I did install the sqlite package

Install-Package Microsoft.EntityFrameworkCore.Sqlite

And the installation was successful.

What have I missed? Maybe I need to add reference to a dll but which dll should I use?

Update: I tried to install-package Microsoft.EntityFrameworkCore (the main package) as suggested but it seems to be incompatible.

supports: netstandard2.0 (.NETStandard,Version=v2.0)
At line:1 char:1
+ Install-Package Microsoft.EntityFrameworkCore
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Install-Package : Package Microsoft.EntityFrameworkCore 2.0.1 is not compatible with uap10.0.10240 (UAP,Version=v10.0.10240) / win10-arm. Package 
Microsoft.EntityFrameworkCore 2.0.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
At line:1 char:1
+ Install-Package Microsoft.EntityFrameworkCore
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Install-Package : Package Microsoft.EntityFrameworkCore 2.0.1 is not compatible with uap10.0.10240 (UAP,Version=v10.0.10240) / win10-arm-aot. Package 
Microsoft.EntityFrameworkCore 2.0.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
At line:1 char:1
+ Install-Package Microsoft.EntityFrameworkCore
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Install-Package : Package Microsoft.EntityFrameworkCore 2.0.1 is not compatible with uap10.0.10240 (UAP,Version=v10.0.10240) / win10-x64. Package 
Microsoft.EntityFrameworkCore 2.0.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
At line:1 char:1
+ Install-Package Microsoft.EntityFrameworkCore
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Install-Package : Package Microsoft.EntityFrameworkCore 2.0.1 is not compatible with uap10.0.10240 (UAP,Version=v10.0.10240) / win10-x64-aot. Package 
Microsoft.EntityFrameworkCore 2.0.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
At line:1 char:1
+ Install-Package Microsoft.EntityFrameworkCore
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Install-Package : Package Microsoft.EntityFrameworkCore 2.0.1 is not compatible with uap10.0.10240 (UAP,Version=v10.0.10240) / win10-x86. Package 
Microsoft.EntityFrameworkCore 2.0.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
At line:1 char:1
+ Install-Package Microsoft.EntityFrameworkCore
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Install-Package : Package Microsoft.EntityFrameworkCore 2.0.1 is not compatible with uap10.0.10240 (UAP,Version=v10.0.10240) / win10-x86-aot. Package 
Microsoft.EntityFrameworkCore 2.0.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
At line:1 char:1
+ Install-Package Microsoft.EntityFrameworkCore
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Install-Package : Package restore failed. Rolling back package changes for 'TestEntityFW'.
At line:1 char:1
+ Install-Package Microsoft.EntityFrameworkCore
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
1
0
1/18/2018 7:48:05 PM

Accepted Answer

You must install also main package of EF Core

Install-Package Microsoft.EntityFrameworkCore

Microsoft.EntityFrameworkCore.Sqlite is only db provider package for Entity Framework Core like for example Microsoft.EntityFrameworkCore.SqlServer.

0
1/18/2018 12:35:15 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow