question

PeterLiedholm-6539 avatar image
0 Votes"
PeterLiedholm-6539 asked karenpayneoregon answered

C# Solution for .NET 4.0 (VS 2012) fails to upgrade to .NET 4.8 (VS 2021).

I attach screenshots.
It looks like upgrade fails instantly and there are no upgrade reports or traces in file system that anything has been done.
201712-visual-studio-upgrade-fail-2.png201674-visual-studio-upgrade-fail-1.png


dotnet-csharpvs-general
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

karenpayneoregon avatar image
0 Votes"
karenpayneoregon answered

Unfortunately you need to perform a manual upgrade.

Read the following for some tips extra the part about opening the old project in VS2022

Try opening VS2012 and VS2022

  • Create a new project in VS2022

  • Transfer project resources from VS2012 to VS20122 if any

  • In the new project, add any required external references

  • Build the project to validate the above

  • If a forms project, open the designer for each form, copy the contents into a form in the new project

  • Add required event handlers

  • Build the project to validate the above

  • Add classes from the old project to the new project

  • Build the project to validate the above

  • Continue with similar logic

I've done this from .NET Framework to .NET Core with minor changes to the steps above rather than even think about using Visual Studio to do this for me. What greatly assist is using Resharper with quickly assisting with references and adjusting namespaces but it's not cheap.

Lastly, I may be missing something but Microsoft has focused on helping developers to move from .NET Framework to .NET Core rather than going from 4.x to 4.8 as per the following.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.