Issue Description
#6769 supposedly prevented calling GetType() as a property function, but it does not recognize the name if written with different letter case, e.g. gettype.
Steps to Reproduce
demo.proj:
<Project>
<PropertyGroup>
<foo>aa</foo>
</PropertyGroup>
<Target Name="bb">
<Message Importance="high" Text="$(foo.gettype().FullName)"/>
</Target>
</Project>
dotnet msbuild demo.proj
Expected Behavior
$ dotnet msbuild demo.proj
MSBuild version 17.9.6+a4ecab324 for .NET
demo.proj(7,32): error MSB4185: The function "GetType" on type "System.String" is not available for execution as an MSBuild property function.
Actual Behavior
$ dotnet msbuild demo.proj
MSBuild version 17.9.6+a4ecab324 for .NET
System.String
Analysis
Perhaps a case-insensitive comparison here would fix it:
|
return methodName != "GetType"; |
Alternatively, compare the MemberInfo.Name string after the lookup, rather than the user-specified string. That might be a larger change, though.
Versions & Configurations
MSBuild version 17.9.6+a4ecab324 in .NET SDK 8.0.202
Issue Description
#6769 supposedly prevented calling GetType() as a property function, but it does not recognize the name if written with different letter case, e.g.
gettype.Steps to Reproduce
demo.proj:
dotnet msbuild demo.proj
Expected Behavior
Actual Behavior
Analysis
Perhaps a case-insensitive comparison here would fix it:
msbuild/src/Build/Evaluation/Expander.cs
Line 5287 in a4ecab3
Alternatively, compare the MemberInfo.Name string after the lookup, rather than the user-specified string. That might be a larger change, though.
Versions & Configurations
MSBuild version 17.9.6+a4ecab324 in .NET SDK 8.0.202