MSBuild.Sdk.Extras 1.1.0-preview.2.build.8

Additional MSBuild targets and properties for SDK-style .NET projects.

This is a prerelease version of MSBuild.Sdk.Extras.
There is a newer version of this package available.
See the version list below for details.
This package has a SemVer 2.0.0 package version.
This package will only be available to download with SemVer 2.0.0 compatible NuGet clients, such as Visual Studio 2017 (version 15.3) and above or NuGet client 4.3.0 and above. Read more
Install-Package MSBuild.Sdk.Extras -Version 1.1.0-preview.2.build.8
dotnet add package MSBuild.Sdk.Extras --version 1.1.0-preview.2.build.8
<PackageReference Include="MSBuild.Sdk.Extras" Version="1.1.0-preview.2.build.8">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MSBuild.Sdk.Extras --version 1.1.0-preview.2.build.8
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

MSBuild.Sdk.Extras

This package contains a few extra extensions to the SDK-style projects that are currently not available
in the main SDK. That feature is tracked in dotnet/sdk#491

The primary goal is to enable multi-targeting without you having to enter in tons of properties within your
csproj, vbproj, fsproj, thus keeping it nice and clean.

See my blog article for some background on how to get started. Installing
this package, MSBuild.Sdk.Extras adds the missing properties so that you can use any TFM you want.

In short: Create a new .NET Standard class library in VS 2017. Then you can edit the TargetFramework to a different TFM (after installing this package), or you can rename TargetFramework to TargetFrameworks and specify multiple TFM's with a ; separator.

After building, you can use the Pack target to easily create a NuGet package: msbuild /t:Pack ...

Few notes:

  • This will only work in VS 2017, Visual Studio for Mac. It's possible it will work in Code, but only as an editor as this requires full msbuild to build.
  • To compile, you'll need the desktop build engine -- msbuild. Most of the platforms rely on tasks and utilities that are not yet cross platform
  • You must install the tools of the platforms you intend to build. For Xamarin, that means the Xamarin Workload; for UWP install those tools as well.

NuGet: MSBuild.Sdk.Extras

MSBuild.Sdk.Extras

MyGet CI feed: https://myget.org/F/msbuildsdkextras/api/v3/index.json

MSBuild.Sdk.Extras

Using the Package

To use this package, add a PackageReference to your project file like this (specify whatever version of the package or wildcard):

<PackageReference Include="MSBuild.Sdk.Extras" Version="1.1.0" PrivateAssets="All" />

Setting PrivateAssets=&quot;All&quot; means that this build-time dependency won't be added as a dependency to any packages you create by
using the Pack targets (msbuild /t:Pack or dotnet pack).

Then, at the end of your project file, either .csproj, .vbproj or .fsproj, add the following Import just before the closing tag

<Import Project="$(MSBuildSDKExtrasTargets)" Condition="Exists('$(MSBuildSDKExtrasTargets)')" />

This last step is required until Microsoft/msbuild#1045 is resolved.

Targeting UWP

If you plan to target UWP, then you must include the UWP meta-package in your project as well, something like this:

<ItemGroup Condition=" '$(TargetFramework)' == 'uap10.0' ">
  <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="5.4.0" />
</ItemGroup>

Starting with VS 2017 15.4, you can specify the TargetPlatformMinVersion with the TFM. The exact value depends on your installed Windows SDK; it may be something like uap10.0.16278. You can even multi-target to support older versions too, so have a uap10.0 and uap10.0.16278 target with different capabilities.

Targeting Tizen

If you plan to target Tizen, then you should include the following meta-package:

<ItemGroup Condition=" '$(TargetFramework)' == 'tizen30' ">
  <PackageReference Include="Tizen.NET" Version="3.0.0" />
</ItemGroup>

Targeting UWP, Windows 8.x, Windows Phone 8.1, etc. using the 1.0 SDK tooling

This workaround is needed when using the SDK 1.x tooling. Recommendation is to use the 2.0+ SDK even if targeting 1.x

If you're targeting a WinRT platform and you use the Pack target, there's an important workaround needed to ensure
that the .pri files are included in the package correctly. When you call Pack, you also must override NuGetBuildTasksPackTargets on the command-line
to ensure the fixed targets get applied. The value you specify must not be a real file.

You also need to add a PackageReference to the NuGet.Build.Tasks.Pack v4.3.0 to your project., something like this:

&lt;PackageReference Include=&quot;NuGet.Build.Tasks.Pack&quot; Version=&quot;4.3.0&quot; PrivateAssets=&quot;All&quot; /&gt;

On the command line, you need to invoke something like: msbuild MyProject.csproj /t:Pack /p:NuGetBuildTasksPackTargets=&quot;workaround&quot;

NuGet/Home#4136 is tracking this.

Single or multi-targeting

