New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notes about my own experience migrating from RC1 to RC2 #1381

Closed
Bartmax opened this Issue Apr 7, 2016 · 74 comments

Comments

Projects
None yet
@Bartmax

Bartmax commented Apr 7, 2016

@davidfowl asked me for notes so here they are. You may want to scroll down to the pain points section below :)

Migration RC1 to RC2

Easy/expected changes:

Tools

install RC2 tooling.
The lastest tools can be found here: https://github.com/dotnet/cli
We first started with https://dotnet.github.io/getting-started/ but it's outdated.

global.json

Update version of global.json to match RC2

"version": "1.0.0-rc1-update1" // BEFORE
"version": "1.0.0-rc2-20221" // AFTER

Nuget.config

add ci builds to nuget config

<add key="AspNetCiDev" value="https://www.myget.org/F/aspnetcidev/api/v3/index.json" />

project.json

Dependencies

Update all dependencies from Microsoft.AspNet.xxx to Microsoft.AspNetCore.xxx except Microsoft.AspNet.WebApi.Client

Update all dependencies from x.EntityFramework.x to x.EntityFrameworkCore.x
Downgrade version to 1.0 on all dependencies renamed.

Some package rename were by hand because it wasn't a straight convention,
Microsoft.AspNetCore.Diagnostics.Entity
Microsoft.EntityFrameworkCore.SqlServer

Some low-impact packages were removed:
Microsoft.VisualStudio.Web.BrowserLink.Loader

External dependency Moq changed package name

"Moq": "", // BEFORE
"moq.netcore": "4.4.0-beta8", // AFTER

Frameworks

Update TFM. This change was a complete copy paste of some sample code. We had no idea what this change means.
before:

  "frameworks": {
    "dnx451": { },
    "dnxcore50": { }
  },

after:

  "frameworks": {
    "netcoreapp1.0": {
      "imports": [ "dnxcore50", "portable-net45+win8" ]
    }
  },

Code Changes

NOTE: BEFORE code may contain AspNetCore
because of the initial rename of all using directive.

Usings

Rename all using directives in *.cs, *.cshtml
Find all and replace: using Microsoft.AspNet. -> using Microsoft.AspNetCore.
About 122 occurrence(s).

Controllers

HttpNotFound // BEFORE 60 ocurrences
NotFound // AFTER 

HttpBadRequest() // BEFORE 5 ocurrences
BadRequest() // AFTER 

Entity Framework

GraphBehavior.X does not exist anymore on EF context methods.

using Microsoft.AspNetCore.Identity.EntityFramework; // BEFORE 2 ocurrences
using Microsoft.AspNetCore.Identity.EntityFrameworkCore; // AFTER

using Microsoft.Data.Entity; // BEFORE 40 ocurrences
using Microsoft.EntityFrameworkCore; // AFTER

using Microsoft.Data.Entity.Metadata; // BEFORE 35 ocurrences
using Microsoft.EntityFrameworkCore.Metadata; // AFTER

using Microsoft.Data.Entity.Migrations; // BEFORE 47 ocurrences
using Microsoft.EntityFrameworkCore.Migrations; // AFTER

using Microsoft.Data.Entity.Infrastructure; // BEFORE 24 ocurrences
using Microsoft.EntityFrameworkCore.Infrastructure; // AFTER

_context.Phones.Add(phone, GraphBehavior.IncludeDependents); // SAMPLE
_context.Phones.Add(phone); // SAMPLE AFTER

Extensions

using Microsoft.AspNetCore.FileProviders; // AFTER 3 ocurrences
using Microsoft.Extensions.FileProviders; // BEFORE

using Microsoft.Extensions.OptionsModel; // BEORE 1 ocurrences
using Microsoft.Extensions.Options; // AFTER

Identity

User.GetUserId() and User.IsSignedIn() doesn't exist. it was removed and added to UserManager and SignInManager.

ExternalLoginInfo.ExternalPrincipal was renamed to ExternalLoginInfo.Principal

User.GetUserId() // BEFORE 6 ocurrences
_userManager.GetUserId(User) // AFTER

User.IsSignedIn() // BEFORE 2 ocurrences
_signInManager.IsSignedIn(User) // AFTER

info.ExternalPrincipal // BEFORE
info.Principal // AFTER

Startup

services.AddEntityFramework()
                .AddSqlServer() // BEFORE

services.AddEntityFrameworkSqlServer()
                .AddEntityFrameworkSqlServer() // AFTER

services.AddCaching(); // NOT FOUND ??? REMOVED 
app.UseDatabaseErrorPage(); // NOT FOUND ??? REMOVED

app.UseRequestLocalization(
    new RequestCulture(
        new CultureInfo("en-us"))); // BEFORE
app.UseRequestLocalization(
    new RequestLocalizationOptions() { 
        DefaultRequestCulture = new RequestCulture(
            new CultureInfo("en-us")) }); // AFTER

app.UseIISPlatformHandler(options => options.AuthenticationDescriptions.Clear()); // NEED MORE INVESTIGATION. OPTIONS REMOVED.

This change is a complete copy/paste from sample. No idea what's going on here.

// Entry point for the application. BEFORE
        public static void Main(string[] args) => WebApplication.Run<Startup>(args);

// Entry point for the application. AFTER
        public static void Main(string[] args)
        {
            var host = new WebHostBuilder()
                        .UseKestrel()
                        .UseContentRoot(Directory.GetCurrentDirectory())
                        .UseDefaultHostingConfiguration(args)
                        .UseIIS()
                        .UseStartup<Startup>()
                        .Build();

            host.Run();
        }

## Pain points: ### DotNet Restore

This was executed multiple times, at different point of migration.
Mostly all the output was kinda useless. Too much information, to many unknowns.
We tried to switch to -v warning with no luck.
It took some time to get to -v Minimal to get a usefull output from dotnet restore.

App Settings

We found a runtime Error with regarding appsettings. The error was clear, the options available not.
The fix was to change Verbose to Information

"Logging": {
    "IncludeScopes": false,
    "LogLevel": {
      "Default": "Information", // BEFORE: "Verbose"
      "System": "Information",
      "Microsoft": "Information"
    }
  }

We used POCO Configuration with code like:

services.Configure<StorageSettings>(Configuration.GetSection("StorageSettings"));

we dig into lots of documents, code, issues.
We hope this would be on Announcements repo but we couldn't find it.
we ended up with a hack

services.Configure<StorageSettings>(x => x.ConnectionString = Configuration["StorageSettings:ConnectionString"]);

Code

Some inner workings of razor,views,engines,etc changes weren't mentioned anywhere.
We have a simple taghelper that render partial views, this was impossible to figure out how to update it.
NTaylorMullen helped there.

Compile success!

Great, right... right?

Environment

Visual Studio environment variable wasn't respected. We first thought that ConfigureDevelopment were removed.
The problem here was that dotnet run shows the enviroment but an error was throw before.
Also this environment variable was changed twice for RC2. The announcement issue shows the old one with a note at the bottom that was changed again.
We wasted lot of time dealing with environment. mostly because of not understading the problem straight.

cshtml

@Inject namespaces had to be renamed,
taghelpers, etc.
because this was after hitting a specific page it was more painful than the cs code.
we also lost intellisense so... we had to rely on error messages.

tooling

We literally copy pasted every tooling sample until we got this:

  "tools": {
    "dotnet-publish-iis": "1.0.0-*",
    "dotnet-ef": "1.0.0-*",
    "dotnet-watch": "1.0.0-*",
    "dotnet-razor-tooling": "1.0.0-*"
  },

We still have no idea how those exactly works.
The only one that was really needed was EF because migrations (see next point).
We tried for several hours to get dotnet-watch to run without success.

EF Changes

I hit this issue: Invalid object name 'TableName'
before an announcement were created here:
EF Core: Table names now taken from DbSet names (starting in RC2).

While it was a simple ask repo and got a solution very quickly, it was like a neverending error trip.
At this point we were tired.

... And runs! ..., almost

we hit the web application but we seen no static files served!
DAMN!
We looked everywhere until we figure out that no gulp build was executed! even we had that on prepublish.
and well.. then

it worked.

@Bartmax

This comment has been minimized.

Show comment
Hide comment
@Bartmax

Bartmax Apr 7, 2016

just remember one undocumented note:
i deleted .dnx folder at some point and app stopped working.
it was fixed with dnvm install/upgrade

not sure exactly what was the problem... and don't remember clearly.

Bartmax commented Apr 7, 2016

just remember one undocumented note:
i deleted .dnx folder at some point and app stopped working.
it was fixed with dnvm install/upgrade

not sure exactly what was the problem... and don't remember clearly.

@Bartmax

This comment has been minimized.

Show comment
Hide comment
@Bartmax

Bartmax Apr 7, 2016

one more undocumented note:

IFormFile.SaveAsync was removed because it was impossible to test. aspnet/HttpAbstractions#610

We added what we found on old source code:

public static class FormFileExtensions
    {
        private static int DefaultBufferSize = 80 * 1024;
        /// <summary>
        /// Asynchronously saves the contents of an uploaded file.
        /// </summary>
        /// <param name="formFile">The <see cref="IFormFile"/>.</param>
        /// <param name="filename">The name of the file to create.</param>
        public async static Task SaveAsAsync(
            this IFormFile formFile,
            string filename,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            if (formFile == null)
            {
                throw new ArgumentNullException(nameof(formFile));
            }

            using (var fileStream = new FileStream(filename, FileMode.Create))
            {
                var inputStream = formFile.OpenReadStream();
                await inputStream.CopyToAsync(fileStream, DefaultBufferSize, cancellationToken);
            }
        }
    }

Bartmax commented Apr 7, 2016

one more undocumented note:

IFormFile.SaveAsync was removed because it was impossible to test. aspnet/HttpAbstractions#610

We added what we found on old source code:

public static class FormFileExtensions
    {
        private static int DefaultBufferSize = 80 * 1024;
        /// <summary>
        /// Asynchronously saves the contents of an uploaded file.
        /// </summary>
        /// <param name="formFile">The <see cref="IFormFile"/>.</param>
        /// <param name="filename">The name of the file to create.</param>
        public async static Task SaveAsAsync(
            this IFormFile formFile,
            string filename,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            if (formFile == null)
            {
                throw new ArgumentNullException(nameof(formFile));
            }

            using (var fileStream = new FileStream(filename, FileMode.Create))
            {
                var inputStream = formFile.OpenReadStream();
                await inputStream.CopyToAsync(fileStream, DefaultBufferSize, cancellationToken);
            }
        }
    }
@josh-sachs

This comment has been minimized.

Show comment
Hide comment
@josh-sachs

josh-sachs Apr 7, 2016

Nice feedback. What was your experience with EntityFramework tooling after upgrading? Are you able to do migrations/scaffolding and everything as expected? I hit a roadblock with "ef dbcontext scaffold" and had to revert back to the DEC 2015 builds of RC2 but maybe I'm an anomaly.

josh-sachs commented Apr 7, 2016

Nice feedback. What was your experience with EntityFramework tooling after upgrading? Are you able to do migrations/scaffolding and everything as expected? I hit a roadblock with "ef dbcontext scaffold" and had to revert back to the DEC 2015 builds of RC2 but maybe I'm an anomaly.

@Bartmax

This comment has been minimized.

Show comment
Hide comment
@Bartmax

Bartmax Apr 7, 2016

@kudoz83 I had no issues, i just did 1 migration dotnet ef migrations add ... and went back to rc1 because of not being able to save and refresh.

Bartmax commented Apr 7, 2016

@kudoz83 I had no issues, i just did 1 migration dotnet ef migrations add ... and went back to rc1 because of not being able to save and refresh.

@cvs79

This comment has been minimized.

Show comment
Hide comment
@cvs79

cvs79 Apr 7, 2016

Any problems using VS2015. Any tooling or debugging issues you ran into. Or does the Asp.net RC1 tooling installer still work.

cvs79 commented Apr 7, 2016

Any problems using VS2015. Any tooling or debugging issues you ran into. Or does the Asp.net RC1 tooling installer still work.

@Bartmax

This comment has been minimized.

Show comment
Hide comment
@Bartmax

Bartmax Apr 7, 2016

@cvs79 no tooling for you sir. They are working on the tooling side, but those weren't released yet. Most notably Intellisense on razor pages is broken :(

Bartmax commented Apr 7, 2016

@cvs79 no tooling for you sir. They are working on the tooling side, but those weren't released yet. Most notably Intellisense on razor pages is broken :(

@NenessNC

This comment has been minimized.

Show comment
Hide comment
@NenessNC

NenessNC Apr 7, 2016

Thanks for the complete nice feedback. I was planning to migrate my own project from RC1 to RC2, this will help me for sure!

NenessNC commented Apr 7, 2016

Thanks for the complete nice feedback. I was planning to migrate my own project from RC1 to RC2, this will help me for sure!

@Lutando

This comment has been minimized.

Show comment
Hide comment
@Lutando

Lutando Apr 8, 2016

This is good.
Also the ASPNET_ENV/Hosting:Environment moniker has changed to ASPNETCORE_ENVIRONMENT

Lutando commented Apr 8, 2016

This is good.
Also the ASPNET_ENV/Hosting:Environment moniker has changed to ASPNETCORE_ENVIRONMENT

@RobDeVoer

This comment has been minimized.

Show comment
Hide comment
@RobDeVoer

RobDeVoer Apr 8, 2016

I am enjoying the positive vibe here. Have no active projects and some time on my hands so let me know if anyone needs me to try anything out and offer feedback.

RobDeVoer commented Apr 8, 2016

I am enjoying the positive vibe here. Have no active projects and some time on my hands so let me know if anyone needs me to try anything out and offer feedback.

@tuespetre

This comment has been minimized.

Show comment
Hide comment
@tuespetre

tuespetre Apr 19, 2016

Added "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0-rc2-*" to our project.json to get the 'POCO configuration binding' extension methods back.

tuespetre commented Apr 19, 2016

Added "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0-rc2-*" to our project.json to get the 'POCO configuration binding' extension methods back.

@Bartmax

This comment has been minimized.

Show comment
Hide comment
@Bartmax

Bartmax Apr 19, 2016

@tuespetre thank you! I'll give it a try!

Bartmax commented Apr 19, 2016

@tuespetre thank you! I'll give it a try!

@nil4

This comment has been minimized.

Show comment
Hide comment
@nil4

nil4 Apr 20, 2016

@tuespetre I am using the Microsoft.Extensions.Configuration.Binder package to get the binder extension methods. I could not find Microsoft.Extensions.Options.ConfigurationExtensions on the aspnetcirelease feed; are you sure that's the right package name?

nil4 commented Apr 20, 2016

@tuespetre I am using the Microsoft.Extensions.Configuration.Binder package to get the binder extension methods. I could not find Microsoft.Extensions.Options.ConfigurationExtensions on the aspnetcirelease feed; are you sure that's the right package name?

@tuespetre

This comment has been minimized.

Show comment
Hide comment
@tuespetre

tuespetre Apr 20, 2016

I don't know about aspnetcirelease, but it is there on aspnetvnext and aspnetcidev.

tuespetre commented Apr 20, 2016

I don't know about aspnetcirelease, but it is there on aspnetvnext and aspnetcidev.

@Cowlephant

This comment has been minimized.

Show comment
Hide comment
@Cowlephant

Cowlephant Apr 21, 2016

What's going to be easier for me in the long run... updating now in this sort of tumultuous state from RC1, or waiting a while?

Cowlephant commented Apr 21, 2016

What's going to be easier for me in the long run... updating now in this sort of tumultuous state from RC1, or waiting a while?

@Bartmax

This comment has been minimized.

Show comment
Hide comment
@Bartmax

Bartmax Apr 21, 2016

@twilliamsgsnetx if you use Visual Studio, wait a few more days...

if you use VS Code i guess it's ok to update now.

just my personal opinion. It's always up to you to balance the pro/cons.

Bartmax commented Apr 21, 2016

@twilliamsgsnetx if you use Visual Studio, wait a few more days...

if you use VS Code i guess it's ok to update now.

just my personal opinion. It's always up to you to balance the pro/cons.

@Cowlephant

This comment has been minimized.

Show comment
Hide comment
@Cowlephant

Cowlephant Apr 21, 2016

Yeah I have a site currently in production that is using many aspecst... mvc, identity, entity. And I am using Visual Studio as well. I'll give it a shot.

Cowlephant commented Apr 21, 2016

Yeah I have a site currently in production that is using many aspecst... mvc, identity, entity. And I am using Visual Studio as well. I'll give it a shot.

@Cowlephant

This comment has been minimized.

Show comment
Hide comment
@Cowlephant

Cowlephant Apr 22, 2016

Well I worked out all the hundreds of errors. @Bartmax guide really helped in some areas. Others required some researching. This really helped me for tons of the errors regarding System.RunTime

aspnet/dnx#2334

Doesn't actually seem to want to run however... so still some more research to be done. Just spins and spins. I'm actually currently on 1.0.0-rc3-20550

When trying to dotnet run

Unhandled Exception: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested etrieve the LoaderExceptions property for more information. at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) at System.Reflection.RuntimeAssembly.get_DefinedTypes() at Microsoft.AspNetCore.Hosting.Internal.ServerLoader.ResolveServerFactoryType(String assemblyName) at Microsoft.AspNetCore.Hosting.WebHostBuilder.BuildHostingServices() at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build() at DataPlatform.Startup.Main(String[] args) in C:\Github\Data-Platform\src\DataPlatform\Startup.cs:line 124

Cowlephant commented Apr 22, 2016

Well I worked out all the hundreds of errors. @Bartmax guide really helped in some areas. Others required some researching. This really helped me for tons of the errors regarding System.RunTime

aspnet/dnx#2334

Doesn't actually seem to want to run however... so still some more research to be done. Just spins and spins. I'm actually currently on 1.0.0-rc3-20550

When trying to dotnet run

Unhandled Exception: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested etrieve the LoaderExceptions property for more information. at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) at System.Reflection.RuntimeAssembly.get_DefinedTypes() at Microsoft.AspNetCore.Hosting.Internal.ServerLoader.ResolveServerFactoryType(String assemblyName) at Microsoft.AspNetCore.Hosting.WebHostBuilder.BuildHostingServices() at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build() at DataPlatform.Startup.Main(String[] args) in C:\Github\Data-Platform\src\DataPlatform\Startup.cs:line 124

@dodyg

This comment has been minimized.

Show comment
Hide comment
@dodyg

dodyg Apr 26, 2016

Wait there's already an RC3 build? I still cannot manage to migrate to RC2 from RC1

I got

 error CS7069: Reference to type 'IFormFile' claims it is defined in 'Microsoft.AspNetCore.Http.Abstractions', but it could not be found

dodyg commented Apr 26, 2016

Wait there's already an RC3 build? I still cannot manage to migrate to RC2 from RC1

I got

 error CS7069: Reference to type 'IFormFile' claims it is defined in 'Microsoft.AspNetCore.Http.Abstractions', but it could not be found
@guardrex

This comment has been minimized.

Show comment
Hide comment
@guardrex

guardrex Apr 26, 2016

@dodyg No, there is no RC3 build; however, there are RC3 packages. The word on the street is that there will not be an RC3 release at all; this is merely being done to hold packages under development but that need to be kept off of RC2 stabilization for RC2 release. They get pulled into your app depending on which feeds you're using. If you stick with the CI Release feed right now, you will only get RC2 packages even when you make your deps -* (as opposed to having to -rc2-* them). If you want to use other feeds with RC3 packages on them but limit dependencies to RC2, then go with -rc2-* versions.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <clear />
    <add key="AspNetCI" value="https://www.myget.org/F/aspnetcirelease/api/v3/index.json" />
    <add key="NuGet.org" value="https://api.nuget.org/v3/index.json" />
</configuration>

guardrex commented Apr 26, 2016

@dodyg No, there is no RC3 build; however, there are RC3 packages. The word on the street is that there will not be an RC3 release at all; this is merely being done to hold packages under development but that need to be kept off of RC2 stabilization for RC2 release. They get pulled into your app depending on which feeds you're using. If you stick with the CI Release feed right now, you will only get RC2 packages even when you make your deps -* (as opposed to having to -rc2-* them). If you want to use other feeds with RC3 packages on them but limit dependencies to RC2, then go with -rc2-* versions.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <clear />
    <add key="AspNetCI" value="https://www.myget.org/F/aspnetcirelease/api/v3/index.json" />
    <add key="NuGet.org" value="https://api.nuget.org/v3/index.json" />
</configuration>
@dodyg

This comment has been minimized.

Show comment
Hide comment
@dodyg

dodyg Apr 27, 2016

Thanks for the tips. Let me try this migration thing one more time.

dodyg commented Apr 27, 2016

Thanks for the tips. Let me try this migration thing one more time.

@VSG24

This comment has been minimized.

Show comment
Hide comment
@VSG24

VSG24 Apr 27, 2016

Well...I think I'm not gonna update to RC2 anytime soon!

VSG24 commented Apr 27, 2016

Well...I think I'm not gonna update to RC2 anytime soon!

@MaximRouiller

This comment has been minimized.

Show comment
Hide comment
@MaximRouiller

MaximRouiller Apr 27, 2016

Well... to be fair... RC2 is still "in-development" and is still not stable with the new dotnet-cli.

Even the team itself had trouble creating a "working experience" a few weeks ago with all the pieces.

If you want to be in the meat grinder and see how the sausage is made? Try RC2! You'll find full of issues and help the team improve ASP.NET by finding bugs and everything. That's what "devbuild" and "nightlies" are for.

Just want to build software on something stable? Back to RC1. 😃

MaximRouiller commented Apr 27, 2016

Well... to be fair... RC2 is still "in-development" and is still not stable with the new dotnet-cli.

Even the team itself had trouble creating a "working experience" a few weeks ago with all the pieces.

If you want to be in the meat grinder and see how the sausage is made? Try RC2! You'll find full of issues and help the team improve ASP.NET by finding bugs and everything. That's what "devbuild" and "nightlies" are for.

Just want to build software on something stable? Back to RC1. 😃

@dodyg

This comment has been minimized.

Show comment
Hide comment
@dodyg

dodyg Apr 27, 2016

What would this be in the RC 2

 "frameworks": {
        "dnx451": {
            "frameworkAssemblies": {
                "System.ComponentModel": "4.0.0.0"
            }
        }
    },

I want to target .NET 4.5/4.6. I am using packages that only work on Windows.

dodyg commented Apr 27, 2016

What would this be in the RC 2

 "frameworks": {
        "dnx451": {
            "frameworkAssemblies": {
                "System.ComponentModel": "4.0.0.0"
            }
        }
    },

I want to target .NET 4.5/4.6. I am using packages that only work on Windows.

@dodyg

This comment has been minimized.

Show comment
Hide comment
@dodyg

dodyg Apr 27, 2016

Now I hit this bug NuGet/Home#2644

dodyg commented Apr 27, 2016

Now I hit this bug NuGet/Home#2644

@dodyg

This comment has been minimized.

Show comment
Hide comment
@dodyg

dodyg Apr 28, 2016

OK I fixed NuGet/Home#2644 by adding imports statement.

  "tools": {
    "dotnet-publish-iis": { 
        "version": "1.0.0-*",
        "imports":["portable-net40+sl5+win8+wp8+wpa81"]
    },
    "dotnet-ef": { 
        "version": "1.0.0-*",
        "imports":["portable-net40+sl5+win8+wp8+wpa81"]
    },
    "dotnet-watch": { 
        "version": "1.0.0-*",
        "imports":["portable-net40+sl5+win8+wp8+wpa81"]
    },
    "dotnet-razor-tooling": { 
        "version": "1.0.0-*",
        "imports":["portable-net40+sl5+win8+wp8+wpa81"]
    }
  },

dodyg commented Apr 28, 2016

OK I fixed NuGet/Home#2644 by adding imports statement.

  "tools": {
    "dotnet-publish-iis": { 
        "version": "1.0.0-*",
        "imports":["portable-net40+sl5+win8+wp8+wpa81"]
    },
    "dotnet-ef": { 
        "version": "1.0.0-*",
        "imports":["portable-net40+sl5+win8+wp8+wpa81"]
    },
    "dotnet-watch": { 
        "version": "1.0.0-*",
        "imports":["portable-net40+sl5+win8+wp8+wpa81"]
    },
    "dotnet-razor-tooling": { 
        "version": "1.0.0-*",
        "imports":["portable-net40+sl5+win8+wp8+wpa81"]
    }
  },
@dodyg

This comment has been minimized.

Show comment
Hide comment
@dodyg

dodyg Apr 28, 2016

I got it to compile yay! until I hit this aspnet/EntityFrameworkCore#5076 and this aspnet/Announcements#167

dodyg commented Apr 28, 2016

I got it to compile yay! until I hit this aspnet/EntityFrameworkCore#5076 and this aspnet/Announcements#167

@dodyg

This comment has been minimized.

Show comment
Hide comment
@dodyg

dodyg Apr 28, 2016

Now I got this problem regarding TagHelpers

     Connection id "0HKRFAFEBCLGM": An unhandled exception was thrown by the application.
Microsoft.AspNetCore.Mvc.Razor.Compilation.CompilationFailedException: One or more compilation failures occurred:
Error @ (164:5,17)(31) - [Cannot resolve TagHelper containing assembly 'Microsoft.AspNet.Mvc.TagHelpers'. Error: Could not load file or assembly 'Microsoft.AspNet.Mvc.TagHelpers' or one of its dependencies. The system cannot find the file specified.] (5,17) Cannot resolve TagHelper containing assembly 'Microsoft.AspNet.Mvc.TagHelpers'. Error: Could not load file or assembly 'Microsoft.AspNet.Mvc.TagHelpers' or one of its dependencies. The system cannot find the file specified.

I fixed it by changing

@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"

to

@addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers"

from _ViewImports.cshtml

I GOT IT WORKING!!! At least a home page. 🎆 🎆 🎆 😂

dodyg commented Apr 28, 2016

Now I got this problem regarding TagHelpers

     Connection id "0HKRFAFEBCLGM": An unhandled exception was thrown by the application.
Microsoft.AspNetCore.Mvc.Razor.Compilation.CompilationFailedException: One or more compilation failures occurred:
Error @ (164:5,17)(31) - [Cannot resolve TagHelper containing assembly 'Microsoft.AspNet.Mvc.TagHelpers'. Error: Could not load file or assembly 'Microsoft.AspNet.Mvc.TagHelpers' or one of its dependencies. The system cannot find the file specified.] (5,17) Cannot resolve TagHelper containing assembly 'Microsoft.AspNet.Mvc.TagHelpers'. Error: Could not load file or assembly 'Microsoft.AspNet.Mvc.TagHelpers' or one of its dependencies. The system cannot find the file specified.

I fixed it by changing

@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"

to

@addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers"

from _ViewImports.cshtml

I GOT IT WORKING!!! At least a home page. 🎆 🎆 🎆 😂

@smbecker

This comment has been minimized.

Show comment
Hide comment
@smbecker

smbecker Apr 28, 2016

I was making good progress on my own upgrade until I hit dotnet/cli@2429: Object reference not set to an instance of an object. No luck getting around it yet.

smbecker commented Apr 28, 2016

I was making good progress on my own upgrade until I hit dotnet/cli@2429: Object reference not set to an instance of an object. No luck getting around it yet.

@dodyg

This comment has been minimized.

Show comment
Hide comment
@dodyg

dodyg commented Apr 28, 2016

This is my project.json http://pastebin.com/KTrXnFSX

@moozzyk

This comment has been minimized.

Show comment
Hide comment
@moozzyk

moozzyk Apr 28, 2016

@dodyg - you seem to be using tools so you may want take a look at this announcement: aspnet/Announcements#172

moozzyk commented Apr 28, 2016

@dodyg - you seem to be using tools so you may want take a look at this announcement: aspnet/Announcements#172

@dodyg

This comment has been minimized.

Show comment
Hide comment
@dodyg

dodyg Apr 29, 2016

What is the dotnet command that allows to run an aspnet project with a certain HostingEnvironment variable?

dotnet run runs my project in production environment.

My Main is

        public static void Main(string[] args)
        {        
              var host = new WebHostBuilder()
                        .UseKestrel()
                        .UseContentRoot(Directory.GetCurrentDirectory())
                        .UseStartup<Startup>()
                        .Build();

            host.Run();
        }

What I want to get is the edit code and refresh functionality that existed on RC1.

dodyg commented Apr 29, 2016

What is the dotnet command that allows to run an aspnet project with a certain HostingEnvironment variable?

dotnet run runs my project in production environment.

My Main is

        public static void Main(string[] args)
        {        
              var host = new WebHostBuilder()
                        .UseKestrel()
                        .UseContentRoot(Directory.GetCurrentDirectory())
                        .UseStartup<Startup>()
                        .Build();

            host.Run();
        }

What I want to get is the edit code and refresh functionality that existed on RC1.

@smbecker

This comment has been minimized.

Show comment
Hide comment
@smbecker

smbecker Apr 29, 2016

I think environment has always been based on an environment variable. So you would have to set ASPNETCORE_ENVIRONMENT before running.

smbecker commented Apr 29, 2016

I think environment has always been based on an environment variable. So you would have to set ASPNETCORE_ENVIRONMENT before running.

@dodyg

This comment has been minimized.

Show comment
Hide comment
@dodyg

dodyg Apr 29, 2016

The problem is that dotnet run does not seem to pick up the profile.

{
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:49948/",
      "sslPort": 0
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "sdkVersion": "dnx-clr-win-x64.1.0.0-rc2-16595"
    },
    "web": {
      "commandName": "web",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "sdkVersion": "dnx-clr-win-x64.1.0.0-rc2-16595"
    }
  }
}

dodyg commented Apr 29, 2016

The problem is that dotnet run does not seem to pick up the profile.

{
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:49948/",
      "sslPort": 0
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "sdkVersion": "dnx-clr-win-x64.1.0.0-rc2-16595"
    },
    "web": {
      "commandName": "web",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "sdkVersion": "dnx-clr-win-x64.1.0.0-rc2-16595"
    }
  }
}
@dodyg

This comment has been minimized.

Show comment
Hide comment
@dodyg

dodyg Apr 29, 2016

Found it

public static void Main(string[] args)
        {
              var host = new WebHostBuilder()
                        .UseKestrel()
                        .UseEnvironment("Development")
                        .UseContentRoot(Directory.GetCurrentDirectory())
                        .UseStartup<Startup>()
                        .Build();

            host.Run();
        }

The problem is the edit and refresh is still not working - it will investigate dotnet watch

dodyg commented Apr 29, 2016

Found it

public static void Main(string[] args)
        {
              var host = new WebHostBuilder()
                        .UseKestrel()
                        .UseEnvironment("Development")
                        .UseContentRoot(Directory.GetCurrentDirectory())
                        .UseStartup<Startup>()
                        .Build();

            host.Run();
        }

The problem is the edit and refresh is still not working - it will investigate dotnet watch

@dodyg

This comment has been minimized.

Show comment
Hide comment
@dodyg

dodyg Apr 29, 2016

I hit this one with dotnet watch aspnet/DotNetTools#88

dodyg commented Apr 29, 2016

I hit this one with dotnet watch aspnet/DotNetTools#88

@dodyg

This comment has been minimized.

Show comment
Hide comment
@dodyg

dodyg Apr 29, 2016

What is the new procedure on hosting with IIS ? dotnet publish does not exactly publish the files properly for a web app.

dotnet publish-iis returns

Expected to load hostpolicy.dll from [C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.0-rc2-3002520]
This may be because the targeted framework ["Microsoft.NETCore.App": "1.0.0-rc2-3002520"] was not found.

dodyg commented Apr 29, 2016

What is the new procedure on hosting with IIS ? dotnet publish does not exactly publish the files properly for a web app.

dotnet publish-iis returns

Expected to load hostpolicy.dll from [C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.0-rc2-3002520]
This may be because the targeted framework ["Microsoft.NETCore.App": "1.0.0-rc2-3002520"] was not found.
@guardrex

This comment has been minimized.

Show comment
Hide comment
@guardrex

guardrex Apr 29, 2016

@dodyg I'm working on the new guidance today. You can see a draft of it here: https://github.com/GuardRex/Docs/blob/master/aspnet/publishing/iis.rst ... that should help. The Troubleshooting bits are being developed here: aspnet/Docs#1140 (comment)

dotnet publish (perhaps better stated as dotnet publish --configuration Release since it defaults to "Debug") will produce outputs for a portable application that requires you to install .NET Core on the server for it to run. Therefore, you will not see an executable in the publish folder outputs. If you mod the app with an RID (runtime id) and mod the dep for Microsoft.NETCore.App and drop the "type": "platform", you can publish with dotnet publish --configuration Release --runtime <RID> and get a self-contained app that will have an executable. You can learn more at: https://github.com/blackdwarf/core-docs/blob/clidocs/docs/core-concepts/app-types.md

guardrex commented Apr 29, 2016

@dodyg I'm working on the new guidance today. You can see a draft of it here: https://github.com/GuardRex/Docs/blob/master/aspnet/publishing/iis.rst ... that should help. The Troubleshooting bits are being developed here: aspnet/Docs#1140 (comment)

dotnet publish (perhaps better stated as dotnet publish --configuration Release since it defaults to "Debug") will produce outputs for a portable application that requires you to install .NET Core on the server for it to run. Therefore, you will not see an executable in the publish folder outputs. If you mod the app with an RID (runtime id) and mod the dep for Microsoft.NETCore.App and drop the "type": "platform", you can publish with dotnet publish --configuration Release --runtime <RID> and get a self-contained app that will have an executable. You can learn more at: https://github.com/blackdwarf/core-docs/blob/clidocs/docs/core-concepts/app-types.md

@dodyg

This comment has been minimized.

Show comment
Hide comment
@dodyg

dodyg Apr 29, 2016

@guardrex thanks but I think my problem is more mundane. I am targeting net451 because I rely on some .NET 4.6 library.

The problem is I can't even get dotnet publish-iis to work with this net451 TFM #1381 (comment)

dodyg commented Apr 29, 2016

@guardrex thanks but I think my problem is more mundane. I am targeting net451 because I rely on some .NET 4.6 library.

The problem is I can't even get dotnet publish-iis to work with this net451 TFM #1381 (comment)

@dodyg

This comment has been minimized.

Show comment
Hide comment
@dodyg

dodyg Apr 29, 2016

Let's try this again 😄

Adding Microsoft.NETCore.App generates torrents of error message (This is the project.json file http://pastebin.com/sFHCnC62) for my net451 target.

These are the error messages http://pastebin.com/pLLvPn6q.

Microsoft.NETCore.App relies on some packages that are not compatible with net451.

The question is what kind of TFM can I use instead of net45.

When I tried to use .netstandard1.5, it generates the following errors:

Errors in E:\labs\crucible\trunk\crucible.web\project.json
    Package CommonMark.NET 0.11.0 is not compatible with netstandard1.5 (.NETStandard,Version=v1.5). Package CommonMark.NET 0.11.0 supports:
      - dnxcore50 (DNXCore,Version=v5.0)
      - net20 (.NETFramework,Version=v2.0)
      - net35-client (.NETFramework,Version=v3.5,Profile=Client)
      - net40-client (.NETFramework,Version=v4.0,Profile=Client)
      - net45 (.NETFramework,Version=v4.5)
      - portable-net40+sl5+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile328)
      - portable-net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile259)
    Package Nustache 1.15.3.7 is not compatible with netstandard1.5 (.NETStandard,Version=v1.5). Package Nustache 1.15.3.7 supports: net20 (.NETFramework,Version=v2.0)
    Package Microsoft.Dnx.Compilation.CSharp.Common 1.0.0-rc2-20221 is not compatible with netstandard1.5 (.NETStandard,Version=v1.5). Package Microsoft.Dnx.Compilation.CSharp.Common 1.0.0-rc2-20221 supports:
      - dotnet5.4 (.NETPlatform,Version=v5.4)
      - net451 (.NETFramework,Version=v4.5.1)
    Package Microsoft.Dnx.Compilation.CSharp.Abstractions 1.0.0-rc2-20221 is not compatible with netstandard1.5 (.NETStandard,Version=v1.5). Package Microsoft.Dnx.Compilation.CSharp.Abstractions 1.0.0-rc2-20221 supports:
      - dotnet5.4 (.NETPlatform,Version=v5.4)
      - net451 (.NETFramework,Version=v4.5.1)
    Package Microsoft.Extensions.PlatformAbstractions.Dnx 1.0.0-rc2-20221 is not compatible with netstandard1.5 (.NETStandard,Version=v1.5). Package Microsoft.Extensions.PlatformAbstractions.Dnx 1.0.0-rc2-20221 supports:
      - dotnet5.4 (.NETPlatform,Version=v5.4)
      - net451 (.NETFramework,Version=v4.5.1)
    Package Newtonsoft.Json 8.0.3 is not compatible with netstandard1.5 (.NETStandard,Version=v1.5). Package Newtonsoft.Json 8.0.3 supports:
      - net20 (.NETFramework,Version=v2.0)
      - net35 (.NETFramework,Version=v3.5)
      - net40 (.NETFramework,Version=v4.0)
      - net45 (.NETFramework,Version=v4.5)
      - portable-dnxcore50+net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=net45+wp80+win8+wpa81+dnxcore50)
      - portable-net40+sl5+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile328)
    Package Ix-Async 1.2.5 is not compatible with netstandard1.5 (.NETStandard,Version=v1.5). Package Ix-Async 1.2.5 supports:
      - net40 (.NETFramework,Version=v4.0)
      - net45 (.NETFramework,Version=v4.5)
      - portable-net45+win8+wp8 (.NETPortable,Version=v0.0,Profile=Profile78)
    Package Remotion.Linq 2.0.2 is not compatible with netstandard1.5 (.NETStandard,Version=v1.5). Package Remotion.Linq 2.0.2 supports:
      - net35 (.NETFramework,Version=v3.5)
      - net40 (.NETFramework,Version=v4.0)
      - net45 (.NETFramework,Version=v4.5)
      - portable-net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile259)
    One or more packages are incompatible with .NETStandard,Version=v1.5.

My CLI is now up to date

.NET Command Line Tools (1.0.0-rc2-002543)

Product Information:
 Version:     1.0.0-rc2-002543
 Commit Sha:  38d0c28a1e

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.10586
 OS Platform: Windows
 RID:         win10-x64

dodyg commented Apr 29, 2016

Let's try this again 😄

