Expose GetFileHash & VerifyFileHash for .NET Core#3999
Expose GetFileHash & VerifyFileHash for .NET Core#3999rainersigwald merged 1 commit intodotnet:masterfrom
Conversation
rainersigwald
left a comment
There was a problem hiding this comment.
Great catch! Those tasks are new (added in #3398) and not exposed from the v4.0, so only the new lines you're adding make sense.
Can you please delete the existing lines as part of this PR as well?
The implementation of these tasks already existed. However, these tasks are quite new, and their existing ``<UsingTask>`` element referenced the wrong assembly.
|
Yes, I like the bleeding edge :). Thanks for the explanation. I had assumed that .NET Framework MSBuild uses Existing lines deleted. |
|
ah, this explains why I couldn't use these tasks in VS2017 15.8. When will this be shipped (and does it include an update xsd by any chance)? |
|
@japj The fix will be in 16.0 (it should be in Preview 2 released last week). As a workaround for older versions, you can include explicit <UsingTask TaskName="Microsoft.Build.Tasks.GetFileHash" AssemblyName="Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Condition="'$(MSBuildVersion)' < '16.0.360'" />
<UsingTask TaskName="Microsoft.Build.Tasks.VerifyFileHash" AssemblyName="Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Condition="''$(MSBuildVersion)' < '16.0.360'" />
<Target Name="Whatever">
<GetFileHash ... />
</Target>
It does not, but should. Filed #4103. |
|
@rainersigwald great! Thanks for the info and updating the documentation! |
We opted not to retain the typo in the metadata name as a backward-compatibility measure, because the task was new and very difficult to use before #3999.
|
@rainersigwald After fixing some typos, the workaround worked for me: <UsingTask TaskName="Microsoft.Build.Tasks.GetFileHash" AssemblyName="Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Condition="'$(MSBuildVersion)' < '16.0.360'" />
<UsingTask TaskName="Microsoft.Build.Tasks.VerifyFileHash" AssemblyName="Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Condition="'$(MSBuildVersion)' < '16.0.360'" /> |
These tasks already exist in
Microsoft.Build.Tasks.Core.dll, but werenot exposed with a
<UsingTask>. I presume this is an oversight. Incontrast, these tasks are already exposed from
Microsoft.Build.Tasks.v4.0, with a<UsingTask>.