【问题标题】:K ef command gives "k : System.Exception: Unable to locate project.json "K ef 命令给出“k : System.Exception: Unable to locate project.json”
【发布时间】:2015-06-10 04:03:42
【问题描述】:

当我尝试添加迁移时,“k”给了我以下错误:

k : System.Exception: Unable to locate project.json
At line:1 char:1
+ k web
+ ~~~~~
+ CategoryInfo          : NotSpecified: (System.Exceptio...te project.json:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError

bij Microsoft.Framework.Runtime.DefaultHost.Initialize(DefaultHostOptions options, IServiceProvider hostServices)
bij Microsoft.Framework.Runtime.DefaultHost..ctor(DefaultHostOptions options, IService
Provider hostServices)
bij Microsoft.Framework.ApplicationHost.Program.Main(String[] args)

这是我的 global.json:

{
"projects": [ "src", "FoodDelivery" ],
"sdk": {
    "version": "1.0.0-beta4"
    }
}

我有以下目录结构

FoodPick
FoodPick/src
FoodPick/src/FoodDelivery
FoodPick/src/FoodDelivery/project.json
FoodPick/src/FoodShare
FoodPick/artifacts
FoodPick/global.json

我想从 FoodDelivery 项目执行 k ef 迁移添加,其中包含一个 project.json

这是 project.json 的内容。

或者,我通过命令控制台 (cmd.exe) 执行命令。以下是我收到的错误。

这是我在运行 kpm restore 时收到的错误

PM> kpm restore
Restoring packages for D:\Projects\Visual Studio\Foodpick\src\AddressLookup\project.json
  CACHE http://default-nuget.azurewebsites.net/nuget/FindPackagesById()?Id='EntityFramework.SqlServer'
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='EntityFramework.SqlServer'.
  CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?Id='EntityFramework.SqlServer'
  CACHE http://default-nuget.azurewebsites.net/nuget/FindPackagesById()?Id='EntityFramework.Commands'
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='EntityFramework.Commands'.
  CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?Id='EntityFramework.Commands'
  CACHE http://default-nuget.azurewebsites.net/nuget/FindPackagesById()?Id='Microsoft.AspNet.Mvc'
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Mvc'.
  CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Mvc'
  CACHE http://default-nuget.azurewebsites.net/nuget/FindPackagesById()?Id='Microsoft.AspNet.Mvc.TagHelpers'
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Mvc.TagHelpers'.
  CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Mvc.TagHelpers'
  CACHE http://default-nuget.azurewebsites.net/nuget/FindPackagesById()?Id='Microsoft.AspNet.Authentication.Cookies'
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Authentication.Cookies'.
  GET https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Authentication.Cookies'.
  CACHE http://default-nuget.azurewebsites.net/nuget/FindPackagesById()?Id='Microsoft.AspNet.Authentication.Facebook'
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Authentication.Facebook'.
  CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Authentication.Facebook'
  CACHE http://default-nuget.azurewebsites.net/nuget/FindPackagesById()?Id='Microsoft.AspNet.Authentication.Google'
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Authentication.Google'.
  GET https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Authentication.Google'.
  CACHE http://default-nuget.azurewebsites.net/nuget/FindPackagesById()?Id='Microsoft.AspNet.Authentication.MicrosoftAccount'
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Authentication.MicrosoftAccount'.
  GET https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Authentication.MicrosoftAccount'.
  CACHE http://default-nuget.azurewebsites.net/nuget/FindPackagesById()?Id='Microsoft.AspNet.Authentication.Twitter'
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Authentication.Twitter'.
  GET https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Authentication.Twitter'.
  CACHE http://default-nuget.azurewebsites.net/nuget/FindPackagesById()?Id='Microsoft.AspNet.Diagnostics'
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Diagnostics'.
  GET https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Diagnostics'.
  CACHE http://default-nuget.azurewebsites.net/nuget/FindPackagesById()?Id='Microsoft.AspNet.Diagnostics.Entity'
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Diagnostics.Entity'.
  CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Diagnostics.Entity'
  CACHE http://default-nuget.azurewebsites.net/nuget/FindPackagesById()?Id='Microsoft.AspNet.Identity.EntityFramework'
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Identity.EntityFramework'.
  GET https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Identity.EntityFramework'.
  CACHE http://default-nuget.azurewebsites.net/nuget/FindPackagesById()?Id='Microsoft.AspNet.Server.IIS'
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Server.IIS'.
  GET https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Server.IIS'.
  CACHE http://default-nuget.azurewebsites.net/nuget/FindPackagesById()?Id='Microsoft.AspNet.Server.WebListener'
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Server.WebListener'.
  CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Server.WebListener'
  CACHE http://default-nuget.azurewebsites.net/nuget/FindPackagesById()?Id='Microsoft.AspNet.StaticFiles'
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.StaticFiles'.
  CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?Id='Microsoft.AspNet.StaticFiles'
  CACHE http://default-nuget.azurewebsites.net/nuget/FindPackagesById()?Id='Microsoft.AspNet.Tooling.Razor'
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Tooling.Razor'.
  GET https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Tooling.Razor'.
  CACHE http://default-nuget.azurewebsites.net/nuget/FindPackagesById()?Id='Microsoft.Framework.ConfigurationModel.Json'
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.Framework.ConfigurationModel.Json'.
  GET https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?Id='Microsoft.Framework.ConfigurationModel.Json'.
  CACHE http://default-nuget.azurewebsites.net/nuget/FindPackagesById()?Id='Microsoft.Framework.ConfigurationModel.UserSecrets'
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.Framework.ConfigurationModel.UserSecrets'.
  GET https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?Id='Microsoft.Framework.ConfigurationModel.UserSecrets'.
  CACHE http://default-nuget.azurewebsites.net/nuget/FindPackagesById()?Id='Microsoft.Framework.CodeGenerators.Mvc'
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.Framework.CodeGenerators.Mvc'.
  GET https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?Id='Microsoft.Framework.CodeGenerators.Mvc'.
  CACHE http://default-nuget.azurewebsites.net/nuget/FindPackagesById()?Id='Microsoft.Framework.Logging'
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.Framework.Logging'.
  GET https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?Id='Microsoft.Framework.Logging'.
  CACHE http://default-nuget.azurewebsites.net/nuget/FindPackagesById()?Id='Microsoft.Framework.Logging.Console'
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.Framework.Logging.Console'.
  GET https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?Id='Microsoft.Framework.Logging.Console'.
  CACHE http://default-nuget.azurewebsites.net/nuget/FindPackagesById()?Id='Microsoft.VisualStudio.Web.BrowserLink.Loader'
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.VisualStudio.Web.BrowserLink.Loader'.
  GET https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?Id='Microsoft.VisualStudio.Web.BrowserLink.Loader'.
Warning: FindPackagesById: Microsoft.AspNet.Authentication.Facebook
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
Warning: FindPackagesById: Microsoft.AspNet.Mvc.TagHelpers
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
Warning: FindPackagesById: EntityFramework.Commands
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
Warning: FindPackagesById: Microsoft.AspNet.Authentication.Google
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
Warning: FindPackagesById: EntityFramework.SqlServer
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
Warning: FindPackagesById: Microsoft.AspNet.Authentication.Twitter
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='EntityFramework.Commands'.
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='EntityFramework.SqlServer'.
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Authentication.Twitter'.
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Authentication.Google'.
Warning: FindPackagesById: Microsoft.AspNet.Authentication.Cookies
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
Warning: FindPackagesById: Microsoft.AspNet.Diagnostics
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
Warning: FindPackagesById: Microsoft.AspNet.Mvc
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Authentication.Cookies'.
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Mvc'.
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Diagnostics'.
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Authentication.Facebook'.
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Mvc.TagHelpers'.
Warning: FindPackagesById: Microsoft.AspNet.Authentication.MicrosoftAccount
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Authentication.MicrosoftAccount'.
Warning: FindPackagesById: Microsoft.AspNet.Identity.EntityFramework
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
Warning: FindPackagesById: Microsoft.AspNet.Diagnostics.Entity
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
Warning: FindPackagesById: Microsoft.Framework.ConfigurationModel.Json
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
Warning: FindPackagesById: Microsoft.AspNet.Tooling.Razor
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
Warning: FindPackagesById: Microsoft.AspNet.StaticFiles
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
Warning: FindPackagesById: Microsoft.AspNet.Server.WebListener
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.StaticFiles'.
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.Framework.ConfigurationModel.Json'.
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Identity.EntityFramework'.
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Server.WebListener'.
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Diagnostics.Entity'.
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Tooling.Razor'.
Warning: FindPackagesById: Microsoft.AspNet.Authentication.Google
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Authentication.Google'.
Warning: FindPackagesById: EntityFramework.SqlServer
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='EntityFramework.SqlServer'.
Warning: FindPackagesById: Microsoft.AspNet.Authentication.Cookies
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Authentication.Cookies'.
Warning: FindPackagesById: Microsoft.AspNet.Mvc.TagHelpers
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Mvc.TagHelpers'.
Warning: FindPackagesById: Microsoft.AspNet.Mvc
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Mvc'.
Warning: FindPackagesById: Microsoft.AspNet.Authentication.Twitter
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
Warning: FindPackagesById: Microsoft.AspNet.Authentication.Facebook
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Authentication.Twitter'.
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Authentication.Facebook'.
Warning: FindPackagesById: Microsoft.AspNet.Authentication.MicrosoftAccount
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Authentication.MicrosoftAccount'.
Warning: FindPackagesById: Microsoft.AspNet.Server.IIS
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Server.IIS'.
Warning: FindPackagesById: Microsoft.AspNet.Diagnostics
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Diagnostics'.
Warning: FindPackagesById: Microsoft.Framework.CodeGenerators.Mvc
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
Warning: FindPackagesById: Microsoft.Framework.Logging.Console
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.Framework.CodeGenerators.Mvc'.
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.Framework.Logging.Console'.
Warning: FindPackagesById: Microsoft.Framework.ConfigurationModel.Json
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
Error: FindPackagesById: EntityFramework.SqlServer
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
Warning: FindPackagesById: Microsoft.AspNet.Identity.EntityFramework
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
Warning: FindPackagesById: Microsoft.VisualStudio.Web.BrowserLink.Loader
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
----------
Warning: FindPackagesById: Microsoft.AspNet.Diagnostics.Entity
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Identity.EntityFramework'.
Warning: FindPackagesById: Microsoft.AspNet.StaticFiles
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
Warning: FindPackagesById: Microsoft.AspNet.Server.WebListener
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
Error: FindPackagesById: Microsoft.AspNet.Authentication.Cookies
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.AspNet.Server.WebListener'.
Warning: FindPackagesById: Microsoft.Framework.Logging
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (One of the request inputs is out of range.).
   bij System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
   bij Microsoft.Framework.PackageManager.Restore.NuGet.HttpSource.<GetAsync>d__6.MoveNext()
--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden ---
   bij System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bij System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   bij Microsoft.Framework.PackageManager.Restore.NuGet.NuGetv2Feed.<FindPackagesByIdAsyncCore>d__21.MoveNext()
--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden ---
   bij System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bij Microsoft.Framework.PackageManager.RemoteWalkProvider.<FindLibrary>d__6.MoveNext()
--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden ---
   bij System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bij Microsoft.Framework.PackageManager.RestoreOperations.<FindLibrary>d__9.MoveNext()
--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden ---
   bij System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bij System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   bij Microsoft.Framework.PackageManager.RestoreOperations.<FindLibraryByVersion>d__8.MoveNext()
--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden ---
   bij System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bij System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   bij Microsoft.Framework.PackageManager.RestoreOperations.<FindLibraryMatch>d__6.MoveNext()
--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden ---
   bij System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bij Microsoft.Framework.PackageManager.RestoreOperations.<FindLibraryEntry>d__5.MoveNext()
--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden ---
   bij System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bij Microsoft.Framework.PackageManager.RestoreOperations.<CreateGraphNode>d__2.MoveNext()
--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden ---
   bij System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bij System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   bij Microsoft.Framework.PackageManager.RestoreOperations.<CreateGraphNode>d__2.MoveNext()
--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden ---
   bij System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bij System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   bij Microsoft.Framework.PackageManager.RestoreCommand.<RestoreForProject>d__62.MoveNext()
--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden ---
   bij System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bij Microsoft.Framework.PackageManager.RestoreCommand.<ExecuteCommand>d__61.MoveNext()
----------
Restore failed
Response status code does not indicate success: 400 (One of the request inputs is out of range.).
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.Framework.Logging'.
Warning: FindPackagesById: Microsoft.Framework.ConfigurationModel.UserSecrets
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
  GET https://api.nuget.org/v3/index.json/FindPackagesById()?Id='Microsoft.Framework.ConfigurationModel.Json'.
Error: FindPackagesById: Microsoft.AspNet.Authentication.Google
  Response status code does not indicate success: 400 (One of the request inputs is out of range.).
Error: FindPackagesById: 

现在我读到当前命令,而不是“k ef migration add the_migration_name”,是“dnvm ef migration add the_migration_name”

dnvm 已经安装,但是命令不起作用(如果这是要走的路)...

我想知道可能出了什么问题,并帮助我进一步寻求:p

【问题讨论】:

  • 问题是它无法find文件。换句话说,文件不在它正在寻找的地方。 (提示:不太可能在您的源代码树中查找文件......因为您的源代码树不太可能在运行时存在。)
  • 现在可能很愚蠢。但我使用包管理器控制台并选择 src\FoodDelivery 作为默认项目。然后我使用“k ef”,它找不到文件。我在某处读到 global.json 中的错误可能是导致此问题的原因(这就是我添加它的原因)。但我不明白为什么它找不到文件......它就在那里:p。该命令不是在运行时与项目一起执行,而是在开发期间执行。

标签: asp.net-mvc asp.net-core


【解决方案1】:

自 beta4 以来,已经进行了一些重命名:

  • k -> dnx
  • kpm -> dnu
  • kvm -> dnvm

如果您仍有一些旧应用程序,请编辑PATH 环境变量并删除与.k 相关的任何内容

【讨论】:

    【解决方案2】:

    正确使用的命令是:

    dnx . ef migration add initial //NEW & working through cmd.exe in the projects directory 
    
    k ef migration add //OLD -- DO NOT USE -- Doesn't work anymore
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-09-29
      • 2018-10-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-30
      • 1970-01-01
      相关资源
      最近更新 更多