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

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
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.
dotnet add package MSBuild.Sdk.Extras --version 1.1.0-preview.2.build.8
NuGet\Install-Package MSBuild.Sdk.Extras -Version 1.1.0-preview.2.build.8
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<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
#r "nuget: MSBuild.Sdk.Extras, 1.1.0-preview.2.build.8"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install MSBuild.Sdk.Extras as a Cake Addin
#addin nuget:?package=MSBuild.Sdk.Extras&version=1.1.0-preview.2.build.8&prerelease

// Install MSBuild.Sdk.Extras as a Cake Tool
#tool nuget:?package=MSBuild.Sdk.Extras&version=1.1.0-preview.2.build.8&prerelease

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="All" 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:

<PackageReference Include="NuGet.Build.Tasks.Pack" Version="4.3.0" PrivateAssets="All" />

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

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.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.0

    • No dependencies.

NuGet packages (7)

Showing the top 5 NuGet packages that depend on MSBuild.Sdk.Extras:

Package Downloads
Redhotminute.Mvx.Plugin.Style

Mvvmcross plugin to easily cross style fonts and colors

ChakraCore.NET.Hosting

Provide hosting feature

AzureMobileClient.Helpers

Provides a reusable set of abstractions and classes for using the Microsoft Azure Mobile Client

PlatformBindings

Operating System Library for the .NET Platform Bindings Framework

MSBuild.CompilerCache

Provides C# and F# compilation caching by extending the CoreCompile MSBuild target with custom tasks.

GitHub repositories (10)

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

Repository Stars
dotnet/sdk
Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
inthehand/32feet
Personal Area Networking for .NET. Open source and professionally supported
xamarin/urho
Code to integrate with the Urho3D engine
xamarin/SignaturePad
CommunityToolkit/ColorCode-Universal
This is a port of ColorCode to .NET Standard. The original Html only formatter has been separated from the Logic, so now it can produce Syntax Highlighted code for any output. This Project can currently produce HTML, and Render to UWP RichTextBlocks.
Version Downloads Last updated
3.0.44 624,402 12/17/2021
3.0.38 169,235 9/10/2021
3.0.23 424,088 1/7/2021
3.0.22 571,553 12/6/2020
2.1.2 165,716 7/24/2020
2.0.54 876,400 9/27/2019
2.0.46 34,363 9/19/2019
2.0.43 10,583 9/7/2019
2.0.41 54,864 8/19/2019
2.0.31 14,141 7/12/2019
2.0.29 15,003 6/13/2019
2.0.24 37,239 4/3/2019
2.0.0-preview.21 1,819 2/18/2019
2.0.0-preview.14 2,839 12/12/2018
2.0.0-preview.7 995 11/27/2018
1.6.68 198,285 2/18/2019
1.6.65 195,798 11/27/2018
1.6.61 44,319 11/5/2018
1.6.60 6,834 10/31/2018
1.6.55 55,919 9/7/2018
1.6.52 7,490 9/1/2018
1.6.47 17,051 8/17/2018
1.6.46 288,821 7/29/2018
1.6.41 12,717 7/16/2018
1.6.37-preview 1,194 7/10/2018
1.6.30-preview 1,199 7/9/2018
1.6.20-preview 2,294 6/26/2018
1.6.19-preview 1,113 6/26/2018
1.5.4 116,478 5/14/2018
1.4.0 180,049 5/1/2018
1.3.1 26,981 4/7/2018
1.3.0 12,625 3/28/2018
1.2.2 38,152 2/27/2018
1.2.1 41,953 1/23/2018
1.2.0 11,029 1/6/2018
1.2.0-build.23 987 12/14/2017
1.2.0-build.16 830 12/13/2017
1.2.0-build.3 934 12/12/2017
1.1.0 27,095 10/18/2017
1.1.0-preview.2.build.8 1,473 9/24/2017
1.1.0-beta.69 1,333 8/30/2017
1.0.9 10,938 8/27/2017
1.0.7 1,288 8/25/2017
1.0.6 9,732 7/21/2017
1.0.5 5,262 7/8/2017
1.0.4 5,416 6/21/2017
1.0.3 117,133 6/15/2017
1.0.2 2,099 4/13/2017
1.0.1 2,622 3/28/2017
1.0.0 5,202 3/7/2017
1.0.0-rc4-31 1,268 3/4/2017
1.0.0-rc4-19 1,312 2/25/2017
1.0.0-rc4-17 1,256 2/18/2017
1.0.0-rc4-14 2,013 2/15/2017

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

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