MSB4186 diagnostische code
In dit artikel wordt de MSB4186 foutcode beschreven.
Berichttekst
MSB4186: Invalid static method invocation syntax: 'value'. 'value' Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)). Check that all parameters are defined, are of the correct type, and are specified in the right order.
Opmerkingen
Deze fout treedt op wanneer MSBuild een functieaanroep tegenkomt die een ongeldige syntaxis gebruikt voor het aanroepen van een statische methode. In MSBuild moeten statische methoden worden aangeroepen met behulp van de juiste syntaxis: $([FullTypeName]::Method(Parameters))
.
Resolutie
U kunt deze fout oplossen door ervoor te zorgen dat de statische methode wordt aangeroepen met behulp van de juiste syntaxis, inclusief de afsluitende ]
en de ::
:
<PropertyGroup>
<MyProperty>$([ClassName]::MethodName('a', 'b'))</MyProperty>
</PropertyGroup>
Van toepassing op
Alle versies van MSBuild