从ASP.NET 5 Beta 4升级到Beta 5 - project.lock.json具有旧值

时间:2015-07-22 12:46:10

标签: visual-studio-2015 asp.net-core asp.net-core-mvc

我已按照步骤从beta 4升级到beta 5:

  • 已安装的Visual Studio 2015 RTM
  • 从PowerShell运行:$ env:DNX_FEED =" https://www.nuget.org/api/v2"
  • 从PowerShell运行:dnvm upgrade
  • 更改了Global.json文件:

    {
        "projects": [ "src", "test" ],
        "sdk": {
            "version": "1.0.0-beta5",
            "runtime": "coreclr",
            "architecture": "x86"
        }
    

    }

  • 将project.json中的所有包更新为Beta 5:

    "dependencies": {
            "EntityFramework.SqlServer": "7.0.0-beta5",
            "EntityFramework.Commands": "7.0.0-beta5",
            "Microsoft.AspNet.Mvc": "6.0.0-beta5",
            "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-beta5",
            "Microsoft.AspNet.Authentication.Cookies": "1.0.0-beta5",
            "Microsoft.AspNet.Authentication.Facebook": "1.0.0-beta5",
            "Microsoft.AspNet.Authentication.Google": "1.0.0-beta5",
            "Microsoft.AspNet.Authentication.MicrosoftAccount": "1.0.0-beta5",
            "Microsoft.AspNet.Authentication.Twitter": "1.0.0-beta5",
            "Microsoft.AspNet.Diagnostics": "1.0.0-beta5",
            "Microsoft.AspNet.Diagnostics.Entity": "7.0.0-beta5",
            "Microsoft.AspNet.Identity.EntityFramework": "3.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",
            "Microsoft.AspNet.Tooling.Razor": "1.0.0-beta5",
            "Microsoft.Framework.Configuration": "1.0.0-beta5",
            "Microsoft.Framework.Configuration.Json": "1.0.0-beta5",
            "Microsoft.Framework.ConfigurationModel.UserSecrets": "1.0.0-beta5",
            "Microsoft.Framework.CodeGenerators.Mvc": "1.0.0-beta5",
            "Microsoft.Framework.Logging": "1.0.0-beta5",
            "Microsoft.Framework.Logging.Console": "1.0.0-beta5",
            "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-beta5",
            "System.IO.FileSystem.Primitives" : "4.0.0-beta-23019",
            "System.IO.FileSystem": "4.0.0-beta-23019",
            "Microsoft.AspNet.Session": "1.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"
    ],
    "scripts": {
        "prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ]
    }
    

    }

在运行NuGet包后,所有这些和代码中的一些更改都没有恢复,并且我的project.lock.json没有旧的Beta4路径。 见附图。

Error

如何强制project.lock.json更新?

这是来自%AppData%/ NuGet / NuGet.Config的NuGet.config: <?xml version="1.0" encoding="utf-8"?> <configuration> <packageRestore> <add key="enabled" value="True" /> <add key="automatic" value="True" /> </packageRestore> <activePackageSource> <add key="nuget.org" value="https://www.nuget.org/api/v2/" /> </activePackageSource> <packageSources> <add key="nuget.org" value="https://www.nuget.org/api/v2/" /> <add key="AspNetVNext" value="https://www.myget.org/F/aspnetvnext/api/v2" /> <add key="NuGet" value="https://nuget.org/api/v2/" /> <add key="NightlyBuilds" value="https://www.myget.org/F/aspnetvnext/" /> </packageSources> </configuration>

1 个答案:

答案 0 :(得分:2)

您的NuGet.config文件(解决方案级别或全局)可能指向错误的NuGet供稿。

执行project.json.lock时会更新dnu restore文件。如果这不起作用,只需删除该文件并运行dnu restore