Skip to content

ConfuserEx.CLI cannot use a path with spaces in -out parameter #17

@LamerTex

Description

@LamerTex

Hi I'm trying to use ConfuserEX.CLI in VisualStudio via a PostBuild Event to confuse the output files of the project. This is the script I'm using:
If $(ConfigurationName) == Release+Obfuscated (
$(ProjectDir)..\..\ConfuserEx_bin\Confuser.CLI.exe -n -out=$(TargetDir) $(TargetPath)
)

And it is working fine normally. The problems begin when the paths contains some spaces, to use them I need to add " " so the script become:

If $(ConfigurationName) == Release+Obfuscated (
"$(ProjectDir)..\..\ConfuserEx_bin\Confuser.CLI.exe" -n -out="$(TargetDir)" "$(TargetPath)"
)

In this way the first and third parameters work again (both the Confuser.CLI.exe and the input module "$(TargetPath)" are found), but the second one, the one that specify the output folder, give the following error:

[ERROR] Unknown error occurred. Exception: System.ArgumentException: Characters not valid in the path. in System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional) in System.IO.Path.Combine(String path1, String path2) in Confuser.Core.ConfuserEngine.RunInternal(ConfuserParameters parameters, CancellationToken token) in C:\Users\MatteoTex\Downloads\ConfuserEx-Reborn-master\Confuser.Core\ConfuserEngine.cs:row 92

So I can't use ConfuserEx when the projects has some spaces in its path... I'm doing something wrong or it is a problem with the control for the -out parameter?

Thanks for the attention,
Matteo Tessarotto.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions