You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently MsBuildArgument constructor accept single string argument.
And this string value is passed to MSBuild command line parameter as is.
So when specified string contains MSBuild special characters
It needs manually escape these characters.
(e.g. When passing list values. It need to escape semicolon(;) char to %3B)
Is it able to handle these special characters inside MsBuildArgument class?
or add [MsBuildArgument constructor] that accept string params to handle multiple values?
Test Code
internalclassProgram{staticvoidMain(string[]args){BenchmarkRunner.Run<Benchmarks>();}}[Config(typeof(CustomConfig))]publicclassBenchmarks{[Benchmark]publicvoidBenchmark01(){
#if TEST1&&TEST2// DefineConstants symbols are defined as expected.
#else
thrownewException("DefineConstants value is unexpected value!");
#endif
}publicclassCustomConfig:ManualConfig{publicCustomConfig(){AddLogger(ConsoleLogger.Default);AddColumnProvider(DefaultConfig.Instance.GetColumnProviders().ToArray());AddJob(Job.ShortRun.WithStrategy(RunStrategy.Monitoring).WithArguments([// new MsBuildArgument("/p:DefineConstants=TEST1;TEST2"), // Error: MSBUILD : error MSB1006: Property is not valid.// new MsBuildArgument("/p:DefineConstants=\"TEST1;TEST2\""), // Double quote does not works.newMsBuildArgument("/p:DefineConstants=TEST1%3BTEST2"),// It works when using MSBuild special character]).WithId("CustomJob"));WithOption(ConfigOptions.KeepBenchmarkFiles,true);// Use this settings for output to JobId folder}}}
The text was updated successfully, but these errors were encountered:
It seems double quote is stripped on .bat execution timing.
So, it need to escape " char also on Windows environment.
(e.g. new MsBuildArgument("/p:DefineConstants=\\\"TEST1;TEST2\\\""))
I'll try to create PR later to resolve this issue.
Currently MsBuildArgument constructor accept single string argument.
And this string value is passed to MSBuild command line parameter as is.
So when specified string contains MSBuild special characters
It needs manually escape these characters.
(e.g. When passing list values. It need to escape semicolon(
;
) char to%3B
)Is it able to handle these special characters inside MsBuildArgument class?
or add [MsBuildArgument constructor] that accept string params to handle multiple values?
Test Code
The text was updated successfully, but these errors were encountered: