5

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

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

  • 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

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 :/

If I revert back to beta4 then it works again.

What step am I missing?

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
Snæbjørn
  • 10,322
  • 14
  • 65
  • 124

2 Answers2

8

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.

Run “dnvm upgrade”

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

In your app update your global.json to point to beta5

In global.json point to the specific build of beta5:

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

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"
},

...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);

to this:

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

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.

See also: ASP.NET 5 (vNext) web project: library conflict upgrading from beta4 to beta6

Community
  • 1
  • 1
Shaun Luttin
  • 133,272
  • 81
  • 405
  • 467
  • 1
    Using "beta5-*" instead of just "beta5" did the trick. Thanks – Snæbjørn Jul 03 '15 at 22:17
  • 1
    +1 Wish I saw this post yesterday! Also see: https://github.com/aspnet/Announcements/issues/27 and https://github.com/aspnet/Announcements/issues/33 which were issues for me but in fact just look here: https://github.com/aspnet/Announcements/issues – Reafidy Jul 04 '15 at 01:33
  • 1
    That `-*` syntax is called "floating the versions." David Fowl writes about it here http://davidfowl.com/diagnosing-dependency-issues-with-asp-net-5/ – Shaun Luttin Jul 04 '15 at 01:33
  • 1
    @davidfowl Thanks for the edits. I appreciate them and yet don't understand. Why remove the specific build from `global.json`? Why remove the floating build from `project.json`? I'm feel particularly confused because the edits were only to the code samples but not to the matching instructions. The result *seems* to be that the instructions no longer match their examples. What am I missing? In `global.json`, are we not supposed to point to a specific build? In `project.json`, are we not supposed to use a floating build version (as in the example) or are we to use one (as in the instructions?) – Shaun Luttin Jul 04 '15 at 15:08
  • 2
    1.0.0-beta5 came out. That's the last version of beta5. There's no need to specify build numbers or floating versions. It's meaningless. – davidfowl Jul 04 '15 at 17:13
  • @davidfowl That makes sense. Thank you. Will using the floating build numbers still be relevant for `beta6` until MS releases it? I suspect so but would like to confirm. – Shaun Luttin Jul 04 '15 at 19:02
  • 2
    Yep! You got it! As an aside, the reason you want to remove the -* when the actual beta comes out is because we do some weirdness when we deploy to NuGet.org to make it easy to install official versions. When we publish to nuget.org, we remove build numbers. This means that 1.0.0-beta5-{somebuild} > 1.0.0-beta5, this isn't great but it makes it easier to find the right version of the package. – davidfowl Jul 04 '15 at 19:04
  • @davidfowl Should we delete the specific build versions once MS releases a beta to NuGet.org. I.e. should the original poster delete `\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta5-12103` now that `beta5` is out? – Shaun Luttin Jul 04 '15 at 19:12
  • 2
    Nah that doesn't really matter so much. It would reduce noise but it's harmless for the most part. – davidfowl Jul 04 '15 at 19:15
1

@Shaun Luttin has it covered but I will mention two things:

  • Browser Link does not actually work in Beta 5. It causes a very strange error. You need to comment out app.UseBrowserlink() to get things working. Later versions have fixed this issue.
  • I also found that the packages with 'ConfigurationModel' in the name were renamed to 'Configuration'.
Muhammad Rehan Saeed
  • 35,627
  • 39
  • 202
  • 311