使用ClickOnce时出现Excel Interop DLL异常

3
我们正在创建一个软件项目(VS 2010,.NET 3.5 SP1),通过Office 2007 PIA使用Excel Interop。我们将其部署到互联网上进行单击安装。在大多数情况下,它都可以正常工作。但最近有一个客户在安装时遇到了问题(请参阅下面的日志文件)。
据我从互联网上了解到,这可能与PIA被另一个应用程序注册有关。
是否有人能提供一些有用的提示(也许还有关于此主题的阅读来源)?
非常感谢!
PLATFORM VERSION INFO
    Windows             : 6.1.7601.65536 (Win32NT)
    Common Language Runtime     : 4.0.30319.269
    System.Deployment.dll       : 4.0.30319.1 (RTMRel.030319-0100)
    clr.dll             : 4.0.30319.269 (RTMGDR.030319-2600)
    dfdll.dll           : 4.0.30319.1 (RTMRel.030319-0100)
    dfshim.dll          : 4.0.31106.0 (Main.031106-0000)

SOURCES
    Deployment url          : http://***/***.application
                        Server      : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
    Deployment Provider url     : http://***/***.application
                        Server      : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
    Application url         : http://***/***.manifest
                        Server      : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0

IDENTITIES
    Deployment Identity     : ***, Version=1.1.0.893, Culture=neutral, PublicKeyToken=b5867eb738db6c5c, processorArchitecture=msil
    Application Identity        : ***, Version=1.1.0.893, Culture=neutral, PublicKeyToken=b5867eb738db6c5c, processorArchitecture=msil, type=win32

APPLICATION SUMMARY
    * Installable application.

ERROR SUMMARY
    Below is a summary of the errors, details of these errors are listed later in the log.
    * Activation of http://***/***.application resulted in exception. Following failure messages were detected:
        + Exception occurred loading manifest from file Microsoft.Office.Interop.Excel.dll: the manifest may not be valid or the file could not be opened. 
        + File Microsoft.Office.Interop.Excel.dll is not a valid Portable Executable (PE) file.
        + File {0} is not a valid Portable Executable (PE) file.

COMPONENT STORE TRANSACTION FAILURE SUMMARY
    No transaction error was detected.

WARNINGS
    There were no warnings during this operation.

OPERATION PROGRESS STATUS
    * [9/20/2012 2:44:56 PM] : Activation of http://***/***.application has started.
    * [9/20/2012 2:44:57 PM] : Processing of deployment manifest has successfully completed.
    * [9/20/2012 2:44:57 PM] : Installation of the application has started.
    * [9/20/2012 2:44:58 PM] : Processing of application manifest has successfully completed.
    * [9/20/2012 2:45:00 PM] : Found compatible runtime version 2.0.50727.
    * [9/20/2012 2:45:00 PM] : Detecting dependent assembly Sentinel.v3.5Client, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=msil using Sentinel.v3.5Client, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=msil.
    * [9/20/2012 2:45:00 PM] : Detecting dependent assembly System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=msil using System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=msil.
    * [9/20/2012 2:45:00 PM] : Detecting dependent assembly WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=msil using WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=msil.
    * [9/20/2012 2:45:00 PM] : Detecting dependent assembly System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=msil using System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=msil.
    * [9/20/2012 2:45:00 PM] : Detecting dependent assembly System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=msil using System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=msil.
    * [9/20/2012 2:45:00 PM] : Request of trust and detection of platform is complete.

ERROR DETAILS
    Following errors were detected during this operation.
    * [9/20/2012 2:45:34 PM] System.Deployment.Application.InvalidDeploymentException (ManifestLoad)
        - Exception occurred loading manifest from file Microsoft.Office.Interop.Excel.dll: the manifest may not be valid or the file could not be opened. 
        - Source: System.Deployment
        - Stack trace:
            at System.Deployment.Application.Manifest.AssemblyManifest.ManifestLoadExceptionHelper(Exception exception, String filePath)
            at System.Deployment.Application.Manifest.AssemblyManifest.LoadFromInternalManifestFile(String filePath)
            at System.Deployment.Application.DownloadManager.ProcessDownloadedFile(Object sender, DownloadEventArgs e)
            at System.Deployment.Application.FileDownloader.DownloadModifiedEventHandler.Invoke(Object sender, DownloadEventArgs e)
            at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
            at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
            at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
            at System.Deployment.Application.DownloadManager.DownloadDependencies(SubscriptionState subState, AssemblyManifest deployManifest, AssemblyManifest appManifest, Uri sourceUriBase, String targetDirectory, String group, IDownloadNotification notification, DownloadOptions options)
            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)
        --- Inner Exception ---
        System.IO.IOException
        - File Microsoft.Office.Interop.Excel.dll is not a valid Portable Executable (PE) file.
        - Source: System.Deployment
        - Stack trace:
            at System.Deployment.Application.PEStream.ConstructFromFile(String filePath, Boolean partialConstruct)
            at System.Deployment.Application.Manifest.AssemblyManifest.LoadFromInternalManifestFile(String filePath)
        --- Inner Exception ---
        System.ComponentModel.Win32Exception
        - File {0} is not a valid Portable Executable (PE) file.
        - Source: System.Deployment
        - Stack trace:
            at System.Deployment.Application.PEStream.DosHeader..ctor(FileStream file)
            at System.Deployment.Application.PEStream.ConstructPEImage(FileStream file, Boolean partialConstruct)
            at System.Deployment.Application.PEStream.ConstructFromFile(String filePath, Boolean partialConstruct)

COMPONENT STORE TRANSACTION DETAILS
    No transaction information is available.

PIA在那台机器上已经损坏了。这种文件损坏问题从来都不是孤立的,最好把机器扔掉,以免浪费您宝贵的时间,也浪费我们的时间。 - Hans Passant
非常感谢您的回复。我会向我们的客户推荐这个。 :-) - fdub
今天又有一位客户报告了同样的问题。虽然可能只是倒霉的巧合,但更有可能不是这样。还有其他想法吗? - fdub
这个问题解决了吗? - FLash
2个回答

1
我们的ClickOnce应用程序记录文件几乎与自己的一模一样,但它在第一个下载的文件上失败了(ClickOnce似乎按字母顺序下载文件)。我们要求用户将我们的应用程序部署的域列入白名单,问题得到解决。 https://answers.atlassian.com/questions/154127/sourcetree-for-windows-install
在我们的商店中,ClickOnce通常用于超级锁定的IT环境(只有我们的软件可用的工厂机器,用户甚至不能将文件保存到他们的桌面),因此将站点列入白名单可以解决各种问题。

我曾经也遇到了同样的问题。最后我在本地安装了软件,然后将在/Users/USER_NAME/AppData中创建的文件夹部署到远程服务器上。这个方法运行良好,应用程序的组件和构建没有任何实际问题。 - Timothy Gonzalez

0

虽然这里是一个已经死了的话题,但由于我刚刚在我的部署中遇到了同样的问题,所以我也要发表一下我的看法。

我的部署日志输出基本上与你的相同:

    * Activation of //***//.application resulted in exception. Following failure messages were detected:
    + Exception occurred loading manifest from file DevExpress.Utils.v17.1.UI.dll: the manifest may not be valid or the file could not be opened. 
    + File DevExpress.Utils.v17.1.UI.dll is not a valid Portable Executable (PE) file.
    + PE file does not have enough data.

我删除了相关的dll引用,重新添加并再次发布。这对我解决了问题。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接