0

I have a large solution consisting of hundreds of projects.

I need to update to a new version of one of the 3rd party libraries we use. The updated version of the library has a dependency on netstandard.

Most/all of the individual projects in the solution target .NETFramework 4.7.2

In order to get the 2 projects that are directly dependent on the 3rd party library to compile, I had to manually edit their .csproj files and add

<Reference Include="netstandard" />

Now, this got those projects to compile, however it seemed to create a downstream dependency on netstandard in every other project (~40) that referenced the two that directly reference the library. Seemingly I could manually edit all 40 of those .csproj files, but that would probably just push the dependency up another level, and manually editing 2 .csproj files already felt wrong.

Is there a clean solution here that I'm missing?

Chris
  • 679
  • 1
  • 11
  • 26
  • 1
    "In order to get the 2 projects that are directly dependent on the 3rd party library to compile, I had to manually edit their .csproj files and add", why? .NET Framework 4.7.2 projects can consume .NET Standard 2.0 libraries (unless you were still using NuGet `packages.config`). – Lex Li Jan 06 '22 at 18:18
  • I was following an answer in this post https://stackoverflow.com/questions/49925484/you-must-add-a-reference-to-assembly-netstandard-version-2-0-0-0 – Chris Jan 06 '22 at 18:53
  • Then why didn't you follow the most voted answer to switch to PackageReference? https://stackoverflow.com/a/51743098/11182 – Lex Li Jan 06 '22 at 19:34
  • I can take a closer look at that.. It's a decade+ old solution with over 175 projects in it so I was looking for minimal changes. – Chris Jan 06 '22 at 19:41

0 Answers0