4

爲了支持XP,我的其中一個項目現在針對.NET 4.0,並使用Microsoft.Bcl.Async作爲.NET 4.5的異步功能。無法將Dotfuscator與Microsoft.Bcl.Async應用程序一起使用

問題是,我不再能夠使用Dotfuscator(無論是專業版還是包含在VS 2012中的社區版)混淆得到的應用程序。

當試圖運行可執行混淆的程序,出現以下錯誤崩潰:

Could not load type 'System.Object' from assembly 'System.Runtime, Version=2.5.19.0

這個錯誤似乎來自受Microsoft.Bcl.Async需要在app.config設置分別是:

<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> 

似乎有人遇到了類似的問題,使用different obfuscation software這是由廠商修復。

有什麼我可以做的,以解決這個問題?或者這是Dotfuscator的問題? (當然是公平的,所有的麻煩真的源於微軟不能在XP支持.NET 4.5 ...)

+0

嗯......有趣。我不知道Bcl.Async庫是以這種方式工作的。我必須嘗試一下,看看我能否找到解決方法和/或在內部提交錯誤 – Earlz

+1

「我不再能夠使用Dotfuscator混淆得到的應用程序」。您是否能夠在Windows XP上運行生成的應用程序(而不是在裝有.NET4.5/VS2012的機器上)而不進行混淆? –

+0

@Геннадий-Ванин - 是的,應用程序在混淆之前可以在XP和其他版本的Windows上正常工作,但是在混淆之後它不適用於任何機器。 –

回答

2

此問題已得到修復爲Dotfuscator的版本4.10.2(今天發佈):http://www.preemptive.com/support/dotfuscator-support/dotfuscator-pro-change-log/520

根本原因是由於框架的ilasm實用程序引起的問題:https://connect.microsoft.com/VisualStudio/feedback/details/801891/ilasm-incorrectly-updates-references-from-mscorlib-to-system-runtime-for-certain-types-when-system-runtime-is-included

如果由於某些原因您無法更新,在安裝了.NET 4.0的系統上運行模糊處理也應該足夠。

相關問題