How do you add supportedOS to a Windows click once application manifest?

穿精又带淫゛_ 提交于 2019-12-07 23:15:46

问题


I'm trying to add a supportedOS tag to a click once application manifest. The usual way of doing this for a regular application is to add a app.manifest file to the project containing the supportedOS tag like what you can see below. I removed everything already included in the auto generated click once manifest. Usually a click once application don't need a app.manifest since one is generated for you automatically during the publish step.

<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
  <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
    <application>
      <!-- Windows 7 -->
      <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
    </application>
  </compatibility>
</assembly>

To add a minimal app.manifest to the click once application seem to me to be the correct way to do add the supportedOS tag to the standard click once manifest. When I publish the application the app.manifest content gets merged into the the generated click once application manifest. It looks OK to me.

However when i try to install the Click once application i encounter the following error and I am unable to install.

* [8/26/2015 3:30:38 PM] : Processing of deployment manifest has successfully completed.
    * [8/26/2015 3:30:38 PM] : Installation of the application has started.

ERROR DETAILS
    Following errors were detected during this operation.
    * [8/26/2015 3:30:38 PM] System.InvalidOperationException
        - The 'EndValidation' method cannot not be called when all the elements have not been validated. 'ValidateEndElement' calls corresponding to 'ValidateElement' calls might be missing.
        - Source: System.Xml
        - Stack trace:
            at System.Xml.Schema.XmlSchemaValidator.EndValidation()
            at System.Xml.XsdValidatingReader.Read()
            at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
            at System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest deploymentManifest, String targetDir, Uri deploymentUri, IDownloadNotification notification, DownloadOptions options, Uri& appSourceUri, String& appManifestPath)
            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)

To Recreate: You should be able to recreate this error by creating for example a brand new WPF application with no edits. Add the required publishing information with the publishing wizard on the publish tab on the project properties page. You should now be able to publish and install successfully.

Update: Remove the "Sign the click once manifest" option for the EndValidation error to occur

If you do sign the manifest this error does not seem to occur. What happened to me instead was that it worked for one supportedOS tag, it worked for two, but when i tried to add a third supportedOS tag I ran into this problem posted by Blue instead.

+ Exception reading manifest from <APPPATH>.exe.manifest: the manifest may not be valid or the file could not be opened.
+ The element 'assembly' in namespace 'urn:schemas-microsoft-com:asm.v1' has invalid child element 'SignedInfo' in namespace 'http://www.w3.org/2000/09/xmldsig#'. 
List of possible elements expected: 'dependency' in namespace 'urn:schemas-microsoft-com:asm.v1' 

Question: Can anyone advice me on the correct approach to add supportedOS information to a Click Once application?


回答1:


See How do you add a supported OS to a ClickOnce manifest?, in particular the last answer from Alexy Kozlov, about removing the Vista guid from the compatibility list.



来源:https://stackoverflow.com/questions/32237855/how-do-you-add-supportedos-to-a-windows-click-once-application-manifest

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!