简体   繁体   English

Microsoft.NETCore.App中的EntityFramework

[英]EntityFramework in Microsoft.NETCore.App

Tried to use the Entityframework in a .netCore console application with project.json 试图用的EntityFramework与.netCore控制台应用程序project.json

{
  "version": "1.0.0-*",
  "buildOptions": {
    "emitEntryPoint": true
  },

    "dependencies": {
        "Microsoft.EntityFrameworkCore": "1.0.0-rc2-final",
        "Microsoft.NETCore.App": {
            "type": "platform",
            "version": "1.0.0-rc2-3002702"
        }
    },

  "frameworks": {
    "netcoreapp1.0": {
      "imports": "dnxcore50"
    }
  }
}

Unfortunately these packages do not work together: 不幸的是,这些软件包不能一起使用:

NU1002 The dependency Remotion.Linq 2.0.2 does not support framework .NETCoreApp,Version=v1.0. NU1002依赖项Remotion.Linq 2.0.2不支持框架.NETCoreApp,Version = v1.0。

NU1002 The dependency Ix-Async 1.2.5 does not support framework .NETCoreApp,Version=v1.0. NU1002依赖关系Ix-Async 1.2.5不支持框架.NETCoreApp,Version = v1.0。

Does someone know how to use the entity framework in .net Core console applications? 有人知道如何在.net Core控制台应用程序中使用实体框架吗?

Microsoft.EntityFrameworkCore in version 1.0.0-rc2-final uses Remotion.Linq 2.0.2 which (in that version) does not support the netstandard/netcoreapp target framework monikers yet. 1.0.0-rc2-final版本中的Microsoft.EntityFrameworkCore使用Remotion.Linq 2.0.2 ,该版本(在该版本中)尚不支持netstandard/netcoreapp目标框架netstandard/netcoreapp However it supports the portable class library combination portable-net45+win+wpa81+wp80 which can be imported using the imports statement in the above project.json. 但是,它支持可移植类库组合portable-net45+win+wpa81+wp80 ,可以使用上述project.json中的imports语句将其imports The same is true for the deprecated Ix-Async and the portable class library portable-windows8+net45+wp8 . 对于已弃用的Ix-Async和可移植类库portable-windows8+net45+wp8 Read the rc2 samples of entity framework carefully, they surely import a portable class library target framework moniker. 仔细阅读实体框架的rc2示例,他们肯定会导入可移植类库目标框架的绰号。

However, I highly recommend to upgrade to the current .NET Core version (RTM). 但是, 我强烈建议升级到当前的.NET Core版本(RTM)。 .NET Core and Entity Framework Core in the above versions are all release candidates and not the final version. 上述版本中的.NET Core和Entity Framework Core都是发行候选版本,而不是最终版本。 RC2 had a go-live license but that will expire (IMHO) like 3 months after the next go-live or final release. RC2拥有上线许可证,但将在下一个上线或最终版本发布3个月后过期(IMHO)。 Further, Remotion.Linq supports the netstandard then and the Ix-Async was repackaged as System.Interactive.Async and also supports netstandard . 此外, Remotion.Linq然后支持netstandard ,并且Ix-Async被重新打包为System.Interactive.Async ,还支持netstandard Therefore, your problem would vanish. 因此,您的问题将消失。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 找不到应用程序依赖项清单 (Microsoft.NETCore.App.deps.json) 中指定的程序集 - An assembly specified in the application dependencies manifest (Microsoft.NETCore.App.deps.json) was not found C#EntityFramework .NETCore 2.0多对多 - C# EntityFramework .NETCore 2.0 Many-to-Many Microsoft EntityFramework Core CLI 安装 - nuget 异常 - Microsoft EntityFramework Core CLI install - nuget exception Json响应不包含所有导航属性EntityFramework Core和ASP .NETCore Web API - Json response does not contain all the navigation properties EntityFramework Core and ASP .NETCore Web API Package Microsoft.EntityFramework.Core 6.0.0 与 netcoreapp 3.1 不兼容 - Package Microsoft.EntityFramework.Core 6.0.0 is not compatible with netcoreapp 3.1 Azure Web App 中 EntityFramework Core 的连接字符串 - Connection String for EntityFramework Core in Azure Web App 使用 Microsoft.EntityFramework.Sqlite.Core 插入标识 - Insert Identity using Microsoft.EntityFramework.Sqlite.Core 使用entityframework core登录asp.net core app - Sign In in asp.net core app with entityframework core 实体类型 &#39;Microsoft.AspNet.Identity.EntityFramework.IdentityUserLogin<string> &#39; 需要定义一个键 - The entity type 'Microsoft.AspNet.Identity.EntityFramework.IdentityUserLogin<string>' requires a key to be defined EF-Core Update-Database命令失败(无法从Microsoft.EntityFramework.Design 2.1.4.0加载类型) - EF-Core Update-Database command fails (cannot load type from Microsoft.EntityFramework.Design 2.1.4.0)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM