无法还原Microsoft.Web.Administration

时间:2015-09-07 14:17:46

标签: nuget asp.net-core web-administration

尝试下载并运行演示版asp.net 5应用程序Music Store。 https://github.com/aspnet/MusicStore

>dnu restore

这会导致以下错误:

Restoring packages for E:\Dev\MusicStore\src\MusicStore\project.json
Updating the invalid lock file with dnu restore --lock
  CACHE https://nuget.org/api/v2/
  CACHE https://www.myget.org/F/aspnetmaster/api/v2/
  CACHE https://nuget.org/api/v2/FindPackagesById()?id='Microsoft.IdentityModel.Protocols.OpenIdConnect'
  CACHE https://www.myget.org/F/aspnetmaster/api/v2/FindPackagesById()?id='Microsoft.IdentityModel.Protocols.OpenIdConnect'
Writing lock file E:\Dev\MusicStore\src\MusicStore\project.lock.json
Restore complete, 747ms elapsed
Restoring packages for E:\Dev\MusicStore\src\MusicStore.Spa\project.json
  CACHE https://nuget.org/api/v2/
  CACHE https://www.myget.org/F/aspnetmaster/api/v2/
Writing lock file E:\Dev\MusicStore\src\MusicStore.Spa\project.lock.json
Restore complete, 306ms elapsed
Restoring packages for E:\Dev\MusicStore\test\E2ETests\project.json
  CACHE https://nuget.org/api/v2/
  CACHE https://www.myget.org/F/aspnetmaster/api/v2/
  CACHE https://nuget.org/api/v2/FindPackagesById()?id='Newtonsoft.Json'
  CACHE https://www.myget.org/F/aspnetmaster/api/v2/FindPackagesById()?id='Newtonsoft.Json'
Writing lock file E:\Dev\MusicStore\test\E2ETests\project.lock.json
----------
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\rlang_000\.dnx\packages\Microsoft.Web.Administration\7.0.0.0\Microsoft.Web.Administration.7.0.0.0.nupkg.sh
a512'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES 
secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongP
ath, Boolean checkHost)
   at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)
   at System.IO.File.InternalReadAllText(String path, Encoding encoding, Boolean checkHost)
   at System.IO.File.ReadAllText(String path)
   at Microsoft.Framework.PackageManager.Utils.LockFileUtils.CreateLockFileLibrary(LockFileLibrary previousLibrary, IPackagePathResolver resolver, IPackage package, String correctedPackage
Name)
   at Microsoft.Framework.PackageManager.RestoreCommand.WriteLockFile(LockFile previousLockFile, String projectLockFilePath, Project project, List`1 graphItems, PackageRepository repositor
y, IEnumerable`1 contexts)
   at Microsoft.Framework.PackageManager.RestoreCommand.<RestoreForProject>d__77.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Framework.PackageManager.RestoreCommand.<>c__DisplayClass76_0.<<Execute>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Framework.PackageManager.RestoreCommand.<Execute>d__76.MoveNext()

Project.json

{
  "authors": [
    "Microsoft"
  ],
  "description": "Music store application on ASP.NET 5",
  "version": "1.0.0-*",
  "compilationOptions": {
    "warningsAsErrors": true,
    "define": [
      "DEMO",
      "TESTING"
    ]
  },
  "compile": [
    "../../test/E2ETests/compiler/shared/**/*.cs"
  ],
  "publishExclude": "*.cmd",
  "webroot": "wwwroot",
  "dependencies": {
    "EntityFramework.InMemory": "7.0.0-beta7",
    "EntityFramework.SqlServer": "7.0.0-beta7",
    "Microsoft.AspNet.Server.Kestrel": "1.0.0-beta7",
    "Microsoft.AspNet.Antiforgery": "1.0.0-beta7",
    "Microsoft.AspNet.Authentication.Cookies": "1.0.0-beta7",
    "Microsoft.AspNet.Authentication.Facebook": "1.0.0-beta7",
    "Microsoft.AspNet.Authentication.Google": "1.0.0-beta7",
    "Microsoft.AspNet.Authentication.MicrosoftAccount": "1.0.0-beta7",
    "Microsoft.AspNet.Authentication.OpenIdConnect": "1.0.0-beta7",
    "Microsoft.AspNet.Authentication.Twitter": "1.0.0-beta7",
    "Microsoft.AspNet.Diagnostics": "1.0.0-beta7",
    "Microsoft.AspNet.Diagnostics.Entity": "7.0.0-beta7",
    "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-beta7",
    "Microsoft.AspNet.Mvc": "6.0.0-beta7",
    "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-beta7",
    "Microsoft.AspNet.Server.IIS": "1.0.0-beta7",
    "Microsoft.AspNet.Server.WebListener": "1.0.0-beta7",
    "Microsoft.AspNet.Session": "1.0.0-beta7",
    "Microsoft.AspNet.SignalR.Server": "3.0.0-beta7",
    "Microsoft.AspNet.StaticFiles": "1.0.0-beta7",
    "Microsoft.AspNet.Tooling.Razor": "1.0.0-beta7",
    "Microsoft.Framework.CodeGenerators.Mvc": "1.0.0-beta7",
    "Microsoft.Framework.Configuration.CommandLine": "1.0.0-beta7",
    "Microsoft.Framework.Configuration.EnvironmentVariables": "1.0.0-beta7",
    "Microsoft.Framework.Configuration.Json": "1.0.0-beta7",
    "Microsoft.Framework.Logging.Console": "1.0.0-beta7",
    "Microsoft.Web.Administration": "7.0.0.0"
  },
  "commands": {
    "gen": "Microsoft.Framework.CodeGeneration",
    "kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://localhost:5004",
    "run": "run server.urls=http://localhost:5003",
    "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5002"
  },
  "frameworks": {
    "dnx451": { }
  }
}

dnvm list

Active Version     Runtime Architecture Location                         Alias
------ -------     ------- ------------ --------                         -----
       1.0.0-beta4 clr     x64          C:\Users\rlang_000\.dnx\runtimes      
       1.0.0-beta4 clr     x86          C:\Users\rlang_000\.dnx\runtimes      
       1.0.0-beta4 coreclr x64          C:\Users\rlang_000\.dnx\runtimes      
       1.0.0-beta4 coreclr x86          C:\Users\rlang_000\.dnx\runtimes      
       1.0.0-beta5 clr     x86          C:\Users\rlang_000\.dnx\runtimes      
       1.0.0-beta5 coreclr x64          C:\Users\rlang_000\.dnx\runtimes      
       1.0.0-beta5 coreclr x86          C:\Users\rlang_000\.dnx\runtimes      
       1.0.0-beta6 clr     x86          C:\Users\rlang_000\.dnx\runtimes      
       1.0.0-beta6 coreclr x86          C:\Users\rlang_000\.dnx\runtimes      
  *    1.0.0-beta7 clr     x64          C:\Users\rlang_000\.dnx\runtimes      
       1.0.0-beta7 clr     x86          C:\Users\rlang_000\.dnx\runtimes      

1 个答案:

答案 0 :(得分:1)

  1. 删除C:\Users\rlang_000\.dnx\packages
  2. 删除项目的锁文件
  3. 再次恢复