0

I am trying to migrate a .NET Framework 4.5.2 DLL, to a GitHub (GH) Package. The tutorial I came across (Working with the NuGet Registry) was for the SDK style of project. Our .NET Framework 4.5.2 is older than the SDK style. I think it's called the "legacy" style of project file.

So, I've come across other references such as Install NuGet Client Tools and Manage NuGet packages with the NuGet CLI. But these still leave out some details that I don't know how to address. For example, the Visual Studio project doesn't have a Packages folder. It also doesn't have a packages.config file. And it doesn't reference any NuGet packages. I believe I've got to create a packages.config file, then take the references from the .csproj file and copy those into a new packages.config file. After I copy the references out of the .csproj file into the packages.config file, do I delete those references from the .csproj file?

Another question I have concerns what goes into the packages.config file. According to this link packages.config reference, I must include the ID and version. I can just use the assembly's name for the ID, but I'm not certain about the version number. From within VS 2022, selecting each reference there's a "Version" attribute and a "Runtime Version" attribute. Which is the correct version I should use in the packages.config file?

Rod
  • 4,107
  • 12
  • 57
  • 81
  • 1
    The following may be of interest: [Quickstart: Create and publish a package using Visual Studio (.NET Framework, Windows)](https://learn.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package-using-visual-studio-net-framework) – Tu deschizi eu inchid May 03 '23 at 23:26
  • 1
    Confusing question. The first part suggest you want to *create* a Nuget package, but packages.config is only relevant to *using* a package. Don't type it in, VS maintains it when you add packages to a project. – Hans Passant May 03 '23 at 23:51
  • @HansPassant I may have misunderstood the instructions in the link I gave for Manage NuGet packages with the NuGet CLI. I took that to mean I needed to have a packages.config file, to publish a package to a GH Package. Is that wrong? – Rod May 05 '23 at 14:35

0 Answers0