更新到ASP NET 5 beta5会破坏一切 [英] Updating to ASP NET 5 beta5 breaks everything

查看:98
本文介绍了更新到ASP NET 5 beta5会破坏一切的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在更新到beta5时,我遵循了本指南,并且更新过程似乎已经奏效.

I followed this guide when updating to beta5 and the update process seems to have worked.

http://blogs .msdn.com/b/webdev/archive/2015/06/30/asp-net-5-beta5-now-available.aspx

要更新到ASP.NET 5 Beta5,请使用以下步骤:

To update to ASP.NET 5 Beta5 use the following steps:

  • 如果尚未安装.NET版本管理器(DNVM)(它已随Visual Studio 2015 RC预先安装),则可以 获取最新版本)
  • 在命令提示符下,将DNX_FEED环境变量设置为 https://www.nuget.org/api/v2
  • 运行"dnvm升级",在您的应用程序中更新global.json以指向beta版本的.NET执行环境(DNX)
  • 您的project.json也指向beta5软件包版本
  • 运行"dnu restore"运行"dnu build"并将代码迁移到所需的beta5
  • Install the .NET Version Manager (DNVM) if you don’t already have it (it comes preinstalled with Visual Studio 2015 RC, or you can get the latest version)
  • From a command prompt set the DNX_FEED environment variable to https://www.nuget.org/api/v2
  • Run "dnvm upgrade" In your app update your global.json to point to beta5 version of the .NET Execution Environment (DNX)
  • Also your project.json to point to the beta5 package versions
  • Run "dnu restore" Run "dnu build" and migrate your code to beta5 s needed

但是,我遇到构建错误,提示我缺少程序集.它抱怨System.Void,而这样的东西丢失了.它还无法从Microsoft.AspNet.MVC中找到Controller:/

However I'm getting build errors that says I have missing assemblies. It complains about System.Void and such is missing. It also can't find Controller from Microsoft.AspNet.MVC :/

如果我恢复为beta4,则它将再次正常工作.

If I revert back to beta4 then it works again.

我错过了哪一步?

DNVM列表(已还原为beta4)

DNVM list (this is reverted back to beta4)

Active Version           Runtime Architecture Location                      Ali
                                                                            as
------ -------           ------- ------------ --------                      ---
       1.0.0-beta4       clr     x64          C:\Users\MySelf\.dnx\runtimes
  *    1.0.0-beta4       clr     x86          C:\Users\MySelf\.dnx\runtimes
       1.0.0-beta4       coreclr x64          C:\Users\MySelf\.dnx\runtimes
       1.0.0-beta4       coreclr x86          C:\Users\MySelf\.dnx\runtimes
       1.0.0-beta5       clr     x86          C:\Users\Myself\.dnx\runtimes def
       1.0.0-beta5-12103 clr     x86          C:\Users\MySelf\.dnx\runtimes

推荐答案

我刚刚将Visual Studio 2015 ASP.MVC Web应用程序从beta4升级到beta5,现在可以运行它了.这是您遵循的说明的一些补充.

I just upgraded a Visual Studio 2015 ASP.MVC Web Application from beta4 to beta5 and now have it running. Here are some additions to the instructions that you followed.

执行完此操作后,将输出dnvm list.

After doing that, this is what dnvm list will output.

Active Version           Runtime Architecture Location                       Alias
------ -------           ------- ------------ --------                       -----
       1.0.0-beta4       clr     x64          C:\Users\BigFont\.dnx\runtimes
       1.0.0-beta4       clr     x86          C:\Users\BigFont\.dnx\runtimes
       1.0.0-beta4       coreclr x64          C:\Users\BigFont\.dnx\runtimes
       1.0.0-beta4       coreclr x86          C:\Users\BigFont\.dnx\runtimes
  *    1.0.0-beta5       clr     x86          C:\Users\BigFont\.dnx\runtimes default
       1.0.0-beta5-12087 clr     x86          C:\Users\BigFont\.dnx\runtimes

在您的应用中,更新您的global.json以指向beta5

global.json 指向beta5的特定版本:

{
    "projects": [ "src", "test" ],
    "sdk": {
        "version": "1.0.0-beta5"
    }
}

您的project.json也指向beta5软件包版本

project.json 参考beta5.这将使dnu恢复最新的版本(好吧,有点-David Fowl在这里描述了浮动版本"的细微差别.)

Also your project.json to point to the beta5 package versions

In project.json reference beta5. That will make dnu restore the most recent build (well, kinda - David Fowl describes the nuances of the "floating version" here.)

"dependencies": {
  "Microsoft.AspNet.Server.IIS": "1.0.0-beta5",
  "Microsoft.AspNet.Server.WebListener": "1.0.0-beta5",
  "Microsoft.AspNet.StaticFiles": "1.0.0-beta5"
},

...根据需要将代码迁移到beta5

一旦停止接收到有关缺少基本对象(如System.Void)的错误,则可能会收到有关中断更改的错误.这可能需要一些研究来解决,具体取决于您的代码库使用什么.例如,如果您使用的是ASP.NET Identity,则需要更改以下内容:

...migrate your code to beta5 as needed

Once you've stopped received errors about missing fundamental objects like System.Void, you might receive errors about breaking changes. This could take some research to solve, depending on what your code base uses. For instance, if you're using ASP.NET Identity, you'll need to change this:

SignInManager.PasswordSignInAsync(
    model.Email, model.Password, model.RememberMe, shouldLockout: false);

对此:

SignInManager.PasswordSignInAsync(
    model.Email, model.Password, model.RememberMe, lockoutOnFailure: false);

最终注释:Visual Studio

在更新global.jsonpackage.json文件之后,在Visual Studio中关闭并重新打开该解决方案可以解决还原/生成问题.

Final note re: Visual Studio

Closing and reopening the solution in Visual Studio can resolve restore/build problems after updating global.json and package.json files.

另请参阅: ASP.NET 5(vNext)Web项目:库冲突从beta4升级到beta6

这篇关于更新到ASP NET 5 beta5会破坏一切的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