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