yck1509 / ConfuserEx

An open-source, free protector for .NET applications
http://yck1509.github.io/ConfuserEx/
Other
3.57k stars 1.63k forks source link

"Failed to resolve a member" for forwarded types #92

Closed bignoncedric closed 9 years ago

bignoncedric commented 10 years ago

Confuser doesn't use the TypeForwardedToAttribute so the type resolution fails in case of forwarded member.

For example:

In that case member resolution fails for public static void MyClass.MyMethod because the Resolution Scope of the signature element ICommand is not the same (PresentationCore in the first assembly and System in the second one)

Here is the exception details:

Failed to resolve a member, check if all dependencies are of correct version.
Exception: dnlib.DotNet.MemberRefResolveException: Could not resolve method: CentiveSolutions.Controls.Wpf.SmallWindowIndeterminatedProgressContent CentiveSolutions.Controls.Wpf.SmallWindow::SetIndeterminatedProgress(System.String,System.Windows.Input.ICommand)
   at dnlib.DotNet.MemberRef.ResolveMethodThrow() in d:\Open Source Projects\ConfuserEx\dnlib\src\DotNet\MemberRef.cs:line 417
   at Confuser.Core.DnlibUtils.ResolveThrow(IMethod method) in d:\Open Source Projects\ConfuserEx\Confuser.Core\DnlibUtils.cs:line 173
   at Confuser.Protections.ReferenceProxy.MildMode.ProcessCall(RPContext ctx, Int32 instrIndex) in d:\Open Source Projects\ConfuserEx\Confuser.Protections\ReferenceProxy\MildMode.cs:line 21
   at Confuser.Protections.ReferenceProxy.ReferenceProxyPhase.ProcessMethod(RPContext ctx) in d:\Open Source Projects\ConfuserEx\Confuser.Protections\ReferenceProxy\ReferenceProxyPhase.cs:line 149
   at Confuser.Protections.ReferenceProxy.ReferenceProxyPhase.Execute(ConfuserContext context, ProtectionParameters parameters) in d:\Open Source Projects\ConfuserEx\Confuser.Protections\ReferenceProxy\ReferenceProxyPhase.cs:line 108
   at Confuser.Core.ProtectionPipeline.ExecuteStage(PipelineStage stage, Action`1 func, Func`1 targets, ConfuserContext context) in d:\Open Source Projects\ConfuserEx\Confuser.Core\ProtectionPipeline.cs:line 134
   at Confuser.Core.ConfuserEngine.RunPipeline(ProtectionPipeline pipeline, ConfuserContext context) in d:\Open Source Projects\ConfuserEx\Confuser.Core\ConfuserEngine.cs:line 216
   at Confuser.Core.ConfuserEngine.RunInternal(ConfuserParameters parameters, CancellationToken token) in d:\Open Source Projects\ConfuserEx\Confuser.Core\ConfuserEngine.cs:line 160
yck1509 commented 10 years ago

Would it be possible to share your binaries privately? If so, please contact me at confuser.net@gmail.com