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
I get this error when I run a msbuild target on my local dev machine:
> "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\amd64\msbuild.exe" C:\Repos\build\ManagementSystem.sln /maxcpucount:4 /nodeReuse:System.Object /p:Configuration=Debug /target:ManagementSystem_Api;ManagementSystem_Api_IntegrationTests;ManagementSystem_Api_UnitTests;ManagementSystem_Application;ManagementSystem_Data;ManagementSystem_Database;ManagementSystem_Domain;ManagementSystem_Domain_Models;ManagementSystem_Integration;ManagementSystem_Processes;ManagementSystem_Test_Common;ManagementSystem_Test_Db;StateMachines
Microsoft (R) Build Engine version 15.5.180.51428 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
MSBUILD : error MSB1042: Node reuse value is not valid. String was not recognized as a valid Boolean..
Switch: System.Object
The example error, above, is from my compile target:
I think the issue is down to the thing that generates the command. NodeReuse is a nullable boolean that is null by default, but is set to true if I use the default msbuild settings, via NukeBuild.Instance.IsLocalBuild. If I explicitly set it false:
> "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\amd64\msbuild.exe" C:\Repos\build\ManagementSystem.sln /maxcpucount:4 /p:Configuration=Debug /target:ManagementSystem_Api;ManagementSystem_Api_IntegrationTests;ManagementSystem_Api_UnitTests;ManagementSystem_Application;ManagementSystem_Data;ManagementSystem_Database;ManagementSystem_Domain;ManagementSystem_Domain_Models;ManagementSystem_Integration;ManagementSystem_Processes;ManagementSystem_Test_Common;ManagementSystem_Test_Db;StateMachines
Microsoft (R) Build Engine version 15.5.180.51428 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
I think Arguments.cs should change from:
public Arguments Add(string argument, bool? condition = true)
{
return Add(argument, condition.HasValue && condition.Value ? new object() : null);
}
nodeReuse is on by default, but my potential fix doesn't allow me to turn it off (see the last output - /nodeReuse:false is missing). I think it should actually be:
@andygjp thanks for the kind words and for raising this issue 😄 Handling boolean arguments was indeed a little incomplete until now. This commit should fix it. Could you review it?
Btw, for resetting NodeReuse you can call ResetNodeReuse. Then neither true or false are passed.
matkoch
changed the title
msbuild target error on local dev machine (v 0.2.0)
Boolean arguments formatted as 'System.Object' in output
Mar 4, 2018
Hi,
Firstly, great tool!
I get this error when I run a msbuild target on my local dev machine:
The example error, above, is from my compile target:
I think the issue is down to the thing that generates the command. NodeReuse is a nullable boolean that is null by default, but is set to true if I use the default msbuild settings, via NukeBuild.Instance.IsLocalBuild. If I explicitly set it false:
The error goes away. The output is:
I think Arguments.cs should change from:
to:
However, I still don't think its right.
nodeReuse is on by default, but my potential fix doesn't allow me to turn it off (see the last output - /nodeReuse:false is missing). I think it should actually be:
That could, potentially, be a change to functionality.
What do you think - is that a change we could make? I could raise a pull request if you like?
Cheers,
Andy
The text was updated successfully, but these errors were encountered: