@@ -35,7 +35,9 @@ public static CommandBase FromParseResult(ParseResult parseResult, string? msbui
35
35
"--property:_IsPublishing=true" // This property will not hold true for MSBuild /t:Publish or in VS.
36
36
} ;
37
37
38
- string [ ] fileArgs = parseResult . GetValue ( PublishCommandParser . SlnOrProjectOrFileArgument ) ?? [ ] ;
38
+ string [ ] args = parseResult . GetValue ( PublishCommandParser . SlnOrProjectOrFileArgument ) ?? [ ] ;
39
+
40
+ LoggerUtility . SeparateBinLogArguments ( args , out var binLogArgs , out var nonBinLogArgs ) ;
39
41
40
42
CommonOptions . ValidateSelfContainedOptions ( parseResult . HasOption ( PublishCommandParser . SelfContainedOption ) ,
41
43
parseResult . HasOption ( PublishCommandParser . NoSelfContainedOption ) ) ;
@@ -46,13 +48,15 @@ public static CommandBase FromParseResult(ParseResult parseResult, string? msbui
46
48
47
49
bool noRestore = noBuild || parseResult . HasOption ( PublishCommandParser . NoRestoreOption ) ;
48
50
49
- if ( fileArgs is [ { } arg ] && VirtualProjectBuildingCommand . IsValidEntryPointPath ( arg ) )
51
+ if ( nonBinLogArgs is [ { } arg ] && VirtualProjectBuildingCommand . IsValidEntryPointPath ( arg ) )
50
52
{
51
53
if ( ! parseResult . HasOption ( PublishCommandParser . ConfigurationOption ) )
52
54
{
53
55
msbuildArgs . Add ( "-p:Configuration=Release" ) ;
54
56
}
55
57
58
+ msbuildArgs . AddRange ( binLogArgs ) ;
59
+
56
60
return new VirtualProjectBuildingCommand (
57
61
entryPointFileFullPath : Path . GetFullPath ( arg ) ,
58
62
msbuildArgs : msbuildArgs ,
@@ -68,14 +72,14 @@ public static CommandBase FromParseResult(ParseResult parseResult, string? msbui
68
72
69
73
ReleasePropertyProjectLocator projectLocator = new ( parseResult , MSBuildPropertyNames . PUBLISH_RELEASE ,
70
74
new ReleasePropertyProjectLocator . DependentCommandOptions (
71
- fileArgs ,
75
+ nonBinLogArgs ,
72
76
parseResult . HasOption ( PublishCommandParser . ConfigurationOption ) ? parseResult . GetValue ( PublishCommandParser . ConfigurationOption ) : null ,
73
77
parseResult . HasOption ( PublishCommandParser . FrameworkOption ) ? parseResult . GetValue ( PublishCommandParser . FrameworkOption ) : null
74
78
)
75
79
) ;
76
80
msbuildArgs . AddRange ( projectLocator . GetCustomDefaultConfigurationValueIfSpecified ( ) ) ;
77
81
78
- msbuildArgs . AddRange ( fileArgs ?? [ ] ) ;
82
+ msbuildArgs . AddRange ( args ?? [ ] ) ;
79
83
80
84
msbuildArgs . Insert ( 0 , "-target:Publish" ) ;
81
85
0 commit comments