My app has a Target .NET Framework of 3.0.
I have a PC with a fresh install of Windows XP SP3. Next, I installed .NET Framework 4.0 Full on it.
When I try to run my ClickOnce-deployed app, I get the “Failed to load the runtime” error:
[9/9/2011 11:39:53 AM] System.Runtime.InteropServices.COMException
- Failed to load the runtime. (Exception from HRESULT: 0x80131700)
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.NativeMethods.IClrMetaHostPolicy.GetRequestedRuntime(MetaHostPolicyFlags policyFlags, String binaryPath, IStream configStream, StringBuilder version, Int32& versionLength, StringBuilder imageVersion, Int32& imageVersionLength, Int32& pdwConfigFlags, Guid interfaceId)
at System.Deployment.Application.NativeMethods.GetAssemblyCacheInterface(String CLRVersionString, Boolean FetchRuntimeHost, CCorRuntimeHost& RuntimeHost)
at System.Deployment.Application.PlatformDetector.VerifyPlatformDependencies(AssemblyManifest appManifest, AssemblyManifest deployManifest, String tempDir)
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)
It is my understanding that apps Targeting .NET 3.0 should work on machines that have .NET 4.0 installed. What is causing this error? Must I install .NET Framework 3.5 SP1 on Windows XP Machines?
yes I would install the .NET Framework 3.5 and try again, if it does not work I would install the 3.0 ( Microsoft .NET Framework 3.0 Redistributable Package ).
.NET 3.5 SP1 and .NET 4 are both present in the machines we deploy our applications to.
Edit:
also check these questions:
What .NET Framework version should I ship with; 2, 3, 3.5?
Is .net framework 2.0 required if 3.5 is installed?