Skip to content

Modified build-related information. #1555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 15, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 14 additions & 18 deletions samples/framework/libraries/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# .NET Core Library Samples

**Note:** This document is compatible with tooling that is still in active development. Details are subject to change over time.

These samples are buildable projects whose source is used for code snippets in [the guide for writing cross-platform libraries](../../../docs/core/tutorials/libraries.md). They can be built and run using the .NET Core RC1 toolchain, and are intended to simply demonstrate how to target and build NuGet packages for different targets. They aren't examples of how you'd build a real, feature-complete library.
These samples are buildable projects whose source is used for code snippets in [the guide for writing cross-platform libraries](https://github.com/dotnet/docs/blob/master/docs/core/tutorials/libraries.md). They can be built and run using the .NET Core toolchain, and are intended to simply demonstrate how to target and build NuGet packages for different targets. They aren't examples of how you'd build a real, feature-complete library.

To build/use any of these (using `new-library` as an example):

Expand Down Expand Up @@ -36,44 +34,42 @@ And that's it!

## new-library

The project under `/new-library` is a project targeting **only** .NET Core. For that reason,
The project under `/new-library` targets **only** .NET Core. For that reason,
this project is stored under the core project directory, so our build server builds it on
all platforms. Look under https://github.com/dotnet/docs/tree/master/samples/core/libraries/new-library/

It demonstrates two other things: how to use multiple projects and how to test.
It demonstrates two other things: how to use multiple projects, and how to test.

There are two libraries showcased. The first, `DependencyLibrary`, contains functionality that the second, `Library` uses. The `LibraryTests` test project takes a dependency on `Library` to test that project.
The sample showcases two libraries. The first, `DependencyLibrary`, contains functionality that the second, `Library` uses. The `LibraryTests` test project takes a dependency on `Library` to test that project.

## frameworks-library

**IMPORTANT:** This project requires Windows and .NET Framework installed on your machine.
**IMPORTANT:** This project requires Windows and the .NET Framework installed on your machine.

The project under `/frameworks-library` demonstrates a project for targeting .NET Framework that you can build and run with the CLI tools. It does so with a simple project targeting .NET Framework 4.0. You could extend this to target additional version so of .NET Framework by adding new build targets in the `project.json`. Check out the [section on cross-compiling](../../../docs/core/tutorials/libraries.md#how-to-multitarget) in the CLI libraries article for more information.
The project under `/frameworks-library` demonstrates how to use the CLI tools to build a library that targets the .NET Framework. It does so with a simple project targeting the .NET Framework 4.0. You could extend this to target additional versions of the .NET Framework by adding new build targets in the `library.csproj` project file. Check out the [section on cross-compiling](https://github.com/dotnet/docs/blob/master/docs/core/tutorials/libraries.md#how-to-multitarget) in the CLI libraries article for more information.

## net45-compat-library

**IMPORTANT:** This project requires Windows and .NET Framework installed on your machine.
**IMPORTANT:** This project requires Windows and the .NET Framework installed on your machine.

The project under `/net45-compat-library` is for targeting any of the following:
The project under `/net45-compat-library` targets any of the following:

* .NET Framework 4.5 and above
* .NET Framework 4.5.1 and above
* Windows Phone 8.1
* Whindows Phone Silverlight 8
* Universal Windows Platform
* DNX Core
* Xamarin
* Mono

It uses the `dotnet51` Target Framework Moniker introduced with the .NET Platform Standard.
It uses the `netstandard1.2` Target Framework Moniker introduced with the [.NET Standard Library](https://github.com/dotnet/docs/blob/master/docs/standard/library.md).

## net40-library

**IMPORTANT:** This project requires Windows and .NET Framework installed on your machine.
**IMPORTANT:** This project requires Windows and the the .NET Framework installed on your machine.

The project under `/net40-library` is for how to target .NET Framework 4.0 and above. It also demonstrates how to use `#if` directives to multi-target for a .NET 4.0 target.
The project under `/net40-library` targets the .NET Framework 4.0 and above. It also demonstrates how to use [#if](https://github.com/dotnet/docs/blob/master/docs/csharp/language-reference/preprocessor-directives/preprocessor-if.md) directives to multi-target for a .NET 4.0 target.

## pcl-library

**IMPORTANT:** This project requires Windows and .NET Framework installed on your machine.
**IMPORTANT:** This project requires Windows and the .NET Framework installed on your machine.

The project under `/pcl-library` is for showing how to target a supported PCL Profile (e.g. 3344). It shows how to structure the `project.json` file to allow for targeting a PCL. It also demonstrates how to use `#if` directives and how to set those up in conjunction with the `project.json` file.
The project under `/pcl-library` shows how to target a supported PCL Profile (for example, 344). It shows how to structure the `Library.csproj` file to allow for targeting a PCL. It also demonstrates how to use [#if](https://github.com/dotnet/docs/blob/master/docs/csharp/language-reference/preprocessor-directives/preprocessor-if.md) directives and how to define a preprocessor constant, `PORTABLE259` in the `Library.csproj` file.