Once this package is configured, you can now use any supported TFM in your TargetFramework or TargetFrameworks element. The supported TFM families are:

  • netstandard (.NET Standard)
  • net (.NET Framework)
  • net35-client/net40-client (.NET Framework Client profile)
  • netcoreapp (.NET Core App)
  • wpa (Windows Phone App 8.1)
  • win (Windows 8 / 8.1)
  • uap (UWP)
  • wp (Windows Phone Silverlight, WP7+)
  • sl (Silverlight 4+)
  • tizen (Tizen 3.0+)
  • monoandroid/Xamarin.Android
  • xamarinios / Xamarin.iOS
  • xamarinmac / Xamarin.Mac
  • xamarinwatchos / Xamarin.WatchOS
  • xamarintvos / Xamarin.TVOS
  • portable-/portableNN- (legacy PCL profiles like portable-net45+win8+wpa81+wp8)

For legacy PCL profiles, the order of the TFM's in the list does not matter but the profile must be an exact match
to one of the known profiles. If it's not, you'll get a compile error saying it's unknown. You can see the full
list of known profiles here: Portable Library Profiles by Stephen Cleary.

If you try to use a framework that you don't have tools installed for, you'll get an error as well saying to check the tools. In some cases
this might mean installing an older version of VS (like 2015) to ensure that the necessary targets are installed on the machine.

MSBuild.Sdk.Extras

This package contains a few extra extensions to the SDK-style projects that are currently not available
in the main SDK. That feature is tracked in dotnet/sdk#491

The primary goal is to enable multi-targeting without you having to enter in tons of properties within your
csproj, vbproj, fsproj, thus keeping it nice and clean.

See my blog article for some background on how to get started. Installing
this package, MSBuild.Sdk.Extras adds the missing properties so that you can use any TFM you want.

In short: Create a new .NET Standard class library in VS 2017. Then you can edit the TargetFramework to a different TFM (after installing this package), or you can rename TargetFramework to TargetFrameworks and specify multiple TFM's with a ; separator.

After building, you can use the Pack target to easily create a NuGet package: msbuild /t:Pack ...

Few notes:

  • This will only work in VS 2017, Visual Studio for Mac. It's possible it will work in Code, but only as an editor as this requires full msbuild to build.
  • To compile, you'll need the desktop build engine -- msbuild. Most of the platforms rely on tasks and utilities that are not yet cross platform
  • You must install the tools of the platforms you intend to build. For Xamarin, that means the Xamarin Workload; for UWP install those tools as well.

NuGet: MSBuild.Sdk.Extras

MSBuild.Sdk.Extras

MyGet CI feed: https://myget.org/F/msbuildsdkextras/api/v3/index.json

MSBuild.Sdk.Extras

Using the Package

To use this package, add a PackageReference to your project file like this (specify whatever version of the package or wildcard):

<PackageReference Include="MSBuild.Sdk.Extras" Version="1.1.0" PrivateAssets="All" />

Setting PrivateAssets=&quot;All&quot; means that this build-time dependency won't be added as a dependency to any packages you create by
using the Pack targets (msbuild /t:Pack or dotnet pack).

Then, at the end of your project file, either .csproj, .vbproj or .fsproj, add the following Import just before the closing tag

<Import Project="$(MSBuildSDKExtrasTargets)" Condition="Exists('$(MSBuildSDKExtrasTargets)')" />

This last step is required until Microsoft/msbuild#1045 is resolved.

Targeting UWP

If you plan to target UWP, then you must include the UWP meta-package in your project as well, something like this:

<ItemGroup Condition=" '$(TargetFramework)' == 'uap10.0' ">
  <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="5.4.0" />
</ItemGroup>

Starting with VS 2017 15.4, you can specify the TargetPlatformMinVersion with the TFM. The exact value depends on your installed Windows SDK; it may be something like uap10.0.16278. You can even multi-target to support older versions too, so have a uap10.0 and uap10.0.16278 target with different capabilities.

Targeting Tizen

If you plan to target Tizen, then you should include the following meta-package:

<ItemGroup Condition=" '$(TargetFramework)' == 'tizen30' ">
  <PackageReference Include="Tizen.NET" Version="3.0.0" />
</ItemGroup>

Targeting UWP, Windows 8.x, Windows Phone 8.1, etc. using the 1.0 SDK tooling

This workaround is needed when using the SDK 1.x tooling. Recommendation is to use the 2.0+ SDK even if targeting 1.x

If you're targeting a WinRT platform and you use the Pack target, there's an important workaround needed to ensure
that the .pri files are included in the package correctly. When you call Pack, you also must override NuGetBuildTasksPackTargets on the command-line
to ensure the fixed targets get applied. The value you specify must not be a real file.

You also need to add a PackageReference to the NuGet.Build.Tasks.Pack v4.3.0 to your project., something like this:

&lt;PackageReference Include=&quot;NuGet.Build.Tasks.Pack&quot; Version=&quot;4.3.0&quot; PrivateAssets=&quot;All&quot; /&gt;

On the command line, you need to invoke something like: msbuild MyProject.csproj /t:Pack /p:NuGetBuildTasksPackTargets=&quot;workaround&quot;

