1

I'm working on upgrading one of our WPF applications. During my upgrade, I converted the application from using the packages.config format for NuGet packages to using the PackageReference format.

Everything seemed to work fine locally, but our build agent started complaining about our NuGet packages:

Error MSB3188: Assembly 'C:\Users\tfs\.nuget\packages\Utils\1.0.0\lib\net45\Utils.dll' must be strong signed in order to be marked as a prerequisite.

This sort of makes sense because the Utils package is not referenced directly anymore. When you utilize the packages.config format, every NuGet package is referenced by the project, but when you utilize the PackageReference format, only the top-level packages are referenced; package dependencies are not included. Additionally, any projects which are referenced which have a NuGet dependency not explicitly referenced by the WPF project are also affected.

Adding the package dependencies directly to the WPF project solves this issue, but it seems like it shouldn't have to be done that way.

What's strange is when I go into the publish settings / application files for the project, the assemblies are not listed as Prerequisite, but they are marked as Install (Auto) instead.

Short of adding the NuGet package dependencies (not simply the top-level packages), what are my options here? Is there some sort of setting or msbuild parameter, etc. which I can use that allows me to use the PackageReference format while still only referencing the top-level packages?

myermian
  • 31,823
  • 24
  • 123
  • 215
  • Are you restoring the packages before building? Does it work if you build the application rather than publishing it? – mm8 Jul 17 '19 at 13:04
  • Our build script also does a restore, build, test prior to publishing. – myermian Jul 17 '19 at 13:11

0 Answers0