14

How can I get PackageReference packages to be included with the ClickOnce automatically?

I am trying to convert a ClickOnce application from packages.config to use PackageReferences as I have a good 30+ nuget packages (mostly dependencies) and it it makes it a lot easier to upgrade the few I actually need to reference.

The issue is that once I did that, all the nuget package assemblies are now considered "Prerequisites (Auto)" instead of "Include (Auto)", making ClickOnce deployments skip them. It also gives me the "...must be strong signed in order to be marked as a prerequisite" for any custom nuget packages.

Update:

It turned out that this didn't work at all. Assemblies like System.Runtime was not included by ClickOnce, period. There was no option to include it, and it ended up breaking the deployment (due to a FileNotFoundException for System.Runtime) even after setting all assemblies to Include manually. I had to revert back to packages.config. I'd love to see ClickOnce updated to work with PackageReferences

Nathan A
  • 11,059
  • 4
  • 47
  • 63
  • It seems we need change the "Prerequisites (Auto)" to "Include (Auto) manually. But I'm not very sure if there are other magic that can automate it. – Leo Liu Oct 16 '17 at 10:02
  • 2
    @Leo-MSFT That's what I ended up having to do, but as it's a WPF app that includes some NET STANDARD libraries, there ended up being over 50 assemblies I had to do this to. It wasn't pretty, and if dependencies ever change, we'll have to remember to go in and update new assemblies manually as well. – Nathan A Oct 16 '17 at 12:58
  • Yes, that is really a question. You can submit this request to Visual Studio team: https://visualstudio.uservoice.com/forums/121579-visual-studio. Hope the product team member will take this feedback seriously. – Leo Liu Oct 17 '17 at 09:34
  • These [github](https://github.com/dotnet/standard/issues/529) [links](https://github.com/Microsoft/msbuild/issues/3058) seem relevant. – Chris Apr 15 '19 at 18:30

0 Answers0