. net 4.0项目将无法在Windows xp上运行

本文关键字:Windows xp 运行 项目 net | 更新日期: 2023-09-27 17:50:27

我有一个程序,我正在Windows 7 64位机器上使用Visual Studio 2013开发。我有我的项目设置目标框架4.0和我的平台目标为x86。我可以让它在我的64位机器上运行,也可以在装有。net 4.0的win7 32位机器上运行,但它不能在XP上运行。

我正在使用BCL可移植性包和微软异步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。

. net 4.0项目将无法在Windows xp上运行

你试图从app.config中加载的东西导致这个

可能是app.config中不存在的文件位置。

无论如何,看起来像。net 4.0支持XP的问题。
它看起来像是来自你的代码——而不是来自。net"信封"。

很抱歉简短的回答,
但是如果你不打算展示任何相关的实际代码——这是我能做的最好的了。

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

-> <binding name="SpecSrvSoapBinding"/>我想这就是XP机器无法加载的原因。

要验证它-从app.config中标记这一部分,并标记所有使用它的代码,然后尝试看看是否会再次出现相同的错误。

是否尝试编译本地化的英文(en)?在这个问题中我发现了类似的错误,希望能对你有所帮助。我如何修改我的c#项目文件,使资源。resx被编译成我的UICulture?

您的问题是MVS找不到en本地化资源

LOG: DisplayName = IBEdit。资源,版本=1.0.0.0,文化= en,都为空(完全指定的)

如果可能的话,将Culture= en改为Culture= neutral。对不起,如果我误导了你。 旧

您的windows的其他地方有上述四个下载URL文件吗?把这些文件放在你的发布文件夹下,看看会发生什么?似乎不能下载那些exe和dll来执行?