2020-02-03 02:42:02 +08:00
# .NET Framework Targeting Pack Nuget Packages
2019-02-20 00:05:42 +08:00
2019-02-22 08:43:14 +08:00
These packages enable building .NET Framework projects on any machine with at least MSBuild or the .NET Core SDK installed.
2019-02-20 00:05:42 +08:00
2019-02-22 08:43:14 +08:00
The following scenarios and benefits are enabled for .NET Framework projects:
2019-02-20 00:05:42 +08:00
2019-02-22 08:43:14 +08:00
- Build without requiring admin operations to install pre-requisites such as [Visual Studio ](https://visualstudio.microsoft.com/vs/ ) or [.NET Framework targeting packs ](https://dotnet.microsoft.com/download/visual-studio-sdks ).
- Build libraries on any operating system supported by the .NET Core SDK.
- Build Mono-based projects.
2019-02-20 00:05:42 +08:00
2019-02-23 01:22:16 +08:00
## Usage
2019-02-27 03:46:38 +08:00
### .NET Core project
2019-05-06 06:38:10 +08:00
This sample uses a multi-targeting ClassLibrary project, that can be created using `dotnet new classlib` .
2019-02-27 03:46:38 +08:00
Change `TargetFramework` property to `TargetFrameworks` and add a new .NET Framework target, like in the following example:
```xml
< TargetFrameworks > netstandard2.0;net472< / TargetFrameworks >
```
Add Package reference:
```xml
2019-05-06 06:38:10 +08:00
< ItemGroup >
2020-02-03 02:42:02 +08:00
< PackageReference Include = "Microsoft.NETFramework.ReferenceAssemblies" Version = "1.0.0" PrivateAssets = "All" / >
2019-02-28 00:35:12 +08:00
< / ItemGroup >
2019-02-27 03:46:38 +08:00
```
Build as usual:
2019-02-28 00:35:12 +08:00
```console
2019-02-27 03:46:38 +08:00
dotnet build
```
2019-02-23 01:22:16 +08:00
### SDK-style project
2019-03-01 02:12:11 +08:00
Add the `TargetFramework` property and a `PackageReference` like in the following example `csproj` file:
2019-02-23 01:22:16 +08:00
```xml
< Project Sdk = "Microsoft.NET.Sdk" >
< PropertyGroup >
< OutputType > Exe< / OutputType >
< TargetFramework > net472< / TargetFramework >
< / PropertyGroup >
< ItemGroup >
2020-02-03 02:42:02 +08:00
< PackageReference Include = "Microsoft.NETFramework.ReferenceAssemblies" Version = "1.0.0" PrivateAssets = "All" / >
2019-02-23 01:22:16 +08:00
< / ItemGroup >
< / Project >
```
### Classic-style project
2019-02-28 00:35:12 +08:00
1. Add `PackageReference` to your `csproj` file, the same way as in the SDK-style sample above.
2019-02-23 01:22:16 +08:00
2019-02-28 00:35:12 +08:00
2. Add or modify the `TargetFrameworkVersion` property in your *csproj* file:
2019-02-23 01:22:16 +08:00
```xml
< TargetFrameworkVersion > v4.7.2< / TargetFrameworkVersion >
```
2019-02-27 03:46:38 +08:00
### Building your .NET Framework (SDK and Classic) project
2019-02-23 01:22:16 +08:00
1. Restore NuGet packages:
2019-02-28 00:35:12 +08:00
```console
2019-02-23 01:22:16 +08:00
msbuild /t:restore
```
2. Build the project:
2019-02-28 00:35:12 +08:00
```console
2019-02-23 01:22:16 +08:00
msbuild
```
2019-02-20 00:05:42 +08:00
## Package location
2019-05-06 06:38:10 +08:00
https://www.nuget.org/packages/Microsoft.NETFramework.ReferenceAssemblies
2019-02-20 00:05:42 +08:00
## Latest release
2021-06-14 23:57:58 +08:00
Version: 1.0.2
2019-02-20 00:09:39 +08:00
2021-06-14 23:57:58 +08:00
Date: May 6th, 2021
## Changelog
### 1.0.2
Fixes naming issue with System.Configuration.dll in 2.0 and 3.5 packages. Incorrect capitalization (System.configuration.dll) was causing build issues on Linux.
### 1.0.1
2021-06-15 03:57:35 +08:00
Adds .NET Framework 3.5 package.
2021-06-14 23:57:58 +08:00
### 1.0.0
Initial release