Adding Microsoft.NETCore.App generates torrents of error message (This is the project.json file http://pastebin.com/sFHCnC62) for my net451 target.

These are the error messages http://pastebin.com/pLLvPn6q.

Microsoft.NETCore.App relies on some packages that are not compatible with net451.

The question is what kind of TFM can I use instead of net45.

When I tried to use .netstandard1.5, it generates the following errors:

Errors in E:\labs\crucible\trunk\crucible.web\project.json
    Package CommonMark.NET 0.11.0 is not compatible with netstandard1.5 (.NETStandard,Version=v1.5). Package CommonMark.NET 0.11.0 supports:
      - dnxcore50 (DNXCore,Version=v5.0)
      - net20 (.NETFramework,Version=v2.0)
      - net35-client (.NETFramework,Version=v3.5,Profile=Client)
      - net40-client (.NETFramework,Version=v4.0,Profile=Client)
      - net45 (.NETFramework,Version=v4.5)
      - portable-net40+sl5+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile328)
      - portable-net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile259)
    Package Nustache 1.15.3.7 is not compatible with netstandard1.5 (.NETStandard,Version=v1.5). Package Nustache 1.15.3.7 supports: net20 (.NETFramework,Version=v2.0)
    Package Microsoft.Dnx.Compilation.CSharp.Common 1.0.0-rc2-20221 is not compatible with netstandard1.5 (.NETStandard,Version=v1.5). Package Microsoft.Dnx.Compilation.CSharp.Common 1.0.0-rc2-20221 supports:
      - dotnet5.4 (.NETPlatform,Version=v5.4)
      - net451 (.NETFramework,Version=v4.5.1)
    Package Microsoft.Dnx.Compilation.CSharp.Abstractions 1.0.0-rc2-20221 is not compatible with netstandard1.5 (.NETStandard,Version=v1.5). Package Microsoft.Dnx.Compilation.CSharp.Abstractions 1.0.0-rc2-20221 supports:
      - dotnet5.4 (.NETPlatform,Version=v5.4)
      - net451 (.NETFramework,Version=v4.5.1)
    Package Microsoft.Extensions.PlatformAbstractions.Dnx 1.0.0-rc2-20221 is not compatible with netstandard1.5 (.NETStandard,Version=v1.5). Package Microsoft.Extensions.PlatformAbstractions.Dnx 1.0.0-rc2-20221 supports:
      - dotnet5.4 (.NETPlatform,Version=v5.4)
      - net451 (.NETFramework,Version=v4.5.1)
    Package Newtonsoft.Json 8.0.3 is not compatible with netstandard1.5 (.NETStandard,Version=v1.5). Package Newtonsoft.Json 8.0.3 supports:
      - net20 (.NETFramework,Version=v2.0)
      - net35 (.NETFramework,Version=v3.5)
      - net40 (.NETFramework,Version=v4.0)
      - net45 (.NETFramework,Version=v4.5)
      - portable-dnxcore50+net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=net45+wp80+win8+wpa81+dnxcore50)
      - portable-net40+sl5+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile328)
    Package Ix-Async 1.2.5 is not compatible with netstandard1.5 (.NETStandard,Version=v1.5). Package Ix-Async 1.2.5 supports:
      - net40 (.NETFramework,Version=v4.0)
      - net45 (.NETFramework,Version=v4.5)
      - portable-net45+win8+wp8 (.NETPortable,Version=v0.0,Profile=Profile78)
    Package Remotion.Linq 2.0.2 is not compatible with netstandard1.5 (.NETStandard,Version=v1.5). Package Remotion.Linq 2.0.2 supports:
      - net35 (.NETFramework,Version=v3.5)
      - net40 (.NETFramework,Version=v4.0)
      - net45 (.NETFramework,Version=v4.5)
      - portable-net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile259)
    One or more packages are incompatible with .NETStandard,Version=v1.5.

My CLI is now up to date

.NET Command Line Tools (1.0.0-rc2-002543)

Product Information:
 Version:     1.0.0-rc2-002543
 Commit Sha:  38d0c28a1e

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.10586
 OS Platform: Windows
 RID:         win10-x64
@guardrex

This comment has been minimized.

Show comment
Hide comment
@guardrex

guardrex Apr 29, 2016

IIRC netstandard1.5 was not designed (or the design was changed) such that even if you have emitEntryPoint it will not produce runnable output (it's the TFM for libraries). The TFM for Core apps would ordinarily be netcoreapp1.0; however, that won't be the TFM you are targeting. You are targeting the .NET Framework, so you should be targeting net45 (or net4x/net4xy to be more specific). I'm sure @muratg can help more with that TFM than I can, as I'm a 100% Core CLR cat. However, if Murat is busy and doesn't get back to you, I'll pull down your project.json here in a few hours and see what's what. I've gotten pretty good at 🐒 banging 🐒 on the keyboard until an app will restore ... although compiling and running is another story. 😄

guardrex commented Apr 29, 2016

IIRC netstandard1.5 was not designed (or the design was changed) such that even if you have emitEntryPoint it will not produce runnable output (it's the TFM for libraries). The TFM for Core apps would ordinarily be netcoreapp1.0; however, that won't be the TFM you are targeting. You are targeting the .NET Framework, so you should be targeting net45 (or net4x/net4xy to be more specific). I'm sure @muratg can help more with that TFM than I can, as I'm a 100% Core CLR cat. However, if Murat is busy and doesn't get back to you, I'll pull down your project.json here in a few hours and see what's what. I've gotten pretty good at 🐒 banging 🐒 on the keyboard until an app will restore ... although compiling and running is another story. 😄

@muratg

This comment has been minimized.

Show comment
Hide comment
@muratg

muratg Apr 29, 2016

Member

Yeah netstandard* is for libraries, and netcoreapp* is for CoreCLR apps.

For full desktop apps, use net452 minimum.

Member

muratg commented Apr 29, 2016

Yeah netstandard* is for libraries, and netcoreapp* is for CoreCLR apps.

For full desktop apps, use net452 minimum.

@dodyg

This comment has been minimized.

Show comment
Hide comment
@dodyg

dodyg Apr 29, 2016

@muratg

Damn, that's the secret, net452 instead of net451 and now everything works (dotnet watch, dotnet publish-iis, dotnet ef```)

dodyg commented Apr 29, 2016

@muratg

Damn, that's the secret, net452 instead of net451 and now everything works (dotnet watch, dotnet publish-iis, dotnet ef```)

@muratg

This comment has been minimized.

Show comment
Hide comment
@muratg

muratg Apr 29, 2016

Member

@dodyg You should also be able to remove "Microsoft.NETCore.App": ... if you're targeting desktop CLR.

Member

muratg commented Apr 29, 2016

@dodyg You should also be able to remove "Microsoft.NETCore.App": ... if you're targeting desktop CLR.

@dodyg

This comment has been minimized.

Show comment
Hide comment
@dodyg

dodyg Apr 30, 2016

Now I hit IIS hosting issue aspnet/Docs#1140 (comment). Running the executable alone works fine. Running it through IIS stopped the Application Pool. I am trying to figure out where the logs are.

update: problem solved. The error was created by some out of date iisnode I had 😵

dodyg commented Apr 30, 2016

Now I hit IIS hosting issue aspnet/Docs#1140 (comment). Running the executable alone works fine. Running it through IIS stopped the Application Pool. I am trying to figure out where the logs are.

update: problem solved. The error was created by some out of date iisnode I had 😵

@e9-dbeech

This comment has been minimized.

Show comment
Hide comment
@e9-dbeech

e9-dbeech May 6, 2016

Thanks, this was a massive help. I wasted hours until finding this page. Just to help you out with one of the minor issues:

services.Configure<StorageSettings>(Configuration.GetSection("StorageSettings"));

has become

services.Configure<StorageSettings>(x => Configuration.GetSection("StorageSettings").Bind(x));

They mentioned this change on a recent community standup.

e9-dbeech commented May 6, 2016

Thanks, this was a massive help. I wasted hours until finding this page. Just to help you out with one of the minor issues:

services.Configure<StorageSettings>(Configuration.GetSection("StorageSettings"));

has become

services.Configure<StorageSettings>(x => Configuration.GetSection("StorageSettings").Bind(x));

They mentioned this change on a recent community standup.

@Bartmax

This comment has been minimized.

Show comment
Hide comment
@Bartmax

Bartmax May 6, 2016

@e9-dbeech Thanks for letting me know that it helped! and for the follow up on the configuration api. 👍

Bartmax commented May 6, 2016

@e9-dbeech Thanks for letting me know that it helped! and for the follow up on the configuration api. 👍

@johnmckinzie

This comment has been minimized.

Show comment
Hide comment
@johnmckinzie

johnmckinzie May 17, 2016

@e9-dbeech Do I need to add an additional using to use Bind()? I'm getting the following error:

'IConfigurationSection' does not contain a definition for 'Bind' and no extension method 'Bind' accepting a first argument of type 'IConfigurationSection' could be found (are you missing a using directive or an assembly reference?)

johnmckinzie commented May 17, 2016

@e9-dbeech Do I need to add an additional using to use Bind()? I'm getting the following error:

'IConfigurationSection' does not contain a definition for 'Bind' and no extension method 'Bind' accepting a first argument of type 'IConfigurationSection' could be found (are you missing a using directive or an assembly reference?)

@nil4

This comment has been minimized.

Show comment
Hide comment
@nil4

nil4 commented May 17, 2016

@johnmckinzie you need to reference the Microsoft.Extensions.Configuration.Binder package

@e9-dbeech

This comment has been minimized.

Show comment
Hide comment
@e9-dbeech

e9-dbeech May 17, 2016

I believe it's part of nuget package Microsoft.Extensions.Configuration.Binder

using Microsoft.Extensions.Configuration;

e9-dbeech commented May 17, 2016

I believe it's part of nuget package Microsoft.Extensions.Configuration.Binder

using Microsoft.Extensions.Configuration;

@johnmckinzie

This comment has been minimized.

Show comment
Hide comment
@johnmckinzie

johnmckinzie May 17, 2016

Thanks for the quick response @nil4 and @e9-dbeech. Much appreciated!

johnmckinzie commented May 17, 2016

Thanks for the quick response @nil4 and @e9-dbeech. Much appreciated!

@Cowlephant

This comment has been minimized.

Show comment
Hide comment
@Cowlephant

Cowlephant May 17, 2016

Now that this has officially released, I'm trying it again. I've viewed Shawn Wildermuth's blog as well on how to migrate from RC1 to RC2. Much of the same as last time, and I'm still stuck in the same situation as last time.

I have no more errors, everything looks good... and I launch the site but it just continues to wait for localhost and never finishes. No clues or errors on where I might determine the issue. Any thoughts?

Cowlephant commented May 17, 2016

Now that this has officially released, I'm trying it again. I've viewed Shawn Wildermuth's blog as well on how to migrate from RC1 to RC2. Much of the same as last time, and I'm still stuck in the same situation as last time.

I have no more errors, everything looks good... and I launch the site but it just continues to wait for localhost and never finishes. No clues or errors on where I might determine the issue. Any thoughts?

@guardrex

This comment has been minimized.

Show comment
Hide comment
@guardrex

guardrex May 17, 2016

@twilliamsgsnetx Did you run down the Troubleshooting at https://docs.asp.net/en/latest/publishing/iis.html?

guardrex commented May 17, 2016

@twilliamsgsnetx Did you run down the Troubleshooting at https://docs.asp.net/en/latest/publishing/iis.html?

@nickolasacosta

This comment has been minimized.

Show comment
Hide comment
@nickolasacosta

nickolasacosta May 18, 2016

services.AddCaching(); // NOT FOUND ??? REMOVED 

AddCaching() was renamed to AddMemoryCache();

In project.json

    "Microsoft.Extensions.Caching.Memory": "1.0.0-rc2-final",

nickolasacosta commented May 18, 2016

services.AddCaching(); // NOT FOUND ??? REMOVED 

AddCaching() was renamed to AddMemoryCache();

In project.json

    "Microsoft.Extensions.Caching.Memory": "1.0.0-rc2-final",
@Cowlephant

This comment has been minimized.

Show comment
Hide comment
@Cowlephant

Cowlephant May 18, 2016

@guardrex I certainly did with my production site for RC1. I can't even get it running in my development environment with IIS Express though. I didn't read anything about there being any changes that need to be made to an IIS Express environment in Visual Studio?

Cowlephant commented May 18, 2016

@guardrex I certainly did with my production site for RC1. I can't even get it running in my development environment with IIS Express though. I didn't read anything about there being any changes that need to be made to an IIS Express environment in Visual Studio?

@guardrex

This comment has been minimized.

Show comment
Hide comment
@guardrex

guardrex May 18, 2016

@twilliamsgsnetx You might need to put up a repo and/or chat with devs on Slack to walk through config to get it running. IISExpress should be fine now with the VS that was just dropped with RC2 release. http://tattoocoder.com/aspnet-slack-sign-up/

guardrex commented May 18, 2016

@twilliamsgsnetx You might need to put up a repo and/or chat with devs on Slack to walk through config to get it running. IISExpress should be fine now with the VS that was just dropped with RC2 release. http://tattoocoder.com/aspnet-slack-sign-up/

@Cowlephant

This comment has been minimized.

Show comment
Hide comment
@Cowlephant

Cowlephant May 18, 2016

@guardrex Actually I figured it out. I'm not sure what I did, since I made quite a few changes, but it's working now.

Now to deal with the issue of my Angular 2 stuff not showing due to these changes. Something is borked with URL rewriting.

Cowlephant commented May 18, 2016

@guardrex Actually I figured it out. I'm not sure what I did, since I made quite a few changes, but it's working now.

Now to deal with the issue of my Angular 2 stuff not showing due to these changes. Something is borked with URL rewriting.

@guardrex

This comment has been minimized.

Show comment
Hide comment

guardrex commented May 18, 2016

@MrAntix

This comment has been minimized.

Show comment
Hide comment
@MrAntix

MrAntix May 19, 2016

Update all dependencies from Microsoft.AspNet.xxx to Microsoft.AspNetCore.xxx except Microsoft.AspNet.WebApi.Client

do you know where the extensions in Microsoft.AspNet.WebApi.Client are now?
PostAsJsonAsync for example?

MrAntix commented May 19, 2016

Update all dependencies from Microsoft.AspNet.xxx to Microsoft.AspNetCore.xxx except Microsoft.AspNet.WebApi.Client

do you know where the extensions in Microsoft.AspNet.WebApi.Client are now?
PostAsJsonAsync for example?

@describeme

This comment has been minimized.

Show comment
Hide comment
@describeme

describeme May 20, 2016

Hell guys, I keep getting this error for Object, Func<>...

mscorlib

using this in project.json:

"frameworks": {

    "netcoreapp1.0": {
        "dependencies": {
            "Microsoft.NETCore.App": {
                "version": "1.0.0-*",
                "type": "platform"
            }
        },
        "imports": [
            "portable-net40+sl5+win8+wp8+wpa81",
            "portable-net451+win8",
            "netstandardapp1.3",
            "net451"
        ]
    },
    "net451": {
        "frameworkAssemblies": {
            "System.Runtime": "4.0.10.0"
        }
    }

}

Any ideas or suggestions? Thank you in advance!

describeme commented May 20, 2016

Hell guys, I keep getting this error for Object, Func<>...

mscorlib

using this in project.json:

"frameworks": {

    "netcoreapp1.0": {
        "dependencies": {
            "Microsoft.NETCore.App": {
                "version": "1.0.0-*",
                "type": "platform"
            }
        },
        "imports": [
            "portable-net40+sl5+win8+wp8+wpa81",
            "portable-net451+win8",
            "netstandardapp1.3",
            "net451"
        ]
    },
    "net451": {
        "frameworkAssemblies": {
            "System.Runtime": "4.0.10.0"
        }
    }

}

Any ideas or suggestions? Thank you in advance!

@StephenLujan

This comment has been minimized.

Show comment
Hide comment
@StephenLujan

StephenLujan Jun 7, 2016

This was a great resource. Thanks. I haven't implemented everything in this document yet, but I've made good headway on a migration tool. https://github.com/StephenLujan/dot-net-core-dnx-rc2-converter

StephenLujan commented Jun 7, 2016

This was a great resource. Thanks. I haven't implemented everything in this document yet, but I've made good headway on a migration tool. https://github.com/StephenLujan/dot-net-core-dnx-rc2-converter

@dazinator

This comment has been minimized.

Show comment
Hide comment
@dazinator

dazinator Jun 8, 2016

Hi Guys - Here' my upgrade tool, it not only deals with project.json, xproj and global.json but it also migrates old RC1 NuGet packages to the appropriate RC2 ones, and does some basic code refactoring for you using Roslyn (at the moment it does some simple using statement correction). Please try it out on an RC1 solution if you get a chance. After it's done it also clears the project.lock.json files ready for a dotnet resotre. I'll keep adding stuff to it until I run out of time / ideas.

dazinator commented Jun 8, 2016

Hi Guys - Here' my upgrade tool, it not only deals with project.json, xproj and global.json but it also migrates old RC1 NuGet packages to the appropriate RC2 ones, and does some basic code refactoring for you using Roslyn (at the moment it does some simple using statement correction). Please try it out on an RC1 solution if you get a chance. After it's done it also clears the project.lock.json files ready for a dotnet resotre. I'll keep adding stuff to it until I run out of time / ideas.

@gjsduarte

This comment has been minimized.

Show comment
Hide comment
@gjsduarte

gjsduarte Jul 1, 2016

Hey guys,
Anyone has an idea how check is if a view is partial during rendering, since the IsPartial property was removed from IRazorPage?

gjsduarte commented Jul 1, 2016

Hey guys,
Anyone has an idea how check is if a view is partial during rendering, since the IsPartial property was removed from IRazorPage?

@dougbu

This comment has been minimized.

Show comment
Hide comment
@dougbu

dougbu Jul 1, 2016

Member

Anyone has an idea how check is if a view is partial during rendering, since the IsPartial property was removed from IRazorPage?

We removed this little-used property early in the RC2 milestone. The name was incorrect and it only controls whether or not _ViewStart.cshtml files are used, nothing after views are found. The isMainPage concept remains and is exposed e.g. ViewLocationExpanderContext.IsMainPage.

If you have a scenario where something like IsMainPage is needed during view execution, please open a separate issue.

Member

dougbu commented Jul 1, 2016

Anyone has an idea how check is if a view is partial during rendering, since the IsPartial property was removed from IRazorPage?

We removed this little-used property early in the RC2 milestone. The name was incorrect and it only controls whether or not _ViewStart.cshtml files are used, nothing after views are found. The isMainPage concept remains and is exposed e.g. ViewLocationExpanderContext.IsMainPage.

If you have a scenario where something like IsMainPage is needed during view execution, please open a separate issue.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Jul 18, 2016

@dodyg Got same problem as you with RTM version. Can you share the project.json that you used to get a Windows-specific .NET 4.5 (not core) project to build and deploy ?

ghost commented Jul 18, 2016

@dodyg Got same problem as you with RTM version. Can you share the project.json that you used to get a Windows-specific .NET 4.5 (not core) project to build and deploy ?

@dodyg

This comment has been minimized.

Show comment
Hide comment
@dodyg

dodyg Jul 19, 2016

@bluemmc thanks for note. I just remember to upgrade now lol. Here's my project.json.

{
    "version": "1.0.0-*",
    "compilationOptions": {
        "emitEntryPoint": true,
        "preserveCompilationContext": true
    },
    "runtimeOptions": {
        "configProperties": {
            "System.GC.Server": true,
            "System.GC.Concurrent": true
        }
    },
    "dependencies": {
        "Crucible.Models": "1.0.0-*",
        "Crucible.Core": "1.0.0-*",
        "CommonMark.NET": "0.11.0",
        "SK.Framework": "1.0.0-*",
        "Microsoft.AspNetCore.Http": "1.0.0-*",
        "Microsoft.AspNetCore.Http.Abstractions": "1.0.0-*",
        "Microsoft.AspNetCore.Authentication": "1.0.0-*",
        "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0-*",
        "Microsoft.AspNetCore.Hosting": "1.0.0-*",
        "Microsoft.AspNetCore.Hosting.Abstractions": "1.0.0-*",
        "Microsoft.EntityFrameworkCore.SqlServer": "1.0.0-*",
        "Microsoft.AspNetCore.Mvc": "1.0.0-*",
        "Microsoft.AspNetCore.Diagnostics": "1.0.0-*",
        "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0-*",
        "Microsoft.AspNetCore.StaticFiles": "1.0.0-*",
        "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*",
        "Microsoft.AspNetCore.Session": "1.0.0-*",
        "Microsoft.Extensions.Configuration.Json": "1.0.0-*",
        "Microsoft.Extensions.Configuration.FileExtensions": "1.0.0-*",
        "Microsoft.Extensions.Caching.Memory": "1.0.0-*",
        "Microsoft.Extensions.Caching.Abstractions": "1.0.0-*",
        "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0-*",
        "Microsoft.Extensions.Logging.Console": "1.0.0-*",
        "Microsoft.Extensions.Logging": "1.0.0-*",
        "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*",
        "Microsoft.EntityFrameworkCore.Tools": {
            "version": "1.0.0-*",
            "type": "build"
        }
    },
    "tools": {
        "Microsoft.DotNet.Watcher.Tools": {
            "version": "1.0.0-*",
            "imports": "portable-net451+win8"
        },
        "Microsoft.EntityFrameworkCore.Tools": {
            "version": "1.0.0-*",
            "imports": "portable-net451+win8"
        },

        "Microsoft.AspNetCore.Server.IISIntegration.Tools": {
            "version": "1.0.0-*",
            "imports": "portable-net45+wp80+win8+wpa81+dnxcore50"
        }
    },

    "frameworks": {
        "net452": {
            "frameworkAssemblies": {
                "System.ComponentModel": "4.0.0.0"
            }
        }
    },
    "scripts": {
        "postpublish": "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"
    },
    "publishOptions": {
        "exclude": [
            "wwwroot",
            "node_modules"
        ]
    },
    "buildOptions": {
        "copyToOutput": [
        "wwwroot",
        "views",
        "areas/admin/views",
        "config.json",
        "emailtemplates"]        
    }
}

dodyg commented Jul 19, 2016

@bluemmc thanks for note. I just remember to upgrade now lol. Here's my project.json.

{
    "version": "1.0.0-*",
    "compilationOptions": {
        "emitEntryPoint": true,
        "preserveCompilationContext": true
    },
    "runtimeOptions": {
        "configProperties": {
            "System.GC.Server": true,
            "System.GC.Concurrent": true
        }
    },
    "dependencies": {
        "Crucible.Models": "1.0.0-*",
        "Crucible.Core": "1.0.0-*",
        "CommonMark.NET": "0.11.0",
        "SK.Framework": "1.0.0-*",
        "Microsoft.AspNetCore.Http": "1.0.0-*",
        "Microsoft.AspNetCore.Http.Abstractions": "1.0.0-*",
        "Microsoft.AspNetCore.Authentication": "1.0.0-*",
        "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0-*",
        "Microsoft.AspNetCore.Hosting": "1.0.0-*",
        "Microsoft.AspNetCore.Hosting.Abstractions": "1.0.0-*",
        "Microsoft.EntityFrameworkCore.SqlServer": "1.0.0-*",
        "Microsoft.AspNetCore.Mvc": "1.0.0-*",
        "Microsoft.AspNetCore.Diagnostics": "1.0.0-*",
        "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0-*",
        "Microsoft.AspNetCore.StaticFiles": "1.0.0-*",
        "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*",
        "Microsoft.AspNetCore.Session": "1.0.0-*",
        "Microsoft.Extensions.Configuration.Json": "1.0.0-*",
        "Microsoft.Extensions.Configuration.FileExtensions": "1.0.0-*",
        "Microsoft.Extensions.Caching.Memory": "1.0.0-*",
        "Microsoft.Extensions.Caching.Abstractions": "1.0.0-*",
        "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0-*",
        "Microsoft.Extensions.Logging.Console": "1.0.0-*",
        "Microsoft.Extensions.Logging": "1.0.0-*",
        "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*",
        "Microsoft.EntityFrameworkCore.Tools": {
            "version": "1.0.0-*",
            "type": "build"
        }
    },
    "tools": {
        "Microsoft.DotNet.Watcher.Tools": {
            "version": "1.0.0-*",
            "imports": "portable-net451+win8"
        },
        "Microsoft.EntityFrameworkCore.Tools": {
            "version": "1.0.0-*",
            "imports": "portable-net451+win8"
        },

        "Microsoft.AspNetCore.Server.IISIntegration.Tools": {
            "version": "1.0.0-*",
            "imports": "portable-net45+wp80+win8+wpa81+dnxcore50"
        }
    },

    "frameworks": {
        "net452": {
            "frameworkAssemblies": {
                "System.ComponentModel": "4.0.0.0"
            }
        }
    },
    "scripts": {
        "postpublish": "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"
    },
    "publishOptions": {
        "exclude": [
            "wwwroot",
            "node_modules"
        ]
    },
    "buildOptions": {
        "copyToOutput": [
        "wwwroot",
        "views",
        "areas/admin/views",
        "config.json",
        "emailtemplates"]        
    }
}

@aspnet-hello

This comment has been minimized.

Show comment
Hide comment
@aspnet-hello

aspnet-hello Dec 31, 2017

This issue is being closed because it has not been updated in 3 months.

We apologize if this causes any inconvenience. We ask that if you are still encountering this issue, please log a new issue with updated information and we will investigate.

aspnet-hello commented Dec 31, 2017

This issue is being closed because it has not been updated in 3 months.

We apologize if this causes any inconvenience. We ask that if you are still encountering this issue, please log a new issue with updated information and we will investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment