gpt4 book ai didi

c# - .NET 4.0 项目无法在 Windows xp 上运行

转载 作者:太空狗 更新时间:2023-10-29 21:50:17 28 4
gpt4 key购买 nike

我有一个程序正在 Windows 7 64 位计算机上使用 Visual Studio 2013 开发。我将我的项目设置为以 Framework 4.0 为目标,并将我的平台目标设置为 x86。我可以让它在我的 64 位和带有 .NET 4.0 的 Win 7 32 位机器上构建和运行,但它不会在 XP 上运行。

我正在使用 BCL Portability Pack 和 Microsoft Async NuGet 包。我已经在 XP 上安装了 .NET 4.0 的 KB2468871 更新。

我还运行了 Fusion 数据记录器并收到了这个:

*** Assembly Binder Log Entry  (3/14/2014 @ 9:18:05 AM) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from: c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable U:\All_Access\UserName\iBEdit\iBedit64Forms\bin\Release\IBEdit.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: User = USER
LOG: DisplayName = IBEdit.resources, Version=1.0.0.0, Culture=en, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///U:/All_Access/UserName/iBEdit/iBedit64Forms/bin/Release/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = IBEdit.exe
Calling assembly : IBEdit, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: U:\All_Access\UserName\iBEdit\iBedit64Forms\bin\Release\IBEdit.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///U:/All_Access/UserName/iBEdit/iBedit64Forms/bin/Release/en/IBEdit.resources.DLL.
LOG: Attempting download of new URL file:///U:/All_Access/UserName/iBEdit/iBedit64Forms/bin/Release/en/IBEdit.resources/IBEdit.resources.DLL.
LOG: Attempting download of new URL file:///U:/All_Access/UserName/iBEdit/iBedit64Forms/bin/Release/en/IBEdit.resources.EXE.
LOG: Attempting download of new URL file:///U:/All_Access/UserName/iBEdit/iBedit64Forms/bin/Release/en/IBEdit.resources/IBEdit.resources.EXE.
LOG: All probing URLs attempted and failed.

我项目的“Release”文件夹中没有“en”文件夹。这会引起问题吗?它为什么要看那里?

我还需要对我的项目进行任何其他更改吗?

更新:

没有给出异常,只是消息:“iBEdit 遇到问题需要关闭”

这是 AppConfig 代码:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="SpecSrvSoapBinding"/>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://example.com/TCheckWebServices/services/SpecSrv" binding="basicHttpBinding" bindingConfiguration="SpecSrvSoapBinding" contract="DBService.SpecSrv" name="SpecSrv"/>
</client>
</system.serviceModel>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-2.5.19.0" newVersion="2.5.19.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-2.5.19.0" newVersion="2.5.19.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

更新 2:

不是真的成功,但我已经说服管理层,尝试开发此应用程序以与 XP 一起使用是一种浪费,他们应该让我集中精力将我们的机器升级到 Windows 7。

最佳答案

您尝试从 app.config 加载的内容导致了此问题。

也许 app.config 中的文件位置在您的 XP 机器中不存在。

无论如何,这看起来 .Net 4.0 对 XP 问题的支持。
它看起来像是来自您的代码 - 而不是来自 .NET“信封”。

很抱歉回答这么短,
但是,如果您不打算显示任何相关的实际代码 - 这是我能做的最好的。

更新(看到你的配置后):

---> <binding name="SpecSrvSoapBinding"/>我认为这是在 XP 机器上加载失败的原因。

要对此进行验证 - 在 app.config 中标记这部分并标记所有使用该部分的代码,然后尝试查看是否再次出现相同的错误。

关于c# - .NET 4.0 项目无法在 Windows xp 上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22408448/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com