yck1509 / ConfuserEx

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

Confuser.Cli fails with NullRefereenceException #148

Closed derekbartram closed 9 years ago

derekbartram commented 9 years ago

Running Confuser.CLI.exe generates...

[ERROR] Unknown error occurred. Exception: System.NullReferenceException: Object reference not set to an instance of an object. at Confuser.Core.ConfuserEngine.RunInternal(ConfuserParameters parameters, CancellationToken token) in c:\projects\confuserex\Confuser.Core\ConfuserEngine.cs:line 79 Failed at 12:07, 0:00 elapsed.

context.BaseDirectory = Path.Combine(Environment.CurrentDirectory, parameters.Project.BaseDirectory.TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar);

As an annoying secondary issue, when running from a Cruise Control .Net build with NANT, this causes a 'press enter to close' prompt which then locks the build up.

yck1509 commented 9 years ago

I cannot not reproduce the error here. What command line arguments did you used? You can specifies "-n" option to have no pause when it finishes. (Note that this function is broken at the moment, you can get the fixed version at the build server)

derekbartram commented 9 years ago

I just used Confuser.CLI.exe Unfortunately I cannot give you the actual paths and file names for commercial reasons. The input dll is a .Net 3.5 assembly which has references to other files in the same directory. The source and output directories are both on the c drive.

Problem occurs both from NANT and from user command line.

The -n flag is useful to know, thanks.

yck1509 commented 9 years ago

I suppose you're using declarative obfuscation? Most likely it is caused by invalid input arguments. Please check if your command line matches the syntax:

Confuser.CLI.exe -o <output directory> <input files>

For example:

Confuser.CLI.exe -o C:\App\Confused C:\App\Application.exe
derekbartram commented 9 years ago

User error... was missing the -o flag.