[英].NET 4.0 gives Unknown Exception on XP but it working good on Windows 7
[英].NET 4.0 Project will not run on Windows xp
我有一個程序,我在Windows 7 64位計算機上使用Visual Studio 2013進行開發。 我有我的項目設置目標框架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機器中不存在。
無論如何,這看起來並不像XP問題.NET 4.0的支持。
看起來它來自你的代碼 - 而不是來自.NET“信封”。
對不起,簡短的回答,
但是如果你不打算顯示任何相關的實際代碼 - 這是我能做的最好的。
更新(看到您的配置后):
---> <binding name="SpecSrvSoapBinding"/>
我認為這是在XP機器上無法加載的。
要對此進行驗證 - 在app.config中注釋此部分並注釋所有使用該部分的代碼,然后嘗試查看是否再次出現相同的錯誤。
您是否嘗試使用英語(en)進行本地化編譯? 我在這個問題中發現了類似的錯誤,希望可以幫助你, 我如何修改我的C#項目文件,以便將Resources.resx編譯到我的UICulture的附屬程序集中?
您的問題是MVS無法找到en的本地化資源 。
日志:DisplayName = IBEdit.resources,版本= 1.0.0.0,Culture = en ,PublicKeyToken = null(完全指定)
改變文化= EN文化= 中性如果可能的話。 對不起,如果我誤導你。
你在Windows的其他地方有四個提到的下載URL文件嗎? 把這些文件放在你提到的release文件夾下,看看發生了什么? 它似乎無法下載那些EXE和DLL執行?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.