您好,我在使用反射加載組件時遇到困難。有時,當有人做一個小程序並使用程序集時,許多防病毒軟件會顯示錯誤/肯定結果。 例如,在此代碼:當我使用反射加載我的組件時,組裝加載失敗
//Load the bytes as an assembly
Assembly exeAssembly = Assembly.Load(decryptedBuffer);
//Execute the assembly
object[] parameters = new object[1];
exeAssembly.EntryPoint.Invoke(null, parameters);
所以我用這樣才反思嘗試:
typeof(Assembly).GetMethod("Load").Invoke(null,new object[] {decryptedBuffer});
但是,我不知道原因,但這引發了我的異常,返回我的後續錯誤:
typeof(Assembly).GetMethod("Load").Invoke(null,new object[] {decryptedBuffer});
Problem signature:
Problem Event Name: CLR20r3
Problem Signature 01: Proof.exe
Problem Signature 02: 1.0.0.0
Problem Signature 03: 591f941f
Problem Signature 04: mscorlib
Problem Signature 05: 4.6.1590.0
Problem Signature 06: 5787ed44
Problem Signature 07: 1037
Problem Signature 08: 60
Problem Signature 09: System.Reflection.AmbiguousMatch
OS Version: 6.1.7601.2.1.0.256.1
Locale ID: 3082
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789
Read our privacy statement online:
http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409
If the online privacy statement is not available, please read our privacy statement offline:
C:\Windows\system32\en-US\erofflps.txt
我的問題是我怎麼可以使用反射來避免假/陽性時我使用的程序集加載..在我檢查的時刻,但一切似乎沒用。
查看此答案以瞭解模糊匹配錯誤。 http://stackoverflow.com/questions/2745853/can-anyone-explain-to-me-why-the-following-code-throws-system-reflection-ambiguo – Srikanth