UsingsSdk 0.0.1
<Sdk Name="UsingsSdk" Version="0.0.1" />
UsingsSdk
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.
Usage
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.
Example
MyUsingsPackage.usings
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 .Usings.
<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 netstandard2.0
.
Now, this project will have the usings
defined in the MyUsingsPackage.usings
file automagiacally!
Generated MyProject.GlobalUsings.g.cs
// <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. |
-
.NETStandard 2.0
- Microsoft.Build (>= 15.9.20)
- Microsoft.Build.Utilities.Core (>= 17.3.2)
- System.Drawing.Common (>= 6.0.0)
- System.Text.Json (>= 6.0.5)
- System.Xml.XDocument (>= 4.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.0.1 | 327 | 11/16/2022 |