Skip to content

Commit

Permalink
Enables the 'clean method' for .NET Core and .NET Standard 2.1, and f…
Browse files Browse the repository at this point in the history
…ixes an issue with warnings thrown when the library is used as a dependency.
  • Loading branch information
MarkCiliaVincenti committed Dec 14, 2024
1 parent aeb3d7e commit 79f6fed
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Example:
There is also no need to reference this library as a dependency for .NET 9.0+. You can achieve that by having this in your `.csproj` file:

```xml
<PackageReference Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net9.0'))" Include="Backport.System.Threading.Lock" Version="3.0.3" />
<PackageReference Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net9.0'))" Include="Backport.System.Threading.Lock" Version="3.1.0" />
```

Use this library the same way you would use [System.Threading.Lock](https://learn.microsoft.com/en-us/dotnet/api/system.threading.lock?view=net-9.0). Example:
Expand Down Expand Up @@ -110,7 +110,7 @@ In your `.csproj` file, or ideally in your [Directory.Build.props](https://learn

```xml
<ItemGroup>
<PackageReference Include="Backport.System.Threading.Lock" Version="3.0.3" />
<PackageReference Include="Backport.System.Threading.Lock" Version="3.1.0" />
<Using Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net9.0'))" Alias="Lock" Include="System.Threading.Lock" />
<Using Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net9.0'))" Alias="Lock" Include="Backport.System.Threading.Lock" />
<Using Alias="LockFactory" Include="Backport.System.Threading.LockFactory" />
Expand Down Expand Up @@ -143,13 +143,13 @@ Use the `Lock` class the same way you would use [System.Threading.Lock](https://
The usage as a source generator is almost identical to using it as a dependency. The only difference is changing:

```xml
<PackageReference Include="Backport.System.Threading.Lock" Version="3.0.3" />
<PackageReference Include="Backport.System.Threading.Lock" Version="3.1.0" />
```

to:

```xml
<PackageReference Include="Backport.System.Threading.Lock" Version="3.0.3">
<PackageReference Include="Backport.System.Threading.Lock" Version="3.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>analyzers</IncludeAssets>
</PackageReference>
Expand All @@ -158,7 +158,7 @@ to:
Therefore in the clean method (if only targeting .NET Core 1.0+, .NET 5.0+ or .NET Standard 2.1):

```xml
<PackageReference Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net9.0'))" Include="Backport.System.Threading.Lock" Version="3.0.3">
<PackageReference Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net9.0'))" Include="Backport.System.Threading.Lock" Version="3.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>analyzers</IncludeAssets>
</PackageReference>
Expand All @@ -168,7 +168,7 @@ and in the factory method (if targeting the .NET Framework, including .NET Stand

```xml
<ItemGroup>
<PackageReference Include="Backport.System.Threading.Lock" Version="3.0.3">
<PackageReference Include="Backport.System.Threading.Lock" Version="3.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>analyzers</IncludeAssets>
</PackageReference>
Expand Down

0 comments on commit 79f6fed

Please sign in to comment.