Update a DLL from .NET Framework 2.0 to Core 7?

Tony Lewis 1 Reputation point
2023-02-16T00:24:14.0233333+00:00

According to other posts, this may be futile, but I will ask anyway.

I have the source code and Visual Studio solution file for a dynamic link library that was written in C#, and compiled using .NET Framework 2.0, probably in 2005 - 2008. Now I am way out of my comfort zone here, but thought perhaps I could (simply) load the files into Visual Studio (17.4.5), and reselect Core 7 as the target framework and recompile. However, when you access Project Properties, and then select the target framework, the only selections are 2.0 to 4.8, with the option at the bottom to "install other frameworks". In selecting "install other frameworks", you are taken to a page to download either Core 6.0 or 7.0, or Frameworks 2.0 through 4.8.1. I selected and installed Core 7.0, and restarted Visual Studio, but Core 7.0 does not show up in the drop down list of possible frameworks.

So why would Core 6 and 7 not show up in the list of available frameworks when they are both installed?

Thanks in advance for your input.

Developer technologies Visual Studio Other
Developer technologies C#
{count} votes

1 answer

Sort by: Most helpful
  1. Karen Payne MVP 35,586 Reputation points Volunteer Moderator
    2023-02-16T02:13:08.64+00:00

    Create a new project of the same type e.g. class project but targeting .NET Core 7 and add the files from the old project into the new project and adjust the namespaces.

    Next, most likely there will be missing references which you need to find and add to the new project's dependencies.

    There is the off chance even with the above done the code will not compile and if so come back here and indicate the build error(s).


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.