Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@
[zh-hans]: /docs/README.zh-hans.md
[zh-hant]: /docs/README.zh-hant.md

[![NuGet](https://img.shields.io/nuget/v/dotnetCampus.LatestCSharpFeatures.svg)](https://www.nuget.org/packages/dotnetCampus.LatestCSharpFeatures)
[![NuGet](https://img.shields.io/nuget/v/DotNetCampus.LatestCSharpFeatures.svg)](https://www.nuget.org/packages/DotNetCampus.LatestCSharpFeatures)

This open-source project provides a NuGet package, dotnetCampus.LatestCSharpFeatures, which allows you to use the latest C# language features in older versions of .NET, including the old .NET Framework, .NET Standard, and older versions of .NET Core App and .NET.
This open-source project provides a NuGet package, DotNetCampus.LatestCSharpFeatures, which allows you to use the latest C# language features in older versions of .NET, including the old .NET Framework, .NET Standard, and older versions of .NET Core App and .NET.

## How to Use

Simply install the dotnetCampus.LatestCSharpFeatures NuGet package.
Simply install the DotNetCampus.LatestCSharpFeatures NuGet package.

```xml
<!-- Since dotnetCampus.LatestCSharpFeatures only contains source generators, it does not introduce any runtime dependencies.
<!-- Since DotNetCampus.LatestCSharpFeatures only contains source generators, it does not introduce any runtime dependencies.
We can set it to PrivateAssets="all" to avoid passing it on to other projects. -->
<PackageReference Include="dotnetCampus.LatestCSharpFeatures" Version="12.0.0" PrivateAssets="all" />
<PackageReference Include="DotNetCampus.LatestCSharpFeatures" Version="13.0.0" PrivateAssets="all" />
```

If you want these new language features to also be effective for other projects that reference this project, you can add a conditional compilation symbol in the csproj file:

```xml
<!-- By default, dotnetCampus.LatestCSharpFeatures introduces most new C# features into the current project using the internal modifier.
<!-- By default, DotNetCampus.LatestCSharpFeatures introduces most new C# features into the current project using the internal modifier.
By using this conditional compilation symbol, these types can be set to public, allowing other projects referencing this project to also use these new features.
Note: Index/Range types are always internal and not affected by this setting. See explanation below. -->
<DefineConstants>$(DefineConstants);USE_PUBLIC_LATEST_CSHARP_FEATURES</DefineConstants>
Expand All @@ -46,4 +46,4 @@ We welcome feedback and contributions from all users. If you encounter any probl

If you wish to participate in the development of the project, you are also very welcome! You can Fork this repository and then submit a Pull Request.

Thank you for your support and help with dotnetCampus.LatestCSharpFeatures!
Thank you for your support and help with DotNetCampus.LatestCSharpFeatures!
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFrameworks>net8.0;netstandard2.0;net40</TargetFrameworks>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageId>dotnetCampus.LatestCSharpFeatures</PackageId>
<PackageId>DotNetCampus.LatestCSharpFeatures</PackageId>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<RootNamespace>System.Diagnostics.CodeAnalysis</RootNamespace>
<Description>This comprehensive package provides support for the latest C# language features in your project, enabling older .NET projects to use newer C# language constructs. Currently includes support for 'nullable', 'init', and 'required' keywords. The types introduced are internal, confining these features to the project itself without affecting other projects that reference it. By installing this package, you get all the newest C# features in one place, eliminating the need to install separate packages for each feature. Future updates will include more new features as they are released.</Description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="dotnetCampus.LatestCSharpFeatures" Version="12.0.1" />
<PackageReference Include="DotNetCampus.LatestCSharpFeatures" Version="13.0.0" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
</ItemGroup>

Expand Down
Loading