mkaring / ConfuserEx

An open-source, free protector for .NET applications
https://mkaring.github.io/ConfuserEx/
MIT License
2.36k stars 368 forks source link

Using packer just throws exception at startup #404

Closed uecasm closed 3 years ago

uecasm commented 3 years ago

Steps to Reproduce:

[assembly: Obfuscation(Exclude = false, Feature = "packer:compressor")]
[assembly: Obfuscation(Exclude = false, Feature = "preset(minimum);-anti debug;")]
cd bin\Release
Confuser.CLI -n -o=%CD%\..\Confused %CD%\TestApp.exe

When I try running the resulting exe in the Confused directory, it just throws an exception immediately on startup:

System.Reflection.ReflectionTypeLoadException
  HResult=0x80131602
  Message=Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
  Source=mscorlib
  StackTrace:
   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Reflection.RuntimeModule.GetTypes() in f:\dd\ndp\clr\src\BCL\system\reflection\module.cs:line 1118
   at Main(String[] )

The LoaderExceptions property refers to all of the assemblies that were supposedly packed into the executable.

(Also, assuming this can be fixed, is there a way to exclude specific assemblies from being packed?)

mkaring commented 3 years ago

Is there any way you can send the test application you are using over? The packer would work fine and there are unit tests in place that verify that it is in fact working. So the issue is caused by something specific in your application.

You can exclude assemblies by not adding them to the confuser project. All assemblies that are being protected are packed into one assembly.

github-actions[bot] commented 3 years ago

This issue needs more information and has not had recent activity. Please provide the missing information or it will be closed in 7 days. Thanks!

github-actions[bot] commented 3 years ago

Closing this issue because it needs more information and has not had recent activity. Please re-open this issue if more details can be provided. Thanks!

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.