@@ -29,7 +29,9 @@ public static CommandBase FromParseResult(ParseResult parseResult, string msbuil
2929 parseResult . GetResult ( BuildCommandParser . SelfContainedOption ) is not null ,
3030 parseResult . GetResult ( BuildCommandParser . NoSelfContainedOption ) is not null ) ;
3131
32- string [ ] fileArgument = parseResult . GetValue ( BuildCommandParser . SlnOrProjectOrFileArgument ) ?? [ ] ;
32+ string [ ] args = parseResult . GetValue ( BuildCommandParser . SlnOrProjectOrFileArgument ) ?? [ ] ;
33+
34+ LoggerUtility . SeparateBinLogArguments ( args , out var binLogArgs , out var nonBinLogArgs ) ;
3335
3436 string [ ] forwardedOptions = parseResult . OptionValuesToBeForwarded ( BuildCommandParser . GetCommand ( ) ) . ToArray ( ) ;
3537
@@ -39,11 +41,11 @@ public static CommandBase FromParseResult(ParseResult parseResult, string msbuil
3941
4042 CommandBase command ;
4143
42- if ( fileArgument is [ { } arg ] && VirtualProjectBuildingCommand . IsValidEntryPointPath ( arg ) )
44+ if ( nonBinLogArgs is [ { } arg ] && VirtualProjectBuildingCommand . IsValidEntryPointPath ( arg ) )
4345 {
4446 command = new VirtualProjectBuildingCommand (
4547 entryPointFileFullPath : Path . GetFullPath ( arg ) ,
46- msbuildArgs : forwardedOptions ,
48+ msbuildArgs : [ .. forwardedOptions , .. binLogArgs ] ,
4749 verbosity : parseResult . GetValue ( CommonOptions . VerbosityOption ) ,
4850 interactive : parseResult . GetValue ( CommonOptions . InteractiveMsBuildForwardOption ) )
4951 {
@@ -65,7 +67,7 @@ public static CommandBase FromParseResult(ParseResult parseResult, string msbuil
6567
6668 msbuildArgs . AddRange ( forwardedOptions ) ;
6769
68- msbuildArgs . AddRange ( fileArgument ) ;
70+ msbuildArgs . AddRange ( args ) ;
6971
7072 command = new RestoringCommand (
7173 msbuildArgs : msbuildArgs ,
0 commit comments