1

我正在尝试在 asp.net 应用程序(C# .Net 4)上使用 Obfuscar

所以我只想混淆一个dll。此 dll MyApp.Secure.dll 在由 global.asax 启动的应用程序上加载

当我的 dll 没有被混淆时,一切正常,但如果被混淆,我会遇到错误

[TypeLoadException: Could not load type 'MyApp.Secure.Securilizer' from assembly 'MyApp.Secure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.]
 MyApp.PL.Global..ctor() in c:\Users\me\Desktop\myapp\MyApp.PL\Global.asax.cs:12
ASP.global_asax..ctor() in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary  ASP.NET Files\analytics\a055a403\d63b5acc\App_global.asax.zykrw1d6.0.cs:0

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +159
System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +256
System.Activator.CreateInstance(Type type, Boolean nonPublic) +127
System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +14259449
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +200
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +28
System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +83
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +312
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475

[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12968244
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12807949

我使用了一个非常简单的配置文件和 obfuscar2.0rc7

<?xml version="1.0"?>
<Obfuscator>
  <Var name="InPath" value="MyApp.Secure\bin\Release" />
  <Var name="OutPath" value="MyApp.PL\bin" /> 

  <Module file="$(InPath)\MyApp.Secure.dll" />
</Obfuscator>

我做错了什么吗?

编辑:你能告诉我如何调试它吗?

4

0 回答 0