question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Argument null exception in MSBuild condition

See original GitHub issue

When I try to compile a project I get the following output:

Invoke-Expression : Das Argument kann nicht an den Parameter "Command" gebunden werden, da es NULL ist.In 
D:\Users\muellerj\AppData\Local\Microsoft\VisualStudio\15.0_00aec18c\Extensions\mlnt0wvb.2aa\clang-build.ps1:1066 Zeichen:36
+   [bool] $res = (Invoke-Expression $expression) -eq $true
+                                    ~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Invoke-Expression], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.InvokeExpressionCommand

Is there some verbosity switch, so that I can check which expression is causing the issue?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
hero101111commented, Dec 13, 2017

Hi,

I’ve pushed a fix for these issues. Grab the latest clang-build.ps1 from Github and let us know if it solves your project specific issues.

Regards, Gabriel


This fix is currently live only for the github repository. The latest Visual Studio extension (2.2) does not contain the fix. It will be included in the next release.

Until then, as a workaround, you can manually replace clang-build.ps1 in the VS extension directory with the latest from github. To locate the extension directory search for clang-build.ps1 in %LOCALAPPDATA%

Don’t forget to restart Visual Studio after replacing the script file.

1reaction
hero101111commented, Dec 12, 2017

Hi,

Indeed, the issue arose from the $(Selector.Contains(Three)) expression. Three here is intended to be a string, but since there no quotes the interpreter thinks it’s a command or a variable.

We do not support string values that are not wrapped in quotes.

To get your project to compile just wrap Three in single quotes, as follows: $(MySelector.Contains('Three'))

I’ve tested and it works in both Visual C++ and ClangPowerTools.

Regards, Gabriel

Read more comments on GitHub >

github_iconTop Results From Across the Web

MSBUILD complains about the null conditional operator
I have an MSBUILD project that complains about the null conditional syntax. BuildResult buildResult = BuildManager.DefaultBuildManager.
Read more >
MSBuild Conditions
In MSBuild project files, there's no true Boolean type. Boolean data is represented in properties that might be empty or set to any...
Read more >
MSB4017 InternalLoggerException System. ...
ArgumentNullException: Parameter "projectProperty" cannot be null. 2020-04-10T13:54:36.4710517Z at Microsoft.Build.Shared.ErrorUtilities.
Read more >
C# 8: Nullable Reference Types
The last conditional post-conditions is [NotNullIfNotNull] . It indicates that the return value is not null when a specific parameter is not ...
Read more >
API - DotNetMSBuildSettings Class
Name Value Summary WithToolPath(FilePath) T Sets the tool path. From ToolSettingsExtensions WithToolTimeout(TimeSpan) T Sets the tool timeout. From ToolSettingsExtensions
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found