<Sdk Name="UsingsSdk" Version="0.0.1" />
This SDK provides a way to add reusable
using statements to your project files, packaged as a NuGet package. This is useful if you want to declare a set of
using statements that are used in multiple projects, but you don't want to have to add them to every project file.
Simply create a project file with the
usings you want to reuse and target the
UsingsSdk. Then, package the project as a NuGet package and reference it in your other projects.
The target framework is implicitly defined as
netstandard2.0 and the
UsingsSdk is referenced on the top line. You can omit the version notation if you include it in your
global.json file instead.
The package ID is generated as the project name
<Project Sdk="UsingsSdk/0.0.1"> <ItemGroup> <Using Include="System.Text" /> <Using Include="System.Text.RegularExpressions" /> </ItemGroup> </Project>
MyProject.csproj Project File[^1]
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>net6.0</TargetFramework> </PropertyGroup> <ItemGroup> <PackageReference Include="MyUsingsPackage.Usings" Version="1.0.0" /> <Using Include="System.Text" /> <Using Include="System.Text.RegularExpressions" /> </ItemGroup> </Project>
[^1]: The target framework is defined as
net6.0 in this example, but it can be any version of .NET that supports
Now, this project will have the
usings defined in the
MyUsingsPackage.usings file automagiacally!
// <auto-generated/> // ... global using global::System.Text; global using global::System.Text.RegularExpressions;
|Product||Versions Compatible and additional computed target framework versions.|
|.NET||net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed.|
|.NET Core||netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed.|
|.NET Standard||netstandard2.0 is compatible. netstandard2.1 was computed.|
|.NET Framework||net is compatible. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed.|
|MonoAndroid||monoandroid was computed.|
|MonoMac||monomac was computed.|
|MonoTouch||monotouch was computed.|
|Tizen||tizen40 was computed. tizen60 was computed.|
|Xamarin.iOS||xamarinios was computed.|
|Xamarin.Mac||xamarinmac was computed.|
|Xamarin.TVOS||xamarintvos was computed.|
|Xamarin.WatchOS||xamarinwatchos was computed.|
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.