Argument null exception in MSBuild condition
See original GitHub issueWhen 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:
- Created 6 years ago
- Comments:9 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 forclang-build.ps1
in%LOCALAPPDATA%
Don’t forget to restart Visual Studio after replacing the script file.
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