Should I install an older version of Visual Studio to work on an old ASP.NET app?

Falanga, Rod, DOH 80 Reputation points
2024-04-18T17:00:47.3866667+00:00

I prefer to use Visual Studio 2022, because I've been working with newer, .NET projects. However, I may be assigned to do some maintenance on an older, .NET Framework ASP.NET WebForms application. I've been familiarizing myself with the app this morning and am concerned with what I've found. The app is 10 years old. Over that time there's been several different developers who've worked on it, some of whom are no longer with us. There are 18 projects in the solution. There are 5 different .NET Frameworks in this solution; everything from .NET Framework 2 to .NET Framework 4.5.1. And what bothers me most is there's at least one package which I cannot find on NuGet. I've searched online for this package, with no success. (I found something similar in a GitHub repo, but it wasn't the same thing.)

So, my question is this. Given this situation, can I use VS 2022 to edit and maintain this solution or should I use some older version of Visual Studio?

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,263 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 56,526 Reputation points
    2024-04-18T20:41:07.87+00:00

    the default install of VS 2022 does not include the old framework, but you can install support. Unlike .net core, the old framework was very loose on version support. you can override in the web.config the version used. It will build, it just crashes if there is an incompatiability. VS 2022 will work as well as an earlier version. Some of the older designers if used may need to be installed.

    you indeed may be using a nuget package that is no longer published. You just need a copy of the binary dll. Your app may also be using components only installed in GAC (especially before framework 4.5). Of course on a new machine, they may not be installed. You will need to track these down so they can be installed on the server separately. your package may also have been from codeplex which was used before nuget became popular. Unfortunately MS shut it down. there is a an attempt at an archive: https://codeplexarchive.org

    once you get it to build and run, I'd update all the projects to 4.8. This also involves updating the nuget packages. This is less than trivial if some of the projects are pre 4.6. You should start with the master web project first. Updating the project file, config and nuget from 4.5.1 is rough. It's probably easier to create a new 4.8 web project and add the source code and nuget packages.

    once the web project is 4.8 you can start updating the library projects. again you probably want the new project format, so create a new library and add files.

    if you are using membership, be sure to read release notes. the encryption defaults changed, so you need to force the old behavior.