次の方法で共有


A device attached to the system is not functioning

ClickOnce application may fail with the following error message:

A device attached to the system is not functioning. (Exception from HRESULT: 0x8007001F)

As per the ClickOnce log:

                                 + Exception reading manifest from : the manifest may not be valid or the file could not be opened.

                                + Parsing and DOM creation of the manifest resulted in error. Following parsing errors were noticed:

                                                -HRESULT: 0x8007001f

                                                Start line: 0

                                                Start column: 0

                                                Host file:            

                                + A device attached to the system is not functioning. (Exception from HRESULT: 0x8007001F)

Stack Trace:

                --- Inner Exception ---

                                System.Deployment.Application.InvalidDeploymentException (ManifestParse)

                                - Parsing and DOM creation of the manifest resulted in error. Following parsing errors were noticed:

                                                -HRESULT: 0x8007001f

                                                Start line: 0

                                                Start column: 0

                                                Host file:            

                                - Source: System.Deployment

                                - Stack trace:

                                                at System.Deployment.Application.Manifest.AssemblyManifest.LoadCMSFromStream(Stream stream)

                                                at System.Deployment.Application.Manifest.AssemblyManifest..ctor(FileStream fileStream)

                                                at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)

                                --- Inner Exception ---

                                System.Runtime.InteropServices.COMException

                                - A device attached to the system is not functioning. (Exception from HRESULT: 0x8007001F)

                                - Source: System.Deployment

                                - Stack trace:

                                                at System.Deployment.Internal.Isolation.IsolationInterop.CreateCMSFromXml(Byte[] buffer, UInt32 bufferSize, IManifestParseErrorCallback Callback, Guid& riid)

                                                at System.Deployment.Application.Manifest.AssemblyManifest.LoadCMSFromStream(Stream stream)

 After debugging, I found that the following lines were included in the app.manifest file:

<?xml version="1.0" encoding="utf-8"?>

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >

  <asmv3:application>

    <asmv3:windowsSettings xmlns="https://schemas.microsoft.com/SMI/2005/WindowsSettings">

     <dpiAware>true</dpiAware>

    </asmv3:windowsSettings>

  </asmv3:application>

</assembly>  

 

The above lines are needed to declare a DPI-aware application.This is a new element in a new namespace, so ClickOnce runtime is not compatible with it. Installing ClickOnce published applications is not possible if there is a tag in the manifest file about the dpi-awareness. This is not something that ClickOnce explicitly supports. So you may need to exclude the DPI-aware part for ClickOnce deployment. Alternatively, you may try calling SetProcessDPIAware function though it is not recommended.

Comments

  • Anonymous
    October 30, 2014
    Thank you! I finally understood what was happening.