带有 .NET Framework 4.0 的 Windows XP SP3 上的 .NET Framework 3.0 应用程序
我的应用程序的目标 .NET Framework 为 3.0。
我有一台全新安装了 Windows XP SP3 的 PC。接下来,我在其上安装了.NET Framework 4.0 Full。
当我尝试运行 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)
据我了解,面向 .NET 3.0 的应用程序应该在安装了 .NET 4.0 的计算机上运行。是什么导致了这个错误?我必须在 Windows XP 计算机上安装 .NET Framework 3.5 SP1 吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,我会安装 .NET Framework 3.5 并重试,如果它不起作用,我会安装 3.0 ( Microsoft .NET Framework 3.0 可再发行组件包)。
.NET 3.5 SP1 和 .NET 4 都存在于我们部署应用程序的计算机中。
编辑:
还要检查这些问题:
我应该附带什么 .NET Framework 版本; 2、3、3.5?
如果安装了3.5,还需要.net Framework 2.0吗?
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?
正如 Davide Piras 提到的,您需要安装 .NET 3.0。您需要这样做的原因是 .NET 4 不是 3.5/3.0/2.0 库的依赖项超集。
.NET 3.5 是 3.0 库加上一些附加库。
.NET 3.0 是 2.0 库加上一些其他库。
但是,.NET 4 是与 2.0/3.0/3.5 库并行存在的一组全新库。我相信这是 .NET 4 使用比 2.0/3.0/3.5 新的 CLR 运行时的结果。 2.0/3.0/3.5 都使用相同的运行时,因此每个新版本都需要安装以前的版本。
As Davide Piras mentioned you need to install .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 3.5 is 3.0 libraries plus some additional ones.
.NET 3.0 is the 2.0 libraries plus some additional ones
However, .NET 4 is a whole new set of libraries that exist in parallel to the 2.0/3.0/3.5 ones. I believe that this is a result of the .NET 4 using a new CLR runtime than 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.
这是一个 COMException,所以我想说可能是组件设置不正确。
检查“发布”选项卡下的项目属性。在“应用程序文件”中,选中“显示所有文件”并确保您需要的所有文件都标记为“包含”。
在那里,您还可以要求应用程序下载所需的组件(例如适当的框架)。
这种误导性的错误信息过去发生在我身上。也可能只是其他回复所述的框架。
It's a COMException, so I'd say that maybe a component is not properly set.
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.