ClickOnce installation generates error: System.Runtime.InteropServices.COMException, Failed to load the runtime, Exception from HRESULT: 0x80131700

Felpudo picture Felpudo · Mar 5, 2013 · Viewed 9.1k times · Source

This error occurs trying to deploy a WPF project through ClickOnce:

Activation of [...file path...].application resulted in exception. Following failure messages were detected: Failed to load the runtime. (Exception from HRESULT: 0x80131700)

and

System.Runtime.InteropServices.COMException -Failed to load the runtime. (Exception from HRESULT: 0x80131700) - Source: System.Deployment.

Until recently, the project targeted the 32 bit .NET Framework 4 Client Profile, and installed smoothly on all machines. Then we had to switch to .NET Framework 4 full profile because we began including Crystal Reports, which won’t do with just the client profile.

The .NET Framework 4 full profile installer that we began applying on client machines targets both 32 and 64 bits operating systems. However, the WPF project is compiled specifically for 32 bits, for some reason I currently do not recall. The machines where the application is deployed run Windows 7 64-bit Enterprise with service pack 1. To deploy the new version targeting .NET Framework full profile, we first installed Crystal Reports in the client machines and also installed .NET Framework 4 full profile for those machines that only had the client profile, and then updated the ClickOnce installer for users to download the new application.

The first thing to highlight is that the ClickOnce update of the WPF application went smoothly for some machines, whereas for others it breaks right after downloading the installation files and before installing. We haven’t been able to identify what it is that makes the difference.

Regarding exception 0x80131700, there are several forum publications and blogs that mention installing .NET Framework 3.5 service pack 1. Apparently, however, both machines where the installation breaks and those where it updates fine have it installed. Additionally, we haven’t been able to get a .NET Framework version 3.5 with SP1 installer that works: the bootstrapper just hangs, while the full package throws an “File is corrupt” exception while unzipping installation files! It is also worth noting that the WPF application also requires the Microsoft .NET Framework 4 Platform Update 1 - Runtime Update (KB2478063), but that’s been the case since the first release, several months ago and we did not have a problem with that one before.

We have gone through many forum and blog posts regarding the “System.Runtime.InteropServices.COMException” exception, as well as the “Failed to load the runtime (Exception from HRESULT: 0x80131700)” one. But so far, we haven’t been able to pinpoint what is it that lets the latest version of our application install perfectly in some machines, while we get the aforementioned behavior in others, in an environment where apparently all machines, being part of a corporate network, share pretty much the same configuration.

And we haven’t been able to solve the problem either.

I will now post the full error log generated while trying to install our WPF application in those machines where it won’t work (it’s in Spanish, sorry):

INFORMACIÓN DE VERSIÓN DE LA PLATAFORMA
  Windows                : 6.1.7601.65536 (Win32NT)
  Common Language Runtime: 4.0.30319.296
  System.Deployment.dll  : 4.0.30319.1 (RTMRel.030319-0100)
  clr.dll                : 4.0.30319.296 (RTMGDR.030319-2900)
  dfdll.dll              : 4.0.30319.1 (RTMRel.030319-0100)
  dfshim.dll             : 4.0.31106.0 (Main.031106-0000)

ORÍGENES
  Dirección URL de la implementación: file:///C:/Users/cacortes/Desktop/IntegraSF.appref-ms%7C
  Dirección URL del proveedor de la implementación:
    file://consarteam/IntegraSF_Produccion/IntegraSF_Aplicaci%C3%B3nCliente.application
  Dirección URL de la aplicación:
    file://consarteam/IntegraSF_Produccion/Application%20Files/IntegraSF_Aplicaci%C3%B3nCliente_1_0_0_34/IntegraSF_Aplicaci%C3%B3nCliente.exe.manifest

IDENTIDADES
  Identidad de la aplicación: IntegraSF_AplicaciónCliente.exe, Version=1.0.0.34, Culture=neutral,
    PublicKeyToken=4e797c2fd9dcb050, processorArchitecture=x86, type=win32

RESUMEN DEL ERROR
  Abajo se muestra un resumen de los errores; los detalles de estos errores se incluyen en el registro.
  * La activación de C:\Users\cacortes\Desktop\IntegraSF.appref-ms| dio como resultado una excepción. Se detectaron los siguientes mensajes de error:
      + Error al cargar el tiempo de ejecución. (Excepción de HRESULT: 0x80131700)

RESUMEN DE ERRORES DE TRANSACCIÓN DEL ALMACÉN DE COMPONENTES
  No se detectó ningún error de transacción.

ADVERTENCIAS
  No se generó ninguna advertencia durante esta operación.

ESTADO DE PROGRESO DE LA OPERACIÓN
  * [04/03/2013 02:04:57 p.m.]: Se ha iniciado la activación de C:\Users\cacortes\Desktop\IntegraSF.appref-ms|.
  * [04/03/2013 02:04:57 p.m.]: Realizando la comprobación de actualización necesaria según las especificaciones de la implementación.
  * [04/03/2013 02:04:57 p.m.]: Consumiendo nueva actualización.
  * [04/03/2013 02:05:00 p.m.]: Se ha iniciado la instalación de la aplicación.
  * [04/03/2013 02:05:00 p.m.]: Ha finalizado correctamente el procesamiento del manifiesto de la aplicación.
  * [04/03/2013 02:05:00 p.m.]: Se ha encontrado una versión del motor en tiempo de ejecución compatible 4.0.30319.
  * [04/03/2013 02:05:00 p.m.]: Detectando ensamblado independiente CrystalDecisions.ReportAppServer.CommonObjectModel,
Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304,
  processorArchitecture=msil utilizando
  CrystalDecisions.ReportAppServer.CommonObjectModel,
  Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304,
  processorArchitecture=msil.

* [04/03/2013 02:05:00 p.m.] : Detectando ensamblado independiente stdole, Version=7.0.3300.0, Culture=neutral,
    PublicKeyToken=B03F5F7F11D50A3A utilizando stdole, Version=7.0.3300.0,
    Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.

* [04/03/2013 02:05:00 p.m.] : Detectando ensamblado independiente CrystalDecisions.ReportAppServer.DataDefModel,
    Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304,
    processorArchitecture=msil utilizando
    CrystalDecisions.ReportAppServer.DataDefModel, Version=13.0.2000.0,
    Culture=neutral, PublicKeyToken=692fbea5521e1304,
    processorArchitecture=msil.

* [04/03/2013 02:05:00 p.m.] : Detectando ensamblado independiente CrystalDecisions.ReportAppServer.ObjectFactory,
    Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304,
    processorArchitecture=msil utilizando
    CrystalDecisions.ReportAppServer.ObjectFactory, Version=13.0.2000.0,
    Culture=neutral, PublicKeyToken=692fbea5521e1304,
    processorArchitecture=msil.

* [04/03/2013 02:05:00 p.m.] : Detectando ensamblado independiente CrystalDecisions.ReportAppServer.ReportDefModel,
    Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304,
    processorArchitecture=msil utilizando
    CrystalDecisions.ReportAppServer.ReportDefModel, Version=13.0.2000.0,
    Culture=neutral, PublicKeyToken=692fbea5521e1304,
    processorArchitecture=msil.

* [04/03/2013 02:05:00 p.m.] : Detectando ensamblado independiente CrystalDecisions.Shared, Version=13.0.2000.0,
    Culture=neutral, PublicKeyToken=692FBEA5521E1304,
    processorArchitecture=msil utilizando CrystalDecisions.Shared,
    Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304,
    processorArchitecture=msil.

* [04/03/2013 02:05:01 p.m.] : Detectando ensamblado independiente CrystalDecisions.ReportAppServer.CubeDefModel,
    Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304,
    processorArchitecture=msil utilizando
    CrystalDecisions.ReportAppServer.CubeDefModel, Version=13.0.2000.0,
    Culture=neutral, PublicKeyToken=692fbea5521e1304,
    processorArchitecture=msil.

* [04/03/2013 02:05:01 p.m.] : Detectando ensamblado independiente SAPBusinessObjects.WPF.ViewerShared,
    Version=13.0.3500.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304,
    processorArchitecture=msil utilizando
    SAPBusinessObjects.WPF.ViewerShared, Version=13.0.3500.0,
    Culture=neutral, PublicKeyToken=692fbea5521e1304,
    processorArchitecture=msil.

* [04/03/2013 02:05:01 p.m.] : Detectando ensamblado independiente CrystalDecisions.ReportAppServer.CommLayer,
    Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304,
    processorArchitecture=msil utilizando
    CrystalDecisions.ReportAppServer.CommLayer, Version=13.0.2000.0,
    Culture=neutral, PublicKeyToken=692fbea5521e1304,
    processorArchitecture=msil.

* [04/03/2013 02:05:01 p.m.] : Detectando ensamblado independiente CrystalDecisions.ReportAppServer.ClientDoc,
    Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304,
    processorArchitecture=msil utilizando
    CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0,
    Culture=neutral, PublicKeyToken=692fbea5521e1304,
    processorArchitecture=msil.

* [04/03/2013 02:05:01 p.m.] : Detectando ensamblado independiente FlashControlV71, Version=1.0.3187.32366,
    Culture=neutral, PublicKeyToken=692FBEA5521E1304 utilizando
    FlashControlV71, Version=1.0.3187.32366, Culture=neutral,
    PublicKeyToken=692fbea5521e1304.

* [04/03/2013 02:05:01 p.m.] : Detectando ensamblado independiente SAPBusinessObjects.WPF.Viewer, Version=13.0.3500.0,
    Culture=neutral, PublicKeyToken=692FBEA5521E1304,
    processorArchitecture=msil utilizando SAPBusinessObjects.WPF.Viewer,
    Version=13.0.3500.0, Culture=neutral, PublicKeyToken=692fbea5521e1304,
    processorArchitecture=msil.

* [04/03/2013 02:05:01 p.m.] : Detectando ensamblado independiente CrystalDecisions.ReportAppServer.Prompting,
    Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304,
    processorArchitecture=msil utilizando
    CrystalDecisions.ReportAppServer.Prompting, Version=13.0.2000.0,
    Culture=neutral, PublicKeyToken=692fbea5521e1304,
    processorArchitecture=msil.

* [04/03/2013 02:05:01 p.m.] : Detectando ensamblado independiente CrystalDecisions.ReportAppServer.XmlSerialize,
    Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304,
    processorArchitecture=msil utilizando
    CrystalDecisions.ReportAppServer.XmlSerialize, Version=13.0.2000.0,
    Culture=neutral, PublicKeyToken=692fbea5521e1304,
    processorArchitecture=msil.

* [04/03/2013 02:05:01 p.m.] : Detectando ensamblado independiente CrystalDecisions.ReportAppServer.CommonControls,
    Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304,
    processorArchitecture=msil utilizando
    CrystalDecisions.ReportAppServer.CommonControls, Version=13.0.2000.0,
    Culture=neutral, PublicKeyToken=692fbea5521e1304,
    processorArchitecture=msil.

* [04/03/2013 02:05:01 p.m.] : Detectando ensamblado independiente log4net, Version=1.2.10.0, Culture=neutral,
    PublicKeyToken=692FBEA5521E1304, processorArchitecture=x86 utilizando
    log4net, Version=1.2.10.0, Culture=neutral,
    PublicKeyToken=692fbea5521e1304, processorArchitecture=x86.

* [04/03/2013 02:05:01 p.m.] : Detectando ensamblado independiente CrystalDecisions.ReportSource, Version=13.0.2000.0,
    Culture=neutral, PublicKeyToken=692FBEA5521E1304,
    processorArchitecture=msil utilizando CrystalDecisions.ReportSource,
    Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304,
    processorArchitecture=msil.

* [04/03/2013 02:05:01 p.m.] : Detectando ensamblado independiente CrystalDecisions.ReportAppServer.Controllers,
    Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304,
    processorArchitecture=msil utilizando
    CrystalDecisions.ReportAppServer.Controllers, Version=13.0.2000.0,
    Culture=neutral, PublicKeyToken=692fbea5521e1304,
    processorArchitecture=msil.

* [04/03/2013 02:05:01 p.m.] : Detectando ensamblado independiente CrystalDecisions.ReportAppServer.DataSetConversion,
    Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304,
    processorArchitecture=msil utilizando
    CrystalDecisions.ReportAppServer.DataSetConversion,
    Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304,
    processorArchitecture=msil.

* [04/03/2013 02:05:01 p.m.] : Detectando ensamblado independiente CrystalDecisions.CrystalReports.Engine,
    Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304,
    processorArchitecture=msil utilizando
    CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0,
    Culture=neutral, PublicKeyToken=692fbea5521e1304,
    processorArchitecture=msil.

* [04/03/2013 02:05:02 p.m.] : Detectando ensamblado independiente ShockwaveFlashObjects, Version=1.0.0.0, Culture=neutral,
    PublicKeyToken=692FBEA5521E1304 utilizando ShockwaveFlashObjects,
    Version=1.0.0.0, Culture=neutral, PublicKeyToken=692fbea5521e1304.

                * [04/03/2013 02:05:02 p.m.] : Ha finalizado la solicitud de confianza y detección de plataforma.
                * [04/03/2013 02:05:05 p.m.] : Finalizó la descarga de las dependencias de la suscripción.
                * [04/03/2013 02:05:05 p.m.] : Se ha iniciado la confirmación de la aplicación descargada.

DETALLES DEL ERROR
  Se detectaron los siguientes errores durante esta operación.
  * [04/03/2013 02:05:06 p.m.] System.Runtime.InteropServices.COMException
                 - Error al cargar el tiempo de ejecución. (Excepción de HRESULT: 0x80131700)
                 - Origen: System.Deployment
                 - Seguimiento de la pila:
       en 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)

en System.Deployment.Application.Win32InterOp.SystemUtils.CheckSupportedImageAndCLRVersions(String path)
en System.Deployment.Application.SubscriptionStore.CheckApplicationPayload(CommitApplicationParams commitParams)
en System.Deployment.Application.SubscriptionStore.CommitApplication(SubscriptionState&subState, CommitApplicationParams commitParams)
en System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState&subState, ActivationDescription actDesc)
en System.Deployment.Application.ApplicationActivator.ConsumeUpdatedDeployment(SubscriptionState&subState, ActivationDescription actDesc)
en System.Deployment.Application.ApplicationActivator.PerformDeploymentUpdate(SubscriptionState&subState, String& errorPageUrl)
en System.Deployment.Application.ApplicationActivator.ProcessOrFollowShortcut(String shortcutFile, String& errorPageUrl, TempFile& deployFile)
en System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(UriactivationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
en System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)

DETALLES DE TRANSACCIÓN DEL ALMACÉN DE COMPONENTES
  No hay información disponible sobre la transacción.

Answer

Felpudo picture Felpudo · Mar 8, 2013

We have resolved this issue in a manner which suffices our needs in the timeframe we had. For anyone interested in finding out what we did: After installing Crystal Reports runtime for .NET 32 bit, we ended up uninstalling .NET 4 frameworks: both client and full profile; reinstalling them in that same order, and then reinstalling KB2478063. We also installed applicable recommended updates from Microsoft after reinstalling .NET framework. That did the trick for us. However, I also received this response from a Microsoft MVP, which I share with you: link .