I have a WPF clickonce application that depends on a netStandard package I built internally. This automatically pull in references to various System facade assemblies eg System.Security.Cryptography.Primitives System.Security.Cryptography.X509Certificates etc
When the ClickOnce app is launched, it displays this message: Unable to install or run the application. The application requires that assembly System.Security.Cryptography.X509Certificates Version 4.0.0.0 be installed in the Global Assembly Cache (GAC) first.
I consider this odd and all efforts to resolve the issue have proved abortive. I tried excluding the assemblies then including them, the result is the same.
Further thoughts: The WPF application targets net461. It depends on a netStandard library I built as a nuget package. That package and others like Newtonsoft.Json pull in the .NETStandardLibrary and as host of other small System.*.4.3.0 packages. Most of them just have type forwarders for the .NET framework. Now when you install the WPF via clickonce, the deployer gets confused and for some reason insists that System.Security.Cryptography for instance must be in the GAC probably because it "sees it as a framework assembly (my wild guess)".
This is the Output from the ClickOnce log:
COMPONENT STORE TRANSACTION FAILURE SUMMARY No transaction error was detected.
WARNINGS There were no warnings during this operation.
OPERATION PROGRESS STATUS * [5/5/2017 12:31:44 PM] : Activation of XXXXXXXXXXXXXXXXXXXXXX.application has started. * [5/5/2017 12:31:44 PM] : Processing of deployment manifest has successfully completed. * [5/5/2017 12:31:44 PM] : Installation of the application has started. * [5/5/2017 12:31:44 PM] : Processing of application manifest has successfully completed. * [5/5/2017 12:31:47 PM] : Found compatible runtime version 4.0.30319. * [5/5/2017 12:31:47 PM] : Detecting dependent assembly Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A using Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. * [5/5/2017 12:31:47 PM] : Detecting dependent assembly CrystalDecisions.ReportAppServer.CommonObjectModel, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304, processorArchitecture=msil using CrystalDecisions.ReportAppServer.CommonObjectModel, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, processorArchitecture=msil. * [5/5/2017 12:31:47 PM] : Detecting dependent assembly stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A using stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. * [5/5/2017 12:31:47 PM] : Detecting dependent assembly CrystalDecisions.ReportAppServer.DataDefModel, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304, processorArchitecture=msil using CrystalDecisions.ReportAppServer.DataDefModel, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, processorArchitecture=msil. * [5/5/2017 12:31:47 PM] : Detecting dependent assembly CrystalDecisions.ReportAppServer.ObjectFactory, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304, processorArchitecture=msil using CrystalDecisions.ReportAppServer.ObjectFactory, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, processorArchitecture=msil. * [5/5/2017 12:31:47 PM] : Detecting dependent assembly System.Security.Cryptography.X509Certificates, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A, processorArchitecture=msil using System.Security.Cryptography.X509Certificates, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=msil.
ERROR DETAILS Following errors were detected during this operation. * [5/5/2017 12:31:47 PM] System.Deployment.Application.DependentPlatformMissingException (Unknown subtype) - Unable to install or run the application. The application requires that assembly System.Security.Cryptography.X509Certificates Version 4.0.0.0 be installed in the Global Assembly Cache (GAC) first. - Source: System.Deployment - Stack trace: at System.Deployment.Application.PlatformDetector.VerifyPlatformDependencies(AssemblyManifest appManifest, AssemblyManifest deployManifest, String tempDir) at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp) at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc) at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl) at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
COMPONENT STORE TRANSACTION DETAILS No transaction information is available.