Skip to content

Commit

Permalink
Add workaround to sample projects (#576)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyGerlicher committed Sep 25, 2024
1 parent 64721c9 commit fe2d847
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 7 deletions.
3 changes: 0 additions & 3 deletions samples/CentralPackageVersions/Directory.Build.props

This file was deleted.

1 change: 1 addition & 0 deletions samples/CentralPackageVersions/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<Project>
<Sdk Name="Microsoft.Build.CentralPackageVersions" Version="2.1.3" />
<Import Project="$(MSBuildThisFileDirectory)\..\Directory.Build.targets" />
</Project>
File renamed without changes.
26 changes: 26 additions & 0 deletions samples/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<Project>
<!-- BEGIN workaround for https://github.com/dotnet/sdk/issues/43339; remove after updated to VS 17.12 or a future 17.11 patch -->
<Target Name="WorkaroundDotnetSdk43339" BeforeTargets="ResolvePackageAssets" Condition=" '$(MSBuildRuntimeType)' == 'Full' and $([MSBuild]::VersionLessThan($(MSBuildVersion), 17.12.0))">
<PrimeSystemTextJson804 />
</Target>
<UsingTask
TaskName="PrimeSystemTextJson804"
TaskFactory="RoslynCodeTaskFactory"
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll" >
<Task>
<Code Type="Fragment" Language="cs">
<![CDATA[
try
{
System.Reflection.Assembly.LoadFrom(@"$(MicrosoftNETBuildTasksDirectoryRoot)\..\..\..\DotnetTools\dotnet-format\BuildHost-net472\System.Text.Json.dll");
}
catch
{
// Best effort: if something moves in the SDK don't break the build.
}
]]>
</Code>
</Task>
</UsingTask>
<!-- END workaround for https://github.com/dotnet/sdk/issues/43339 -->
</Project>
1 change: 0 additions & 1 deletion samples/NoTargets/Directory.Build.props

This file was deleted.

1 change: 0 additions & 1 deletion samples/NoTargets/Directory.Build.targets

This file was deleted.

2 changes: 0 additions & 2 deletions samples/Traversal/Directory.Build.targets

This file was deleted.

0 comments on commit fe2d847

Please sign in to comment.