1

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.

Athari
  • 33,702
  • 16
  • 105
  • 146
Eniola
  • 710
  • 1
  • 7
  • 23
  • 1
    Have you included the missing Assembly in the *Application Files*? Sometimes the ClickOnce Publish is missing some Assemblies due to no usages inside the application. – Christoph K May 05 '17 at 10:39
  • @Christoph, yes, I have done that. It didn't help. In examining the IL of these assemblies, I noticed this attribute: [assembly: AssemblyMetadata(".NETFrameworkAssembly", "")] Could that play a part in what ClickOnce chooses to insist on? This will be just wrong because the changed surface area of ReferenceAssemblies doesn't include some of the recent refactorings available via nuget. – Eniola May 05 '17 at 10:44
  • well depending on the fact that you're targeting the exact assembly from the ClickOnce Setup it shouldn't insist on this attribute. Have you tried localize the ClickOnce LogFile, maybe there are some more information which can help you solve this case. – Christoph K May 05 '17 at 10:53
  • @Christoph, I am updating my question with the information from the logs. – Eniola May 05 '17 at 11:39
  • Does the System.Security.Cryptography.X509Certificates Assembly exist in your ClickOnce Publish Folder? Otherwise take a look at [this](http://stackoverflow.com/questions/11505535/unable-to-install-or-run-the-application-click-once/11563401#11563401) – Christoph K May 05 '17 at 11:48
  • @Christoph, I took the pains of adding all packages again and publishing the app all over. Yes the assemblies are in the publish location and yes Included them from the Application Files dialog box. It is the same story I am getting. – Eniola May 05 '17 at 13:32
  • Is descirbed behavior consistent across multiple client PCs? Is it independent to user rights to client PC? Could you verify that you are/you are not able to run application that was extracted during installation process directly by invoking *.exe file? – rudolf_franek Jan 10 '18 at 17:22

0 Answers0