Houss_gc
Houss_gc

Reputation: 749

ClickOnce deployment does not install as expected

I have a WPF application developed with .NET 4.61, and I use ClickOnce to deploy the application. The publishing phase runs without error, but when I try to install, the installer downloads .NET 4.61 as expected. Once done (after a restart), it gives an error stating the assembly System.drawing.primitives.dll version 4.0.2.0 needs to be installed in the GAC.

Does not .NET 461 install assemblies in the GAC by default?

Information

PS: The same problem is present on my development machine.

Upvotes: 3

Views: 1869

Answers (3)

Robert
Robert

Reputation: 73

I got rid of this annoyance. It took me a lot of time browsing the web and trying. The actual changes are a lot less.

What worked for me.

  • If you have them, remove all the extra includes previously mentioned from the project file.
  • Add AutoGenerateBindingRedirects like described here.
  • Switch to .NET 4.7.1 which you can find here.

Upvotes: 2

Camille
Camille

Reputation: 11

I suffer the same issue. In order to solve it, I had to include all required packages in Application Files... on the Publish tab.

Publish configuration screenshot

Upvotes: 1

mcolhoun
mcolhoun

Reputation: 507

I am able to replicate this issue, but don't know enough to be able to answer your question clearly, but maybe it may help someone more knowledgeable to help answer it.

It appears to be an issue related to a WPF application referencing a .NET Standard 2.0 class library.

Here are the steps to reproduce:

  • Create a new Solution with a WPF App in Visual Studio 2017 with File > New Project> Visual c# > WPF App (.NET Framework)
  • Build and Publish. The WPF App runs fine
  • Add a new Project to the Solution with File > Add > New Project > Visual C# > .NET Standard > Class Library > .NET Standard (.NET Framework 4.6.1)
  • Add a Reference from the WPF App to the .NET Standard Class Library.
  • Build and Publish and attempt to install.

Get an Error "Unable to install or run the application. The Application requires that assembly System.Drawing.Primitives Version 4.0.2.0 be installed in the Global Assembly Cache first.

Error Dialog

I have this simple project reproduced in git.

https://github.com/colhountech/WPF_With_NetStandard

Hope this helps someone to resolve it. I've got the same issue with a simple WPF project I am trying unsuccessfully to resolve.

Upvotes: 2

Related Questions