我在向我的Asp.Net 5项目添加Entity Framework 7后尝试执行初始迁移.我关注这个
documentation.
在我的project.json中我指定了:
"commands": { "web": "Microsoft.AspNet.Server.Kestrel","ef": "EntityFramework.Commands" },"frameworks": { "dnxcore50": { } }
我试图通过命令提示符在项目目录中执行以下命令:
dnx ef migrations add MyFirstMigration
但是我收到以下错误:
system.invalidOperationException: The current runtime target framework
is not compatible with ProjectName. The current runtime target
framework: ‘DNX,Version=v 4.5.1(dnx451) Please make sure the runtime
matches a framework specified in project.json.
奇怪的是我的project.json肯定是针对dnxcore50.我还检查了global.json:
{ "projects": [ "src","test" ],"sdk": { "version": "1.0.0-beta8","architecture": "x86","runtime": "coreclr" } }
我的包依赖项都引用了beta8:
"dependencies": { "EntityFramework.Commands": "7.0.0-beta8","EntityFramework.Core": "7.0.0-beta8","EntityFramework.sqlServer": "7.0.0-beta8","Hl7.Fhir.DSTU2": "0.90.2","Microsoft.AspNet.Authentication.Cookies": "1.0.0-beta8","Microsoft.AspNet.Authentication.OpenIdConnect": "1.0.0-beta8","Microsoft.AspNet.Diagnostics": "1.0.0-beta8","Microsoft.AspNet.IISPlatformHandler": "1.0.0-beta8","Microsoft.AspNet.Mvc": "6.0.0-beta8","Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-beta8","Microsoft.AspNet.Server.Kestrel": "1.0.0-beta8","Microsoft.AspNet.StaticFiles": "1.0.0-beta8","Microsoft.AspNet.Tooling.Razor": "1.0.0-beta8","Microsoft.Dnx.Runtime": "1.0.0-beta8","Microsoft.Framework.Configuration.Json": "1.0.0-beta8","Microsoft.Framework.Configuration.UserSecrets": "1.0.0-beta8","Microsoft.Framework.Logging": "1.0.0-beta8","Microsoft.Framework.Logging.Console": "1.0.0-beta8","Microsoft.Framework.Logging.Debug": "1.0.0-beta8","Microsoft.VisualStudio.Web.browserLink.Loader": "14.0.0-beta8" }
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。