I need documentation to Migrate Asp.net 4.6 Application to ASP.Net Core . Please let me know if you have any information for it.
Thanks.
Regards,
Joyal
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@joyalsttl The migration docs for this type of app are here: https://docs.microsoft.com/aspnet/core/migration/proper-to-2x/. Is there something you're trying to do that isn't documented there?
@scottaddie,
Actually, The am not able to add "Microsoft.AspNetCore.All" via nuget package. I got the below error.
Error Could not install package 'Microsoft.AspNetCore.All 2.1.0-rc1-final'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.6.1', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
Please let me know to resolve this issue.
Thanks.
Migration does not work like that. You have to create a new web project and move your code over. There is a walkthrough in doing this with an mvc sample
@isaac2004 ,
Thanks for the reply. I understood now that the migration will not be done automatically. But, I have to copy folders and files manually. But, the problem is that, My project is written in Classic ASP.Net 4.6.1. I want to migrate that to ASP.Net Core. Please let me know for that.
Thanks.
@joyalsttl Unfortunately, there's no tooling available to automatically migrate an ASP.NET 4.x project to ASP.NET Core. It's a very manual process.
Off the top of my head, below is a checklist of tasks and considerations. As with anything else, there are other things to consider as well.
<PackageReference /> nodes in the _.csproj_ file. NuGet isn't capable of installing static files in the new project system. For that reason, you'll need to either use a CDN or consider a different package manager (npm, Yarn, LibMan, etc.) for installing client-side libraries and frameworks (e.g., Bootstrap, Angular, jQuery). The *repositories.config file you would've had for your solution can be deleted.<appSettings /> node is no longer used. Such config values should now be placed in an appsettings.json file at the project root. You can configure ASP.NET Core to read from XML config files instead, but that's not the default. Read more here.While this checklist may seem daunting, the benefits of migrating are significant. As you read through the migration docs, please feel free to ask more questions. We're here to help make your migration a success.
@scottaddie,
I understood that there is no tool which automatically transfer my Classic ASP.net 4.6.1 application to ASP.Net core.
In fact, I want to get benefit of Cross Platform, I want to migrate it. I don't think that ASP.Net core will work if i will copy all the files manually from "Classic ASP.Net 4.6.1" to ASP.Net core.
I am again repeating that my application has been built using "Classic ASP.Net 4.6.1" using WEB FORMS.
Please let me know if you can share docs of migration for it.
Thanks.
@joyalsttl Web Forms is not supported in ASP.NET Core, as documented here. I recommend migrating from ASP.NET 4.x Web Forms to ASP.NET 4.x MVC first. Web Forms and MVC can exist in the same ASP.NET 4.x project, so you can migrate one ASPX file at a time to minimize impact. Once you've completed that migration, you can begin the migration to ASP.NET Core MVC using the instructions we have documented. To be honest, there's a lot significant amount of work ahead of you.
After porting ASP.NET 4.x to ASP.NET Core 2.2, does anyone know how Razor view files (CSHTML) are compiled? That's the only part I'm stuck on.
Most helpful comment
@joyalsttl Unfortunately, there's no tooling available to automatically migrate an ASP.NET 4.x project to ASP.NET Core. It's a very manual process.
Off the top of my head, below is a checklist of tasks and considerations. As with anything else, there are other things to consider as well.
<PackageReference />nodes in the _.csproj_ file. NuGet isn't capable of installing static files in the new project system. For that reason, you'll need to either use a CDN or consider a different package manager (npm, Yarn, LibMan, etc.) for installing client-side libraries and frameworks (e.g., Bootstrap, Angular, jQuery). The *repositories.config file you would've had for your solution can be deleted.<appSettings />node is no longer used. Such config values should now be placed in an appsettings.json file at the project root. You can configure ASP.NET Core to read from XML config files instead, but that's not the default. Read more here.While this checklist may seem daunting, the benefits of migrating are significant. As you read through the migration docs, please feel free to ask more questions. We're here to help make your migration a success.