The
main
branch contains the project before applying the following steps.The
step01
shows how the project looks like after applying the following steps.
DotVVM supports .NET Core 3.1, .NET 5 and higher, and the old .NET Framework 4.7.2 and newer.
Unfortunately, the application still targets .NET Framework 4.5.1. We have to upgrade it to .NET Framework 4.7.2´or newer first.
-
Upgrade all projects in the solution to .NET Framework 4.7.2 or newer.
Perform these steps for all three projects in the solution.
-
Make sure the solution can be built without errors.
-
Right-click on the
Altairis.VtipBaze.WebCore
package and select Add DotVVM. -
Confirm the changes and wait for the process to complete.
-
Finally, right-click the project and select Manage NuGet Packages. We will need to add one optional NuGet package (
DotVVM.Adapters.WebForms
) manually. This package contains several helper components and methods which will simplify the migration. -
In the package manager window, search for
DotVVM.Adapters.WebForms
package and install it in the project. -
Open the
DotvvmStartup.cs
file and add the following line in theConfigure
method:public void Configure(DotvvmConfiguration config, string applicationPath) { + config.AddWebFormsAdapters(); + ConfigureRoutes(config, applicationPath); ConfigureControls(config, applicationPath); ConfigureResources(config, applicationPath); }
After this step, the application will still be using ASP.NET Web Forms, but you may use DotVVM pages in the project as well.
-
Make sure that
Altairis.VtipBaze.WebCore
is the startup project. -
Run the application by pressing F5 and make sure the application did not break.
If you get System.IO.FileLoadException (Could not load file or assembly XXX), it is probably caused by broken assembly redirects section.
Open the
Altairis.VtipBaze.WebCore\Web.config
file, delete the entire<runtime>
section. Then open the Error List window in Visual Studio and double-click on the warning which starts with "Found conflicts between different versions of the same dependent assembly." Visual Studio will regenerate the section with the correct assembly binding redirects.