NuGet/Home#4136 is tracking this.

Single or multi-targeting

Once this package is configured, you can now use any supported TFM in your TargetFramework or TargetFrameworks element. The supported TFM families are:

  • netstandard (.NET Standard)
  • net (.NET Framework)
  • net35-client/net40-client (.NET Framework Client profile)
  • netcoreapp (.NET Core App)
  • wpa (Windows Phone App 8.1)
  • win (Windows 8 / 8.1)
  • uap (UWP)
  • wp (Windows Phone Silverlight, WP7+)
  • sl (Silverlight 4+)
  • tizen (Tizen 3.0+)
  • monoandroid/Xamarin.Android
  • xamarinios / Xamarin.iOS
  • xamarinmac / Xamarin.Mac
  • xamarinwatchos / Xamarin.WatchOS
  • xamarintvos / Xamarin.TVOS
  • portable-/portableNN- (legacy PCL profiles like portable-net45+win8+wpa81+wp8)

For legacy PCL profiles, the order of the TFM's in the list does not matter but the profile must be an exact match
to one of the known profiles. If it's not, you'll get a compile error saying it's unknown. You can see the full
list of known profiles here: Portable Library Profiles by Stephen Cleary.

If you try to use a framework that you don't have tools installed for, you'll get an error as well saying to check the tools. In some cases
this might mean installing an older version of VS (like 2015) to ensure that the necessary targets are installed on the machine.

Release Notes

See the Readme for how to use/configure these targets.

     https://github.com/onovotny/MSBuildSdkExtras/blob/master/README.md

  • .NETStandard 2.0

    • No dependencies.

Showing the top 10 GitHub repositories that depend on MSBuild.Sdk.Extras:

Repository Stars
xamarin/XamarinComponents
Plugins for Xamarin
lunet-io/markdig
A fast, powerful, CommonMark compliant, extensible Markdown processor for .NET
mono/SkiaSharp
SkiaSharp is a cross-platform 2D graphics API for .NET platforms based on Google's Skia Graphics Library. It provides a comprehensive 2D API that can be used across mobile, server and desktop models to render images.
dotnet/sdk
Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
xamarin/urho
Code to integrate with the Urho3D engine
jamesmontemagno/mvvm-helpers
Collection of MVVM helper classes for any application
kubernetes-client/csharp
Work In Progress
ekonbenefits/dynamitey
(pronounced dyna-mighty) flexes DLR muscle to do meta-mazing things in .net
inthehand/32feet
Personal Area Networking for .NET
microsoft/appcenter-sdk-dotnet
Development repository for the App Center SDK for .NET platforms, including Xamarin

Version History

Version Downloads Last updated
2.0.54 7,657 9/27/2019
2.0.46 3,704 9/19/2019
2.0.43 2,706 9/7/2019
2.0.41 4,238 8/19/2019
2.0.31 6,829 7/12/2019
2.0.29 6,279 6/13/2019
2.0.24 22,462 4/3/2019
2.0.0-preview.21 1,247 2/18/2019
2.0.0-preview.14 1,751 12/12/2018
2.0.0-preview.7 494 11/27/2018
1.6.68 43,747 2/18/2019
1.6.65 77,961 11/27/2018
1.6.61 24,862 11/5/2018
1.6.60 5,572 10/31/2018
1.6.55 44,741 9/7/2018
1.6.52 6,140 9/1/2018
1.6.47 7,193 8/17/2018
1.6.46 18,561 7/29/2018
1.6.41 10,102 7/16/2018
1.6.37-preview 412 7/10/2018
1.6.30-preview 433 7/9/2018
1.6.20-preview 1,466 6/26/2018
1.6.19-preview 317 6/26/2018
1.5.4 34,072 5/14/2018
1.4.0 114,451 5/1/2018
1.3.1 15,210 4/7/2018
1.3.0 8,546 3/28/2018
1.2.2 18,003 2/27/2018
1.2.1 38,492 1/23/2018
1.2.0 8,475 1/6/2018
1.2.0-build.23 502 12/14/2017
1.2.0-build.16 273 12/13/2017
1.2.0-build.3 392 12/12/2017
1.1.0 19,067 10/18/2017
1.1.0-preview.2.build.8 588 9/24/2017
1.1.0-beta.69 745 8/30/2017
1.0.9 8,093 8/27/2017
1.0.7 367 8/25/2017
1.0.6 7,592 7/21/2017
1.0.5 2,372 7/8/2017
1.0.4 450 6/21/2017
1.0.3 38,460 6/15/2017
1.0.2 1,151 4/13/2017
1.0.1 1,557 3/28/2017
1.0.0 3,881 3/7/2017
1.0.0-rc4-31 539 3/4/2017
1.0.0-rc4-19 460 2/25/2017
1.0.0-rc4-17 402 2/18/2017
1.0.0-rc4-14 1,207 2/15/2017
Show less