Skip to content

Commit

Permalink
fixes dotnet#2816; document AssetTargetFallback
Browse files Browse the repository at this point in the history
  • Loading branch information
gewarren committed Mar 9, 2020
1 parent 1b07fda commit cce7ea2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/core/project-sdk/msbuild-props.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,21 @@ The `PackageReference` item lets you specify a NuGet dependency. For example, yo

For more information, see [Package references in project files](/nuget/consume-packages/package-references-in-project-files).

### AssetTargetFallback

The `AssetTargetFallback` property lets you specify additional compatible target frameworks for projects that your project references and NuGet packages that your project consumes. For example, if you specify a package dependency using `PackageReference` but that package doesn't contain assets that are compatible with your projects's `TargetFramework`, the `AssetTargetFallback` property comes into play. The compatibility of the referenced package is rechecked using each target framework that's specified in `AssetTargetFallback`.

You can set the `AssetTargetFallback` property to one or more target frameworks that are compatible with your project.

```xml
<Project Sdk="Microsoft.NET.Sdk">
...
<PropertyGroup>
<AssetTargetFallback>netcoreapp2.0</AssetTargetFallback>
</PropertyGroup>
</Project>
```

### Pack and restore targets

MSBuild 15.1 introduced `pack` and `restore` targets for creating and restoring NuGet packages as part of a build. For information about the MSBuild properties for these targets, including `PackageTargetFallback`, see [NuGet pack and restore as MSBuild targets](/nuget/reference/msbuild-targets).
Expand Down

0 comments on commit cce7ea2

Please sign in to comment.