-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Notes about my own experience migrating from RC1 to RC2 #1381
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
Comments
just remember one undocumented note: not sure exactly what was the problem... and don't remember clearly. |
one more undocumented note:
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);
}
}
} |
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. |
@kudoz83 I had no issues, i just did 1 migration |
Any problems using VS2015. Any tooling or debugging issues you ran into. Or does the Asp.net RC1 tooling installer still work. |
@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 :( |
Thanks for the complete nice feedback. I was planning to migrate my own project from RC1 to RC2, this will help me for sure! |
This is good. |
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. |
Added |
@tuespetre thank you! I'll give it a try! |
@tuespetre I am using the |
I don't know about |
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? |
@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. |
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. |
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 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
|
Wait there's already an RC3 build? I still cannot manage to migrate to RC2 from RC1 I got
|
@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 <?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> |
Thanks for the tips. Let me try this migration thing one more time. |
Well...I think I'm not gonna update to RC2 anytime soon! |
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. 😃 |
What would this be in the RC 2
I want to target .NET 4.5/4.6. I am using packages that only work on Windows. |
Now I hit this bug NuGet/Home#2644 |
OK I fixed NuGet/Home#2644 by adding imports statement.
|
I got it to compile yay! until I hit this dotnet/efcore#5076 and this aspnet/Announcements#167 |
Now I got this problem regarding TagHelpers
I fixed it by changing
to
from _ViewImports.cshtml I GOT IT WORKING!!! At least a home page. 🎆 🎆 🎆 😂 |
I was making good progress on my own upgrade until I hit dotnet/cli@2429: |
This is my project.json http://pastebin.com/KTrXnFSX |
@e9-dbeech Do I need to add an additional
|
@johnmckinzie you need to reference the Microsoft.Extensions.Configuration.Binder package |
I believe it's part of nuget package Microsoft.Extensions.Configuration.Binder using Microsoft.Extensions.Configuration; |
Thanks for the quick response @nil4 and @e9-dbeech. Much appreciated! |
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? |
@twilliamsgsnetx Did you run down the Troubleshooting at https://docs.asp.net/en/latest/publishing/iis.html? |
AddCaching() was renamed to AddMemoryCache(); In project.json
|
@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? |
@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 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. |
Cross-linking Converting a .csproj to .xproj RC2 |
do you know where the extensions in Microsoft.AspNet.WebApi.Client are now? |
Hell guys, I keep getting this error for Object, Func<>... using this in project.json: "frameworks": {
Any ideas or suggestions? Thank you in advance! |
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 |
Hi Guys - Here' my upgrade tool, it not only deals with |
Hey guys, |
We removed this little-used property early in the RC2 milestone. The name was incorrect and it only controls whether or not If you have a scenario where something like |
@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 ? |
@bluemmc thanks for note. I just remember to upgrade now lol. Here's my project.json.
|
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. |
@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
Nuget.config
add ci builds to nuget config
project.json
Dependencies
Update all dependencies from
Microsoft.AspNet.xxx
toMicrosoft.AspNetCore.xxx
exceptMicrosoft.AspNet.WebApi.Client
Update all dependencies from
x.EntityFramework.x
tox.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 nameFrameworks
Update TFM. This change was a complete copy paste of some sample code. We had no idea what this change means.
before:
after:
Code Changes
NOTE:
BEFORE
code may contain AspNetCorebecause 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
Entity Framework
GraphBehavior.X does not exist anymore on EF context methods.
Extensions
Identity
User.GetUserId()
andUser.IsSignedIn()
doesn't exist. it was removed and added toUserManager
andSignInManager
.ExternalLoginInfo.ExternalPrincipal
was renamed toExternalLoginInfo.Principal
Startup
This change is a complete copy/paste from sample. No idea what's going on here.
## 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
We used POCO Configuration with code like:
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
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:
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.
The text was updated successfully, but these errors were encountered: