简体   繁体   English

带有.NET Framework 4.0的Windows XP SP3上的.NET Framework 3.0应用程序

[英].NET Framework 3.0 App on Windows XP SP3 with .NET Framework 4.0

My app has a Target .NET Framework of 3.0. 我的应用程序的Target .NET Framework为3.0。

I have a PC with a fresh install of Windows XP SP3. 我有一台装有全新Windows XP SP3的电脑。 Next, I installed .NET Framework 4.0 Full on it. 接下来,我在其上安装了.NET Framework 4.0 Full。

When I try to run my ClickOnce-deployed app, I get the "Failed to load the runtime" error: 当我尝试运行ClickOnce部署的应用程序时,出现“无法加载运行时”错误:

[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. 我的理解是,针对.NET 3.0的应用程序应该适用于安装了.NET 4.0的计算机。 What is causing this error? 导致此错误的原因是什么? Must I install .NET Framework 3.5 SP1 on Windows XP Machines? 我必须在Windows XP计算机上安装.NET Framework 3.5 SP1吗?

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 Framework 3.5并再试一次,如果它不起作用我会安装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. .NET 3.5 SP1和.NET 4都存在于我们部署应用程序的机器中。

Edit: 编辑:

also check these questions: 还要检查以下问题:

What .NET Framework version should I ship with; 我应该附带什么.NET Framework版本; 2, 3, 3.5? 2,3,3.5?

Is .net framework 2.0 required if 3.5 is installed? 如果安装了3.5,是否需要.net framework 2.0?

As Davide Piras mentioned you need to install .NET 3.0. 正如Davide Piras所说,你需要安装.NET 3.0。 The reason why you need to do is that .NET 4 is not a dependency superset of the 3.5/3.0/2.0 libraries. 您需要做的是.NET 4不是3.5 / 3.0 / 2.0库的依赖超集。

.NET 3.5 is 3.0 libraries plus some additional ones. .NET 3.5是3.0库以及一些额外的库。 .NET 3.0 is the 2.0 libraries plus some additional ones .NET 3.0是2.0库以及一些额外的库

However, .NET 4 is a whole new set of libraries that exist in parallel to the 2.0/3.0/3.5 ones. 但是,.NET 4是一组全新的库,它们与2.0 / 3.0 / 3.5并行存在。 I believe that this is a result of the .NET 4 using a new CLR runtime than 2.0/3.0/3.5. 我相信这是.NET 4使用新的CLR运行时而不是2.0 / 3.0 / 3.5的结果。 The 2.0/3.0/3.5 all use the same runtime, hence each new version required the install of the prior versions. 2.0 / 3.0 / 3.5都使用相同的运行时,因此每个新版本都需要安装以前的版本。

It's a COMException, so I'd say that maybe a component is not properly set. 这是一个COMException,所以我想说可能没有正确设置组件。

Check your project properties under the publish tab. 检查发布选项卡下的项目属性。 In Application Files, check Show All Files and make sure that all you need is marked as included. 在“应用程序文件”中,选中“显示所有文件”,并确保将所有需要标记为已包含。

In there, you can also ask the application to download the required components (such as the proper framework). 在那里,您还可以要求应用程序下载所需的组件(例如适当的框架)。

Such misleading error message happened to me in the past. 过去,我发生了这种误导性的错误信息。 May also just be the framework as the other reply states. 也可能只是作为其他回复的框架。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Windows窗体在Windows Xp sp3上安装时询问.Net Framework 4.5 - Windows Form asking .Net framework 4.5 while installing on Windows Xp sp3 Windows 7出现错误。 Net框架应用程序4.0(使用WinXP SP3编写) - Windows 7 got error. Net framework application 4.0 (written with WinXP SP3) 尝试在带有.net 4.0的XP sp3上运行TLS1.2 - Trying to run TLS1.2 on XP sp3 with .net 4.0 Windows XP .NET Framework 4.0中WPF xaml中的异常 - Exception in WPF xaml in Windows XP .NET Framework 4.0 Windows XP SP3上的wlanAPI - wlanAPI on Windows XP SP3 将 .NET SignalR 客户端(Windows XP/.NET framework 4.0)连接到 signalR v2 服务器 - Connect a .NET SignalR client (Windows XP/.NET framework 4.0) to a signalR v2 server XP中的简单Windows表单应用程序和.NET框架要求 - Simple Windows form app and .NET framework requirements in XP Crystal Report 不适用于基于 .net 框架 4.0 的计算机与 windows xp OS - Crystal Report not working with .net framework 4.0 based computer with windows xp OS 在Windows 8.1中仅在Visual Studio 2012中不显示.Net Framework 3.0、3.5、2.0 - .Net framework 3.0, 3.5 , 2.0 not showing in Visual studio 2012 only 4.0 and 4.5 in windows 8.1 .Net Framework 4.0与Windows Server 2012的兼容性 - .Net Framework 4.0 Compatiblity with Windows Server 2012
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM