ClickOnce应用程序 - 无法加载运行时。 (HRESULT异常:0x80131700)

时间:2012-03-12 15:20:06

标签: clickonce asp.net-4.0

我的ClickOnce应用程序以.NET 4 Client Profile为目标,以减少客户端桌面必须通过网络下载和安装的数量。

但是,当我点击发布页面上的设置按钮时,它会失败,并显示以下错误:

There were no warnings during this operation.

OPERATION PROGRESS STATUS
    * [12/03/2012 11:37:05] : Activation of C:\Users\me\Downloads\desktopapp.application has started.
    * [12/03/2012 11:37:08] : Processing of deployment manifest has successfully completed.
    * [12/03/2012 11:37:08] : Installation of the application has started.
    * [12/03/2012 11:37:08] : Processing of application manifest has successfully completed.
    * [12/03/2012 11:37:29] : Found compatible runtime version 4.0.30319.
    * [12/03/2012 11:37:30] : Request of trust and detection of platform is complete.
    * [12/03/2012 11:37:33] : Downloading of subscription dependencies is complete.
    * [12/03/2012 11:37:33] : Commit of the downloaded application has started.

ERROR DETAILS
    Following errors were detected during this operation.
    * [12/03/2012 11:37:33] System.Runtime.InteropServices.COMException
     - **Failed to load the runtime. (Exception from HRESULT: 0x80131700)**
     - Source: System.Deployment
     - Stack trace:
         at System.Deployment.Application.NativeMethods.GetRequestedRuntimeInfo(String pExe, String pwszVersion, String pConfigurationFile, UInt32 startupFlags, UInt32 runtimeInfoFlags, StringBuilder pDirectory, UInt32 dwDirectory, UInt32& dwDirectoryLength, StringBuilder pVersion, UInt32 cchBuffer, UInt32& dwLength)

客户端计算机正在运行Windows 7,并且已安装.NET 4客户端配置文件 。 问题可能是什么,我该如何解决?

1 个答案:

答案 0 :(得分:2)

我看到HR 0x80131700GetRequestedRuntimeInfo()发出,当它被调用以获取特定版本的.NET运行时。遗憾的是,GetRequestedRuntimeInfo()并不总是返回请求的版本,即使它已安装。更多信息位于 GetRequestedRuntimeInfo Function MSDN)。在这种情况下,请考虑使用 How to: Determine Which .NET Framework Versions Are Installed 中的技术来确定是否安装了适当的.NET框架。