当我使用命令
时dnx ef
发生以下错误:
C:\ Users \ Livio \ OneDrive \ Informatik \ Websites \ HomeNetwork \ src \ HomeNetwork.API> dnx ef System.ArgumentNullException:值不能为null。 参数名称:appEnv at Microsoft.Data.Entity.Utilities.Check.NotNull [T](T value,String parameterName) 在Microsoft.Data.Entity.Commands.Program..ctor(IServiceProvider> serviceProvider,IApplicationEnvironment appEnv,ILibraryManager libraryManager,> IRuntimeEnvironment runtimeEnv)
我正在使用dnvm 1.0.0-beta8 coreclr x86。
我的project.json看起来像这样(在HomeNetwork.API中)
{
"webroot": "wwwroot",
"version": "1.0.0-*",
"dependencies": {
"Microsoft.AspNet.Mvc": "6.0.0-beta5",
"Microsoft.AspNet.Server.IIS": "1.0.0-beta5",
"Microsoft.AspNet.Server.WebListener": "1.0.0-beta5",
"Microsoft.AspNet.StaticFiles": "1.0.0-beta5",
"EntityFramework.SqlServer": "7.0.0-beta5",
"EntityFramework.Commands": "7.0.0-beta5"
},
"commands": {
"web": "Microsoft.AspNet.Hosting --config hosting.ini",
"ef": "EntityFramework.Commands"
},
"frameworks": {
"dnx451": { },
"dnxcore50": { }
},
"exclude": [
"wwwroot",
"node_modules",
"bower_components"
],
"publishExclude": [
"node_modules",
"bower_components",
"**.xproj",
"**.user",
"**.vspscc"
]
}
我在没有编辑代码的情况下创建了这个项目,期望添加EF7依赖项。
答案 0 :(得分:1)
我正在使用dnvm 1.0.0-beta8 coreclr x86。
然后,您应该使用beta8版本的依赖项:
"dependencies": {
"Microsoft.AspNet.Mvc": "6.0.0-beta8",
"Microsoft.AspNet.Server.IIS": "1.0.0-beta8",
"Microsoft.AspNet.Server.WebListener": "1.0.0-beta8",
"Microsoft.AspNet.StaticFiles": "1.0.0-beta8",
"EntityFramework.SqlServer": "7.0.0-beta8",
"EntityFramework.Commands": "7.0.0-beta8"
}