Skip to content

Commit 15ba3e1

Browse files
committed
Only reference Microsoft.Extensions.PlatformAbstractions in .NET 6+ builds
1 parent c0e16f9 commit 15ba3e1

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/NSwag.Commands/NSwag.Commands.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
</ItemGroup>
4141

4242
<ItemGroup>
43-
<PackageReference Include="Microsoft.Extensions.PlatformAbstractions" Version="1.1.0" />
43+
<PackageReference Include="Microsoft.Extensions.PlatformAbstractions" Version="1.1.0" Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))" />
4444
<PackageReference Include="NConsole" Version="3.12.6605.26941" />
4545
</ItemGroup>
4646

src/NSwag.Commands/RuntimeUtilities.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
//-----------------------------------------------------------------------
88

99
using System;
10+
#if !NETFRAMEWORK
1011
using Microsoft.Extensions.PlatformAbstractions;
12+
#endif
1113

1214
namespace NSwag.Commands
1315
{

0 commit comments

Comments
 (0)