Issue Description
I'm hitting a bug when consuming a custom project SDK target (http://nuget.org/packages/h5.target):
Invalid static method invocation syntax: "[MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)', 2)". Method '[MSBuild]::GetTargetFrameworkVersion' not found. 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. C:\Program Files\dotnet\sdk\5.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets
The code in the targets file that seems to be triggering this issue is the following:
<PropertyGroup Condition="'$(TargetFramework)' != '' and ('$(TargetFrameworkIdentifier)' == '' or '$(TargetFrameworkVersion)' == '')">
<TargetFrameworkIdentifier>$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)'))</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)', 2))</TargetFrameworkVersion>
</PropertyGroup>
If I manually force the properties to the expected (or dummy) values, so that we avoid the GetTargetFrameworkIdentifier, GetTargetFrameworkVersion, GetTargetPlatformIdentifier and GetTargetPlatformVersion calls above:
<TargetFrameworkIdentifier>.NETStandard</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetPlatformIdentifier>h5</TargetPlatformIdentifier>
<TargetPlatformVersion>2.0</TargetPlatformVersion>
Then the compilation using MSBuild works fine.
Any ideas?
Issue Description
I'm hitting a bug when consuming a custom project SDK target (http://nuget.org/packages/h5.target):
The code in the targets file that seems to be triggering this issue is the following:
If I manually force the properties to the expected (or dummy) values, so that we avoid the GetTargetFrameworkIdentifier, GetTargetFrameworkVersion, GetTargetPlatformIdentifier and GetTargetPlatformVersion calls above:
Then the compilation using MSBuild works fine.
Any ideas?