OLIA GAVRYSH: Hi.
My name is Olia Gavrysh.
I'm a Product Manager working on.NET team and focusing on
the latest version of the.NET and
the ways how you can upgrade your applications.
In this demo, I'm going to show you
how you can upgrade your.NET
Framework or.NET Core application to the latest.NET.
Now you can do it in
Visual Studio with just a few clicks.
No matter what application you have, WinForms, WPF,
Console Class library, ASP.NET,
you can upgrade your app in
Visual Studio to the latest.NET.
Even if you have Xamarin.Forms application,
you can migrate it to.NET MAUI and you can
also migrate UWP applications to being your three.
If you have Azure Functions,
not only you can upgrade it
from.NET Framework to the latest.NET,
but also you can upgrade
to the latest Azure Function versions.
From V1, V2, V3 to the latest right now it's V4.
One exception is Web Forms.
If you have dependency on Web Forms,
that is considered an older way of doing
things and we did not bring it to.NET Core
or later versions of.NET so
to upgrade your application first you need
to revoke and get rid of
Web Forms dependencies or
you can leave it on.NET Framework.
That's fine too. Let's go to Visual Studio
and I'm going to show you
how easy upgrades are right now.
First thing you need to make sure that you
have the extension for upgrades.
For that, we go to extensions,
manage extensions, and here in
online type.NET Upgrade Assistant.
This is the expansion you'd want to be able to migrate.
Once you have it click "Download".
I already have it on my machine.
Make sure automatic updates
are on because we are constantly
improving this tool and you
want to get all the latest features.
Once I have it on my machine installed,
then I can right-click on "My
Project" and see a Menu option Upgrade.
Once I click "Upgrade",
I will see Upgrade Assistant
that will guide me through the experience.
The first decision that I need to make is what type of
upgrade I want to do and
there are three options for that.
Depending on your project,
Upgrade Assistant will recommend
only options that make sense for you so you may see
less than three that means that
Upgrade Assistant help you to make
some decisions here already.
I'm going to show you how to upgrade
a class library then I'll
show you how to upgrade a web application.
For a class library,
I have three different options for upgrades.
In-place project upgrade,
side-by-side, and side-by-side incremental.
In-place will just simply take
my project and move it to the latest.NET.
Side-by-side will do the same but
instead of touching my original project,
it will create a new project.
In the solution, we'll put that right next to
my original project and
migrate my code into this new project.
As a result, I will have two projects,
one original untouched,
and the new one on the latest.NET.
Side-by-side incremental.
This experience was designed mostly for web applications
because when you're porting from
ASP.NET to ASP.NET Core,
those two platforms are very
different and there are lots and lots of
changes that are required to
switch to the latest platform.
For that usually people prefer incremental upgrades where
they move piece by piece and with this type,
you will have an option to have
your application running in production all the
time smoothly and you can trace
your migrations through months and add class-by-class,
view-by-view,
and your application will still
work and the parts that are not
still implemented in the new project
it will forward to
your original.NET Framework application.
For a class library,
I'm going to choose side-by-side project upgrade.
Here, upgrade the system asks me,
do I want to create a new project or
maybe I already started migration
and I have already created this new project
and I want migration to happen there.
In most cases, if you haven't started anything manually,
choose New Project and click "Next".
Here you can give a name
to your project RecordLibraryCore.
Let's call it.NET7.
I'm going to click "Next".
Here I can choose the target
so you will see three versions of.NET.
Long-term support, right now, it's.NET 6.
It's the version that we support
for three years and you can see that
support ends in November 2022.
Then standard terms support.
That's the latest.NET that is available right now.
Support ends in May 2022.
STS indicates that that's the standard term support.
Also, there is an option for preview.
If you prefer to get the latest changes from our team,
you can upgrade to preview.
If you are on,
let's say Preview 1 and Preview 2 is already available,
you can use upgrade the system to upgrade
within Preview to the latest version of Preview as well.
Now because we are port in class library,
there are two more options.NETStandard
2.0 and.NETStandard 2.1.
That option is available for
class libraries because sometimes you want
your library to be used from both.NET Framework
applications and.NET Core or.NET 6,.NET 7.
In that case, you can
use.NETStandard and to be compatible
between Framework and Core family use.NETStandard
2.0 because 2.1 is
not always compatible with.NET Framework.
Because either unplanned to
move all the Core to the latest.NET,
I'm not going to choose.NETStandard,
I will choose.NET 7.0.
On the next screen,
it shows me all my content of my project and
I can check and check anything if
I prefer to do it step-by-step.
In my case, I want to do it all at once,
so everything is checked and I click "Upgrade".
Here you can see
the progress of my upgrade.
I see green check boxes success.
When the checkbox is filled with color,
that means that this file
was changed and successfully changed.
Now it's on.NEt7.
The one that does not field
means that this file is already compatible.
No changes were made.
It just works as is.
Nothing was done here,
but it's also on.NET7
compatible with the latest framework.
Just like that, you can see now,
if I go to properties here,
my library is targeting.NET7.0,
so just an affiliate clicks,
I moved my class library from.NET Framework 4.8 to.NET7.
Now I'm going to show you how you can
upgrade your SP.NET application.
Same way, I'm clicking "Upgrade" here
upgrade assistance suggests
me only incremental option for migrates.
That is because that is
the recommended way for web applications.
I'm going to choose that and I will choose new project.
I'll call it.NET7.
Here is the summary of
what upgrade the system is going to do.
At this point, it will create a new.NET7 project.
It'll put it right next to
my original Mvc music store.net framework project.
It'll set up Mvc.NET7 projects as a facade.
When I run my application.NET7 project
runs and then when users call some routes,
it's going to check, is this route
implemented already in my.NET7 application?
If yes, then that route will be executed.
But if not, it will forward the call to the
original my.NET Framework applications.
This way, you can stretch your migration
through months and migrate piece by piece one at a time.
No rush and have your application running in production.
I'm going to click "Done."
Here you can see this summary of what happened.
Right now, all endpoints I have
35 of them are on.NET Framework.
I don't have any routes on asp.net
core and their options of
grape controller, class and view.
Another useful top here is endpoints explorer,
where you can see all the employees here,
all my post gets and so on.
In my Mvc music store,
it's empty for now.
Now I'm going to move things one by one.
We're going to start with a controller and I will select,
let's say HomeController. It's a good start.
I'll click "Upgrade" so it automatically detects
what dependencies this controller has on views,
routes, database, contexts, etc.
I'm going to leave everything
checked and click upgrade the selection.
Here you will see how my application is getting upgraded.
Some files have been changed some were left
untouched because they are already compatible.
You can see 15 succeeded,
zero failed, 12 skipped.
Awesome. Now when I go to summary page,
I see that already three routes are
on.NET Core family on my.NET salmon project.
I have 32 routes left.
Just like that, one by one,
I will select my controllers,
glosses, views and migrate everything.
Once everything is on.NET7,
I can get rid of the.NET Framework application.
just like that, you can use this extension
in Visual Studio and migrate
your application from older.NET
Framework or.NET court to the latest.NET.
Another great feature that this tool has it can upgrade
you from any version of.NET to the latest one.
Even once you move from.NET
Framework and know let's say your.NET6,
in a few years,
there's.NET8,.NET9,.NET10 available.
I still recommend using
this tool to upgrade to the latest.NET first,
upgrades will be much faster and much easier.
But we are aiding functionality and
not only to change targets framework,
but also to automatically
update calls of certain APIs
and avoid the breaking changes.
Of course, it wouldn't be able to do everything,
but we do as much as we can.
By using this upgrade assistant,
you will get better experience ports in
some manual steps will already be done for you.
With that, please check out
this tool and do give us feedback.
This tool is very new and we are
listening to your preferences.
We want to hear what else you want the tool
to cover or if something doesn't work for you.
Please in Visual Studio,
in the top right corner,
click on reported problem or
suggestive feature here and
a specified.NET upgrade assistant in the caption,
that way, I will get this issue right
away and you'll be able to address if then help you.
With that, Thank you so much and happy coding.