代码之家  ›  专栏  ›  技术社区  ›  nam

MS WORD VSTO加载项:从文件读取清单时发生异常

  •  0
  • nam  · 技术社区  · 4 年前

    在加载过程中,我遇到了以下错误 Microsoft WORD VSTO Add-in 我使用创建的 VS2019 Windows 10 Pro 之前添加量很好。问题:错误的原因是什么,如何解决问题?在网上发现了一些类似的问题(比如 one )但仍然没有运气。

    错误 :

    Name:
    From: file:///C:/DotNet2019/VSTO/MyWORDAddinProj/bin/Debug/MyWORDAddinProj.vsto
    
    ************** Exception Text **************
    System.Deployment.Application.InvalidDeploymentException: Exception reading manifest from file:///C:/DotNet2019/VSTO/MyWORDAddinProj/bin/Debug/MyWORDAddinProj.dll.manifest: the manifest may not be valid or the file could not be opened. ---> System.Deployment.Application.InvalidDeploymentException: Parsing and DOM creation of the manifest resulted in error. Following parsing errors were noticed: 
                -HRESULT:   0x80070c81
                 Start line:    0
                 Start column:  0
                 Host file:      ---> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x80070C81
       at System.Deployment.Internal.Isolation.IsolationInterop.CreateCMSFromXml(Byte[] buffer, UInt32 bufferSize, IManifestParseErrorCallback Callback, Guid& riid)
       at System.Deployment.Application.Manifest.AssemblyManifest.LoadCMSFromStream(Stream stream)
       --- End of inner exception 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)
       --- End of inner exception stack trace ---
       at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.GetManifests(TimeSpan timeout)
       at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.InstallAddIn()
    

    事件查看器显示更详细的信息。除了上述错误外,还显示了以下内容 :

    ************** Loaded Assemblies **************
    mscorlib
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.4180.0 built by: NET48REL1LAST_B
        CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
    ----------------------------------------
    Microsoft.VisualStudio.Tools.Office.Runtime
        Assembly Version: 10.0.0.0
        Win32 Version: 10.0.60828.0
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Office.Runtime/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Office.Runtime.dll
    ----------------------------------------
    System.Core
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.4180.0 built by: NET48REL1LAST_B
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
    ----------------------------------------
    System
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.4001.0 built by: NET48REL1LAST_C
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    Microsoft.VisualStudio.Tools.Applications.Hosting
        Assembly Version: 10.0.0.0
        Win32 Version: 10.0.60828.0
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.Hosting/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.Hosting.dll
    ----------------------------------------
    Microsoft.VisualStudio.Tools.Applications.ServerDocument
        Assembly Version: 10.0.0.0
        Win32 Version: 10.0.60828.0
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.ServerDocument/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.ServerDocument.dll
    ----------------------------------------
    Microsoft.VisualStudio.Tools.Applications.Runtime
        Assembly Version: 10.0.0.0
        Win32 Version: 10.0.60828.0
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.Runtime/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.Runtime.dll
    ----------------------------------------
    System.Windows.Forms
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.4150.0 built by: NET48REL1LAST_C
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System.Drawing
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.3752.0 built by: NET48REL1
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    System.Configuration
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.3752.0 built by: NET48REL1
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    ----------------------------------------
    System.Xml
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.3752.0 built by: NET48REL1
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------
    System.Deployment
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.3752.0 built by: NET48REL1
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Deployment/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Deployment.dll
    ----------------------------------------
    System.Security
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.3752.0 built by: NET48REL1
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Security/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Security.dll
    ----------------------------------------
    
    0 回复  |  直到 4 年前
        1
  •  0
  •   Eugene Astafiev    4 年前

    首先,我建议启用日志记录,然后查看生成的日志,请参阅 Enhanced Logging in ClickOnce Deployment 了解更多信息。

    这种例外情况太多了。。。首先,确保您完成了中描述的所有步骤 Deploy an Office solution by using ClickOnce 文章。但日志可以告诉你更多。此外,您可能会发现 Troubleshoot Office solution deployment 页面有用。

    推荐文章