diff --git a/docs/core/deploying/runtime-patch-selection.md b/docs/core/deploying/runtime-patch-selection.md index 23a9304e8db3d..643b0261b8cc1 100644 --- a/docs/core/deploying/runtime-patch-selection.md +++ b/docs/core/deploying/runtime-patch-selection.md @@ -1,8 +1,7 @@ --- title: Runtime roll forward for .NET Core self-contained app deployments. description: Learn about dotnet publish changes for self-contained deployments. -author: jralexander -ms.author: kdollard +author: KathleenDollard ms.date: 05/31/2018 ms.custom: seodec18 --- diff --git a/docs/core/docker/building-net-docker-images.md b/docs/core/docker/building-net-docker-images.md index 41b3375625f14..c4ae64c9a94f1 100644 --- a/docs/core/docker/building-net-docker-images.md +++ b/docs/core/docker/building-net-docker-images.md @@ -1,8 +1,6 @@ --- title: Docker images overview description: Learn how to use the published .NET Core Docker images from the Docker Registry. You will also learn how to pull images and build your own images. -author: jralexander -ms.author: johalex ms.date: 11/06/2017 ms.topic: tutorial ms.custom: "mvc, seodec18" diff --git a/docs/core/docker/intro-net-docker.md b/docs/core/docker/intro-net-docker.md index eb7eee2a077be..8f4aba6b4f872 100644 --- a/docs/core/docker/intro-net-docker.md +++ b/docs/core/docker/intro-net-docker.md @@ -1,8 +1,6 @@ --- title: Introduction to Docker description: This article provides an introduction and overview to Docker in the context of a .NET Core application. -author: jralexander -ms.author: johalex ms.date: 11/06/2017 ms.custom: "mvc, seodec18" --- diff --git a/docs/core/linux-prerequisites.md b/docs/core/linux-prerequisites.md index 042c6a3617eaf..952573c36f189 100644 --- a/docs/core/linux-prerequisites.md +++ b/docs/core/linux-prerequisites.md @@ -3,7 +3,7 @@ title: Prerequisites for .NET Core on Linux description: Supported Linux versions and .NET Core dependencies to develop, deploy, and run .NET Core applications on Linux machines. author: thraka ms.author: adegeo -ms.date: 12/03/2018 +ms.date: 12/14/2018 --- # Prerequisites for .NET Core on Linux @@ -55,6 +55,34 @@ For download links and more information, see [.NET Core 1.1 downloads](https://w See [.NET Core 1.x Supported OS Versions](https://github.com/dotnet/core/blob/master/release-notes/1.0/1.0-supported-os.md) for the complete list of .NET Core 1.x supported operating systems, out of support OS versions, and lifecycle policy links. +# [.NET Core 3.0 Preview 1](#tab/netcore30) + +.NET Core 3.0 Preview 1 treats Linux as a single operating system. There is a single Linux build (per chip architecture) for supported Linux distributions. + +For download links and more information, see [.NET Core 3.0 downloads](https://dotnet.microsoft.com/download/dotnet-core/3.0). + +.NET Core 3.0 Preview 1 is supported on the following Linux distributions/versions. + +OS | Version | Architectures +------------------------------|-----------------------|---------------- +Red Hat Enterprise Linux | 6 | x64 +Red Hat Enterprise Linux
CentOS
Oracle Linux | 7 | x64 +Fedora | 28 | x64 +Debian | 9 | x64, ARM32\*, ARM64\* +Ubuntu | 16.04+, 18.04+ | x64, ARM32\*, ARM64\* +Linux Mint | 18 | x64 +openSUSE | 42.3+ | x64 +SUSE Enterprise Linux (SLES) | 12 SP2+ | x64 +Alpine Linux | 3.8+ | x64, ARM64 + +\* ARM32 and ARM64 support starts with Debian 9 and Ubuntu 16.04. Earlier versions of those distros are not supported on ARM chips. + +See [.NET Core 3.0 Supported OS Versions](https://github.com/dotnet/core/blob/master/release-notes/3.0/3.0-supported-os.md) for the complete list of .NET Core 3.0 supported operating systems, distributions and versions, out of support OS versions, and lifecycle policy links. + +For more information about how to install .NET Core 3.0 on ARM64, see [Installing .NET Core 3.0 on Linux ARM64](https://gist.github.com/richlander/467813274cea8abc624553ee72b28213). + + + --- ## Linux distribution dependencies diff --git a/docs/core/macos-prerequisites.md b/docs/core/macos-prerequisites.md index 8707b3ee20a0b..9311d62ee8c41 100644 --- a/docs/core/macos-prerequisites.md +++ b/docs/core/macos-prerequisites.md @@ -3,7 +3,7 @@ title: Prerequisites for .NET Core on Mac description: Supported macOS versions and .NET Core dependencies to develop, deploy, and run .NET Core applications on macOS machines. author: guardrex ms.author: adegeo -ms.date: 12/03/2018 +ms.date: 12/14/2018 --- # Prerequisites for .NET Core on macOS @@ -33,6 +33,16 @@ See [.NET Core 1.1 Supported OS Versions](https://github.com/dotnet/core/blob/ma For download links and more information, see [.NET Core 1.1 downloads](https://www.microsoft.com/net/download/dotnet-core/1.1) or [.NET Core 1.0 downloads](https://www.microsoft.com/net/download/dotnet-core/1.0). +# [.NET Core 3.0 Preview 1](#tab/netcore30) + +.NET Core 3.0 Preview 1 is supported on the following versions of macOS: + +* macOS 10.12 "Sierra" and later versions + +See [.NET Core 3.0 Supported OS Versions](https://github.com/dotnet/core/blob/master/release-notes/3.0/3.0-supported-os.md) for the complete list of .NET Core 3.0 supported operating systems, distributions and versions, out of support OS versions, and lifecycle policy links. + +For download links and more information, see [.NET Core 3.0 downloads](https://www.microsoft.com/net/download/dotnet-core/3.0). + --- ## .NET Core dependencies @@ -43,8 +53,6 @@ Download and install the .NET Core SDK from [.NET Downloads](https://www.microso # [.NET Core 1.x](#tab/netcore1x) -**.NET Core 1.x** - .NET Core 1.x requires OpenSSL when running on macOS. An easy way to obtain OpenSSL is by using the [Homebrew ("brew")](https://brew.sh/) package manager for macOS. After installing *brew*, install OpenSSL by executing the following commands at a Terminal (command) prompt: ```console @@ -57,6 +65,10 @@ ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/ Download and install the .NET Core SDK from [.NET Downloads](https://www.microsoft.com/net/download/core). If you have problems with the installation on macOS, consult the [1.0.0 Known Issues](https://github.com/dotnet/core/blob/master/release-notes/1.0/1.0.0-known-issues.md) and [1.0.1 Known Issues](https://github.com/dotnet/core/blob/master/release-notes/1.0/1.0.1-known-issues.md) topics. +# [.NET Core 3.0 Preview 1](#tab/netcore30) + +Download and install the .NET Core SDK from [.NET Downloads](https://www.microsoft.com/net/download/core). If you have problems with the installation on macOS, consult the [Release notes](https://github.com/dotnet/core/blob/master/release-notes/3.0/3.0-supported-os.md) topic for the version you have installed. + --- ## Increase the maximum open file limit (.NET Core versions before .NET Core SDK 2.0.2) diff --git a/docs/core/windows-prerequisites.md b/docs/core/windows-prerequisites.md index 4bd9787e411ad..28215da9d6067 100644 --- a/docs/core/windows-prerequisites.md +++ b/docs/core/windows-prerequisites.md @@ -1,8 +1,9 @@ --- title: Prerequisites for .NET Core on Windows description: Learn what dependencies you need on your Windows machine to develop and run .NET Core applications. -ms.date: 12/10/2018 +ms.date: 12/14/2018 --- + # Prerequisites for .NET Core on Windows This article shows the supported OS versions in order to run .NET Core applications on Windows. The supported OS versions and dependencies that follow apply to the three ways of developing .NET Core apps on Windows: @@ -29,11 +30,12 @@ Also, if you're developing on Windows using Visual Studio 2017, the [Prerequisit The following articles have a complete list of .NET Core supported operating systems per version: +* [.NET Core 3.0 (Preview)](https://github.com/dotnet/core/blob/master/release-notes/3.0/3.0-supported-os.md) * [.NET Core 2.2](https://github.com/dotnet/core/blob/master/release-notes/2.2/2.2-supported-os.md) * [.NET Core 2.1](https://github.com/dotnet/core/blob/master/release-notes/2.1/2.1-supported-os.md) * [.NET Core 1.0](https://github.com/dotnet/core/blob/master/release-notes/1.0/1.0-supported-os.md) -For download links and more information, see [.NET downloads](https://www.microsoft.com/net/download) to download the latest version or [.NET downloads archive](https://dotnet.microsoft.com/download/archives#dotnet-core) for older versions. +For download links and more information, see [.NET downloads](https://dotnet.microsoft.com/download) to download the latest version or [.NET downloads archive](https://dotnet.microsoft.com/download/archives#dotnet-core) for older versions. ## .NET Core dependencies @@ -55,8 +57,12 @@ For download links and more information, see [.NET downloads](https://www.micros > > In addition to KB2999226, make sure you also have [KB2533623](https://support.microsoft.com/en-us/help/2533623/microsoft-security-advisory-insecure-library-loading-could-allow-remot) installed. If you don't have this update installed, you'll see an error similar to the following when you launch a .NET Core application: `The library hostfxr.dll was found, but loading it from C:\\hostfxr.dll failed`. -## Prerequisites with Visual Studio 2017 +## Prerequisites for .NET Core 3.0 Preview 1 +.NET Core 3.0 Preview 1 has the same prerequisites as other versions of .NET Core. However, if you want to use Visual Studio to create .NET Core 3.0 projects, you must use the [Visual Studio 2019 Preview](https://visualstudio.microsoft.com/vs/preview/). Visual Studio 2019 Preview can be installed side-by-side with other versions of Visual Studio without conflict. + +## Prerequisites with Visual Studio 2017 + You can use any editor to develop .NET Core applications using the .NET Core SDK. Visual Studio 2017 provides an integrated development environment for .NET Core apps on Windows. You can read more about the changes in Visual Studio 2017 in the [release notes](/visualstudio/releasenotes/vs2017-relnotes). diff --git a/docs/csharp/language-reference/operators/codesnippet/CSharp/greater-than-equal-operator_1.cs b/docs/csharp/language-reference/operators/codesnippet/CSharp/greater-than-equal-operator_1.cs deleted file mode 100644 index f96aac9933fd4..0000000000000 --- a/docs/csharp/language-reference/operators/codesnippet/CSharp/greater-than-equal-operator_1.cs +++ /dev/null @@ -1,13 +0,0 @@ - class GTE - { - static void Main() - { - Console.WriteLine(1.1 >= 1); - Console.WriteLine(1.1 >= 1.1); - } - } - /* - Output: - True - True - */ \ No newline at end of file diff --git a/docs/csharp/language-reference/operators/codesnippet/CSharp/greater-than-operator_1.cs b/docs/csharp/language-reference/operators/codesnippet/CSharp/greater-than-operator_1.cs deleted file mode 100644 index 46513b7a0af82..0000000000000 --- a/docs/csharp/language-reference/operators/codesnippet/CSharp/greater-than-operator_1.cs +++ /dev/null @@ -1,13 +0,0 @@ - class GT - { - static void Main() - { - Console.WriteLine(1.1 > 1); - Console.WriteLine(1.1 > 1.1); - } - } - /* - Output: - True - False - */ \ No newline at end of file diff --git a/docs/csharp/language-reference/operators/codesnippet/CSharp/less-than-equal-operator_1.cs b/docs/csharp/language-reference/operators/codesnippet/CSharp/less-than-equal-operator_1.cs deleted file mode 100644 index 0964dab88a706..0000000000000 --- a/docs/csharp/language-reference/operators/codesnippet/CSharp/less-than-equal-operator_1.cs +++ /dev/null @@ -1,13 +0,0 @@ - class LTE - { - static void Main() - { - Console.WriteLine(1 <= 1.1); - Console.WriteLine(1.1 <= 1.1); - } - } - /* - Output: - True - True - */ \ No newline at end of file diff --git a/docs/csharp/language-reference/operators/codesnippet/CSharp/less-than-operator_1.cs b/docs/csharp/language-reference/operators/codesnippet/CSharp/less-than-operator_1.cs deleted file mode 100644 index fd5e6a60412b9..0000000000000 --- a/docs/csharp/language-reference/operators/codesnippet/CSharp/less-than-operator_1.cs +++ /dev/null @@ -1,13 +0,0 @@ - class LT - { - static void Main() - { - Console.WriteLine(1 < 1.1); - Console.WriteLine(1.1 < 1.1); - } - } - /* - Output: - True - False - */ \ No newline at end of file diff --git a/docs/csharp/language-reference/operators/equality-comparison-operator.md b/docs/csharp/language-reference/operators/equality-comparison-operator.md index f3df75947fa72..ff5350699ef11 100644 --- a/docs/csharp/language-reference/operators/equality-comparison-operator.md +++ b/docs/csharp/language-reference/operators/equality-comparison-operator.md @@ -19,6 +19,9 @@ Operands of the [built-in value types](../keywords/value-types-table.md) are equ [!code-csharp-interactive[value types equality](~/samples/snippets/csharp/language-reference/operators/EqualityAndNonEqualityExamples.cs#ValueTypesEquality)] +> [!NOTE] +> For relational operators `==`, `>`, `<`, `>=`, and `<=`, if any of the operands is not a number ( or ) the result of operation is `false`. That means that the `NaN` value is neither greater than, less than, nor equal to any other `double` (or `float`) value. For more information and examples, see the or reference article. + Two operands of the same [enum](../keywords/enum.md) type are equal if the corresponding values of the underlying integral type are equal. By default, the `==` operator is not defined for a user-defined [struct](../keywords/struct.md) type. A user-defined type can [overload](#operator-overloadability) the `==` operator. diff --git a/docs/csharp/language-reference/operators/greater-than-equal-operator.md b/docs/csharp/language-reference/operators/greater-than-equal-operator.md index ab9da42832c64..256b6e2bb2cbc 100644 --- a/docs/csharp/language-reference/operators/greater-than-equal-operator.md +++ b/docs/csharp/language-reference/operators/greater-than-equal-operator.md @@ -1,8 +1,7 @@ --- title: ">= Operator - C# Reference" ms.custom: seodec18 - -ms.date: 07/20/2015 +ms.date: 12/18/2018 f1_keywords: - ">=_CSharpKeyword" helpviewer_keywords: @@ -11,16 +10,29 @@ helpviewer_keywords: ms.assetid: 0db4dcaf-56a3-4884-a7ad-35f64978a58d --- # >= Operator (C# Reference) -All numeric and enumeration types define a "greater than or equal" relational operator, `>=` that returns `true` if the first operand is greater than or equal to the second, `false` otherwise. - -## Remarks - User-defined types can overload the `>=` operator. For more information, see [operator](../../../csharp/language-reference/keywords/operator.md). If `>=` is overloaded, [<=](../../../csharp/language-reference/operators/less-than-equal-operator.md) must also be overloaded. Operations on integral types are generally allowed on enumeration. - -## Example - [!code-csharp[csRefOperators#39](../../../csharp/language-reference/operators/codesnippet/CSharp/greater-than-equal-operator_1.cs)] - -## See Also - -- [C# Reference](../../../csharp/language-reference/index.md) -- [C# Programming Guide](../../../csharp/programming-guide/index.md) -- [C# Operators](../../../csharp/language-reference/operators/index.md) + +The "greater than or equal" relational operator `>=` returns `true` if its first operand is greater than or equal to its second operand, `false` otherwise. All numeric and enumeration types support the `>=` operator. For operands of the same [enum](../keywords/enum.md) type, the corresponding values of the underlying integral type are compared. + +> [!NOTE] +> For relational operators `==`, `>`, `<`, `>=`, and `<=`, if any of the operands is not a number ( or ) the result of operation is `false`. That means that the `NaN` value is neither greater than, less than, nor equal to any other `double` (or `float`) value. For more information and examples, see the or reference article. + +The following example demonstrates the usage of the `>=` operator: + +[!code-csharp-interactive[greater than or equal example](~/samples/snippets/csharp/language-reference/operators/GreaterAndLessOperatorsExamples.cs#GreaterOrEqual)] + +## Operator overloadability + +User-defined types can [overload](../keywords/operator.md) the `>=` operator. If a type overloads the "greater than or equal" operator `>=`, it must also overload the ["less than or equal" operator](less-than-equal-operator.md) `<=`. + +## C# language specification + +For more information, see the [Relational and type-testing operators](~/_csharplang/spec/expressions.md#relational-and-type-testing-operators) section of the [C# language specification](../language-specification/index.md). + +## See also + +- [C# Reference](../index.md) +- [C# Programming Guide](../../programming-guide/index.md) +- [C# Operators](index.md) +- [> Operator](greater-than-operator.md) +- [== Operator](equality-comparison-operator.md) +- diff --git a/docs/csharp/language-reference/operators/greater-than-operator.md b/docs/csharp/language-reference/operators/greater-than-operator.md index aee91143109c2..920906d99db1d 100644 --- a/docs/csharp/language-reference/operators/greater-than-operator.md +++ b/docs/csharp/language-reference/operators/greater-than-operator.md @@ -1,8 +1,7 @@ --- title: "> Operator - C# Reference" ms.custom: seodec18 - -ms.date: 07/20/2015 +ms.date: 12/18/2018 f1_keywords: - ">_CSharpKeyword" helpviewer_keywords: @@ -11,17 +10,28 @@ helpviewer_keywords: ms.assetid: 26d3cb69-9c0b-4cc5-858b-5be1abd6659d --- # > Operator (C# Reference) -All numeric and enumeration types define a "greater than" relational operator (`>`) that returns `true` if the first operand is greater than the second, `false` otherwise. - -## Remarks - User-defined types can overload the `>` operator (see [operator](../../../csharp/language-reference/keywords/operator.md)). If `>` is overloaded, [<](../../../csharp/language-reference/operators/less-than-operator.md) must also be overloaded. - -## Example - [!code-csharp[csRefOperators#29](../../../csharp/language-reference/operators/codesnippet/CSharp/greater-than-operator_1.cs)] - -## See Also - -- [C# Reference](../../../csharp/language-reference/index.md) -- [C# Programming Guide](../../../csharp/programming-guide/index.md) -- [C# Operators](../../../csharp/language-reference/operators/index.md) -- [explicit](../../../csharp/language-reference/keywords/explicit.md) + +The "greater than" relational operator `>` returns `true` if its first operand is greater than its second operand, `false` otherwise. All numeric and enumeration types support the `>` operator. For operands of the same [enum](../keywords/enum.md) type, the corresponding values of the underlying integral type are compared. + +> [!NOTE] +> For relational operators `==`, `>`, `<`, `>=`, and `<=`, if any of the operands is not a number ( or ) the result of operation is `false`. That means that the `NaN` value is neither greater than, less than, nor equal to any other `double` (or `float`) value. For more information and examples, see the or reference article. + +The following example demonstrates the usage of the `>` operator: + +[!code-csharp-interactive[greater than example](~/samples/snippets/csharp/language-reference/operators/GreaterAndLessOperatorsExamples.cs#Greater)] + +## Operator overloadability + +User-defined types can [overload](../keywords/operator.md) the `>` operator. If a type overloads the "greater than" operator `>`, it must also overload the ["less than" operator](less-than-operator.md) `<`. + +## C# language specification + +For more information, see the [Relational and type-testing operators](~/_csharplang/spec/expressions.md#relational-and-type-testing-operators) section of the [C# language specification](../language-specification/index.md). + +## See also + +- [C# Reference](../index.md) +- [C# Programming Guide](../../programming-guide/index.md) +- [C# Operators](index.md) +- [>= Operator](greater-than-equal-operator.md) +- diff --git a/docs/csharp/language-reference/operators/less-than-equal-operator.md b/docs/csharp/language-reference/operators/less-than-equal-operator.md index 71e41de92a60c..770d586ae7e30 100644 --- a/docs/csharp/language-reference/operators/less-than-equal-operator.md +++ b/docs/csharp/language-reference/operators/less-than-equal-operator.md @@ -1,8 +1,7 @@ --- title: "<= Operator - C# Reference" ms.custom: seodec18 - -ms.date: 07/20/2015 +ms.date: 12/18/2018 f1_keywords: - "<=_CSharpKeyword" helpviewer_keywords: @@ -11,17 +10,29 @@ helpviewer_keywords: ms.assetid: bb0caec9-d253-4105-b8bc-5252233251e4 --- # <= Operator (C# Reference) -All numeric and enumeration types define a "less than or equal" relational operator (`<=`) that returns `true` if the first operand is less than or equal to the second, `false` otherwise. - -## Remarks - User-defined types can overload the `<=` operator. For more information, see [operator](../../../csharp/language-reference/keywords/operator.md). If `<=` is overloaded, [>=](../../../csharp/language-reference/operators/greater-than-equal-operator.md) must also be overloaded. Operations on integral types are generally allowed on enumeration. - -## Example - [!code-csharp[csRefOperators#32](../../../csharp/language-reference/operators/codesnippet/CSharp/less-than-equal-operator_1.cs)] - -## See Also - -- [C# Reference](../../../csharp/language-reference/index.md) -- [C# Programming Guide](../../../csharp/programming-guide/index.md) -- [C# Operators](../../../csharp/language-reference/operators/index.md) -- [explicit](../../../csharp/language-reference/keywords/explicit.md) + +The "less than or equal" relational operator `<=` returns `true` if its first operand is less than or equal to its second operand, `false` otherwise. All numeric and enumeration types support the `<=` operator. For operands of the same [enum](../keywords/enum.md) type, the corresponding values of the underlying integral type are compared. + +> [!NOTE] +> For relational operators `==`, `>`, `<`, `>=`, and `<=`, if any of the operands is not a number ( or ) the result of operation is `false`. That means that the `NaN` value is neither greater than, less than, nor equal to any other `double` (or `float`) value. For more information and examples, see the or reference article. + +The following example demonstrates the usage of the `<=` operator: + +[!code-csharp-interactive[less than or equal example](~/samples/snippets/csharp/language-reference/operators/GreaterAndLessOperatorsExamples.cs#LessOrEqual)] + +## Operator overloadability + +User-defined types can [overload](../keywords/operator.md) the `<=` operator. If a type overloads the "less than or equal" operator `<=`, it must also overload the ["greater than or equal" operator](greater-than-equal-operator.md) `>=`. + +## C# language specification + +For more information, see the [Relational and type-testing operators](~/_csharplang/spec/expressions.md#relational-and-type-testing-operators) section of the [C# language specification](../language-specification/index.md). + +## See also + +- [C# Reference](../index.md) +- [C# Programming Guide](../../programming-guide/index.md) +- [C# Operators](index.md) +- [< Operator](less-than-operator.md) +- [== Operator](equality-comparison-operator.md) +- diff --git a/docs/csharp/language-reference/operators/less-than-operator.md b/docs/csharp/language-reference/operators/less-than-operator.md index 55b43bbb68b87..6881760a799d3 100644 --- a/docs/csharp/language-reference/operators/less-than-operator.md +++ b/docs/csharp/language-reference/operators/less-than-operator.md @@ -1,8 +1,7 @@ --- title: "< Operator - C# Reference" ms.custom: seodec18 - -ms.date: 07/20/2015 +ms.date: 12/18/2018 f1_keywords: - "<_CSharpKeyword" helpviewer_keywords: @@ -11,16 +10,28 @@ helpviewer_keywords: ms.assetid: 38cb91e6-79a6-48ec-9c1e-7b71fd8d2b41 --- # < Operator (C# Reference) -All numeric and enumeration types define a "less than" relational operator (`<`) that returns `true` if the first operand is less than the second, `false` otherwise. - -## Remarks - User-defined types can overload the `<` operator (see [operator](../../../csharp/language-reference/keywords/operator.md)). If `<` is overloaded, [>](../../../csharp/language-reference/operators/greater-than-operator.md) must also be overloaded. - -## Example - [!code-csharp[csRefOperators#24](../../../csharp/language-reference/operators/codesnippet/CSharp/less-than-operator_1.cs)] - -## See Also - -- [C# Reference](../../../csharp/language-reference/index.md) -- [C# Programming Guide](../../../csharp/programming-guide/index.md) -- [C# Operators](../../../csharp/language-reference/operators/index.md) + +The "less than" relational operator `<` returns `true` if its first operand is less than its second operand, `false` otherwise. All numeric and enumeration types support the `<` operator. For operands of the same [enum](../keywords/enum.md) type, the corresponding values of the underlying integral type are compared. + +> [!NOTE] +> For relational operators `==`, `>`, `<`, `>=`, and `<=`, if any of the operands is not a number ( or ) the result of operation is `false`. That means that the `NaN` value is neither greater than, less than, nor equal to any other `double` (or `float`) value. For more information and examples, see the or reference article. + +The following example demonstrates the usage of the `<` operator: + +[!code-csharp-interactive[less than example](~/samples/snippets/csharp/language-reference/operators/GreaterAndLessOperatorsExamples.cs#Less)] + +## Operator overloadability + +User-defined types can [overload](../keywords/operator.md) the `<` operator. If a type overloads the "less than" operator `<`, it must also overload the ["greater than" operator](greater-than-operator.md) `>`. + +## C# language specification + +For more information, see the [Relational and type-testing operators](~/_csharplang/spec/expressions.md#relational-and-type-testing-operators) section of the [C# language specification](../language-specification/index.md). + +## See also + +- [C# Reference](../index.md) +- [C# Programming Guide](../../programming-guide/index.md) +- [C# Operators](index.md) +- [<= Operator](less-than-equal-operator.md) +- diff --git a/docs/csharp/programming-guide/concepts/attributes/attributeusage.md b/docs/csharp/programming-guide/concepts/attributes/attributeusage.md index beb0bdc37210e..fd903741a7ddd 100644 --- a/docs/csharp/programming-guide/concepts/attributes/attributeusage.md +++ b/docs/csharp/programming-guide/concepts/attributes/attributeusage.md @@ -6,7 +6,7 @@ ms.date: 04/25/2018 Determines how a custom attribute class can be used. is an attribute you apply to custom attribute definitions. The `AttributeUsage` attribute enables you to control: -- Which program elements attribute may be applied to. Unless you restrict is usage, an attribute may be applied to any of the following program elements: +- Which program elements attribute may be applied to. Unless you restrict its usage, an attribute may be applied to any of the following program elements: - assembly - module - field diff --git a/docs/csharp/tutorials/inheritance.md b/docs/csharp/tutorials/inheritance.md index 259cea20e1254..78c7564855554 100644 --- a/docs/csharp/tutorials/inheritance.md +++ b/docs/csharp/tutorials/inheritance.md @@ -146,7 +146,7 @@ The following table lists the categories of types that you can create in C# and Ordinarily, inheritance is used to express an "is a" relationship between a base class and one or more derived classes, where the derived classes are specialized versions of the base class; the derived class is a type of the base class. For example, the `Publication` class represents a publication of any kind, and the `Book` and `Magazine` classes represent specific types of publications. > [!NOTE] -> A class or struct can implement one more interfaces. While interface implementation is often presented as a workaround for single inheritance or as a way of using inheritance with structs, it is intended to express a different relationship (a "can do" relationship) between an interface and its implementing type than inheritance. An interface defines a subset of functionality (such as the ability to test for equality, to compare or sort objects, or to support culture-sensitive parsing and formatting) that the interface makes available to its implementing types. +> A class or struct can implement one or more interfaces. While interface implementation is often presented as a workaround for single inheritance or as a way of using inheritance with structs, it is intended to express a different relationship (a "can do" relationship) between an interface and its implementing type than inheritance. An interface defines a subset of functionality (such as the ability to test for equality, to compare or sort objects, or to support culture-sensitive parsing and formatting) that the interface makes available to its implementing types. Note that "is a" also expresses the relationship between a type and a specific instantiation of that type. In the following example, `Automobile` is a class that has three unique read-only properties: `Make`, the manufacturer of the automobile; `Model`, the kind of automobile; and `Year`, its year of manufacture. Your `Automobile` class also has a constructor whose arguments are assigned to the property values, and it overrides the method to produce a string that uniquely identifies the `Automobile` instance rather than the `Automobile` class. diff --git a/docs/framework/mef/attributed-programming-model-overview-mef.md b/docs/framework/mef/attributed-programming-model-overview-mef.md index 515b56956b0ab..0341124a28f33 100644 --- a/docs/framework/mef/attributed-programming-model-overview-mef.md +++ b/docs/framework/mef/attributed-programming-model-overview-mef.md @@ -542,7 +542,7 @@ Public Class User logger = Nothing For Each Plugin As Lazy(Of IPlugin, IPluginMetadata) In plugins - If (Plugin.Metadata.Name = "Logger") Then + If Plugin.Metadata.Name = "Logger" Then logger = Plugin.Value End If Next @@ -558,13 +558,14 @@ public class User [ImportMany] public IEnumerable> plugins; - public IPlugin InstantiateLogger () + public IPlugin InstantiateLogger() { IPlugin logger = null; foreach (Lazy plugin in plugins) { - if (plugin.Metadata.Name = "Logger") logger = plugin.Value; + if (plugin.Metadata.Name == "Logger") + logger = plugin.Value; } return logger; } diff --git a/docs/framework/winforms/disable-dpi-awareness-visual-studio.md b/docs/framework/winforms/disable-dpi-awareness-visual-studio.md index 8149381bd8ade..62c8937a3be7e 100644 --- a/docs/framework/winforms/disable-dpi-awareness-visual-studio.md +++ b/docs/framework/winforms/disable-dpi-awareness-visual-studio.md @@ -1,7 +1,7 @@ --- title: Disable DPI-awareness in Visual Studio description: Discusses the limitations of Windows Forms Designer on HDPI monitors, and how to run Visual Studio as a DPI-unaware process. -ms.date: 08/14/2018 +ms.date: 12/17/2018 ms.prod: visual-studio-dev15 ms.technology: vs-ide-designers author: gewarren @@ -23,7 +23,7 @@ In Visual Studio 2017 version 15.8 and later, when you open a form in the **Wind The message reads **Scaling on your main display is set to 200% (192 dpi). This might cause rendering problems in the designer window.** -If you aren't working in the designer and don't need to adjust the layout of your form, you can ignore the informational bar and continue working in the code editor or in other types of designers. Only the **Windows Forms Designer** is affected. If you do need to work in the **Windows Forms Designer**, the next section helps you [resolve the problem](#to-resolve-the-problem). +If you aren't working in the designer and don't need to adjust the layout of your form, you can ignore the informational bar and continue working in the code editor or in other types of designers. (You can also [disable notifications](#disable-notifications) so that the informational bar doesn't continue to appear.) Only the **Windows Forms Designer** is affected. If you do need to work in the **Windows Forms Designer**, the next section helps you [resolve the problem](#to-resolve-the-problem). ## To resolve the problem @@ -63,6 +63,16 @@ To set your display scaling setting to 100% in Windows 10, type **display settin Setting your display scaling to 100% may be undesirable, because it can make the user interface too small to be usable. +## Disable notifications + +You can choose not to be notified of DPI scaling issues in Visual Studio. You might want to disable notifications if you aren't working in the designer, for example. + +To disable notifications, choose **Tools** > **Options** to open the **Options** dialog. Then, choose **Windows Forms Designer** > **General**, and set **DPI Scaling Notifications** to **False**. + +![DPI scaling notifications option in Visual Studio](media/disable-dpi-awareness-visual-studio/notifications-option.png) + +If you want to later reenable scaling notifications, set the property to **True**. + ## Troubleshoot If the DPI-awareness transition isn't working as expected in Visual Studio, check to see if you have the `dpiAwareness` value in the **HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\devenv.exe** subkey in Registry Editor. Delete the value if it's present. diff --git a/docs/framework/winforms/media/disable-dpi-awareness-visual-studio/notifications-option.png b/docs/framework/winforms/media/disable-dpi-awareness-visual-studio/notifications-option.png new file mode 100644 index 0000000000000..eaa7bfc4aeb80 Binary files /dev/null and b/docs/framework/winforms/media/disable-dpi-awareness-visual-studio/notifications-option.png differ diff --git a/docs/fsharp/language-reference/casting-and-conversions.md b/docs/fsharp/language-reference/casting-and-conversions.md index 57e934b2a27e7..28dc62d2d374b 100644 --- a/docs/fsharp/language-reference/casting-and-conversions.md +++ b/docs/fsharp/language-reference/casting-and-conversions.md @@ -34,6 +34,7 @@ The following table shows conversion operators defined in F#. |`decimal`|Convert to `System.Decimal`.| |`char`|Convert to `System.Char`, a Unicode character.| |`enum`|Convert to an enumerated type.| + In addition to built-in primitive types, you can use these operators with types that implement `op_Explicit` or `op_Implicit` methods with appropriate signatures. For example, the `int` conversion operator works with any type that provides a static method `op_Explicit` that takes the type as a parameter and returns `int`. As a special exception to the general rule that methods cannot be overloaded by return type, you can do this for `op_Explicit` and `op_Implicit`. ## Enumerated Types @@ -111,4 +112,4 @@ For more information about type tests, see [Match Expressions](match-Expressions ## See also -- [F# Language Reference](index.md) \ No newline at end of file +- [F# Language Reference](index.md) diff --git a/docs/fsharp/language-reference/lists.md b/docs/fsharp/language-reference/lists.md index fe6e81bc743ae..a5c3c9e24f1df 100644 --- a/docs/fsharp/language-reference/lists.md +++ b/docs/fsharp/language-reference/lists.md @@ -64,6 +64,7 @@ The list type supports the following properties: |[Item](https://msdn.microsoft.com/library/bdb2553a-0e54-4ff8-baed-ab1aac8f5dae)|`'T`|The element at the specified index (zero-based).| |[Length](https://msdn.microsoft.com/library/25f715c8-9daa-4c4d-a6c7-26772f9dab4d)|`int`|The number of elements.| |[Tail](https://msdn.microsoft.com/library/2a6f8eb9-dc32-41aa-8b62-2baffaface91)|`'T list`|The list without the first element.| + Following are some examples of using these properties. [!code-fsharp[Main](../../../samples/snippets/fsharp/lang-ref-1/snippet1307.fs)] @@ -441,4 +442,4 @@ For information about additional operations on lists, see the library reference - [F# Types](fsharp-types.md) - [Sequences](sequences.md) - [Arrays](arrays.md) -- [Options](options.md) \ No newline at end of file +- [Options](options.md) diff --git a/docs/fsharp/language-reference/records.md b/docs/fsharp/language-reference/records.md index edf9490c2ae31..4c17acfe23c16 100644 --- a/docs/fsharp/language-reference/records.md +++ b/docs/fsharp/language-reference/records.md @@ -84,6 +84,29 @@ let defaultRecord2 = { Field1 = 1; Field2 = 25 } let rr3 = { defaultRecord1 with Field2 = 42 } ``` +## Creating Mutually Recursive Records + +Sometime when creating a record, you may want to have it depend on another type that you would like to define afterwards. This is a compile error unless you define the record types to be mutually recursive. + +Defining mutually recursive records is done with the `and` keyword. This lets you link 2 or more record types together. + +For example, the following code defines a `Person` and `Address` type as mutually recursive: + +```fsharp +// Create a Person type and use the Address type that is not defined +type Person = + { Name: string + Age: int + Address: Address } +// Define the Address type which is used in the Person record +and Address = + { Line1: string + Line2: string + PostCode: string } +``` + +If you were to define the previous example without the `and` keyword, then it would not compile. The `and` keyword is required for mutually recursive definitions. + ## Pattern Matching with Records Records can be used with pattern matching. You can specify some fields explicitly and provide variables for other fields that will be assigned when a match occurs. The following code example illustrates this. @@ -122,4 +145,4 @@ If you need reference equality for records, add the attribute `[ **New** > **Project** from the menu bar. In the **New Project** dialog, select the **Visual C#** node followed by the **.NET Core** node. Then select the **Console App (.NET Core)** project template. In the **Name** text box, type "IrisClustering" and then select the **OK** button. +1. Open Visual Studio 2017. Select **File** > **New** > **Project** from the menu bar. In the **New Project** dialog, select the **Visual C#** node followed by the **.NET Core** node. Then select the **Console App (.NET Core)** project template. In the **Name** text box, type "IrisFlowerClustering" and then select the **OK** button. 1. Create a directory named *Data* in your project to store the data set and model files: @@ -73,11 +73,11 @@ Create classes for the input data and the predictions: 1. In the **Add New Item** dialog box, select **Class** and change the **Name** field to *IrisData.cs*. Then, select the **Add** button. 1. Add the following `using` directive to the new file: - [!code-csharp[Add necessary usings](../../../samples/machine-learning/tutorials/IrisClustering/IrisData.cs#1)] + [!code-csharp[Add necessary usings](~/samples/machine-learning/tutorials/IrisFlowerClustering/IrisData.cs#Usings)] Remove the existing class definition and add the following code, which defines the classes `IrisData` and `ClusterPrediction`, to the *IrisData.cs* file: -[!code-csharp[Define data classes](../../../samples/machine-learning/tutorials/IrisClustering/IrisData.cs#2)] +[!code-csharp[Define data classes](~/samples/machine-learning/tutorials/IrisFlowerClustering/IrisData.cs#ClassDefinitions)] `IrisData` is the input data class and has definitions for each feature from the data set. Use the [Column](xref:Microsoft.ML.Runtime.Api.ColumnAttribute) attribute to specify the indices of the source columns in the data set file. @@ -98,78 +98,66 @@ Go back to the *Program.cs* file and add two fields to hold the paths to the dat Add the following code right above the `Main` method to specify those paths: -[!code-csharp[Initialize paths](../../../samples/machine-learning/tutorials/IrisClustering/Program.cs#1)] +[!code-csharp[Initialize paths](~/samples/machine-learning/tutorials/IrisFlowerClustering/Program.cs#Paths)] To make the preceding code compile, add the following `using` directives at the top of the *Program.cs* file: -[!code-csharp[Add usings for paths](../../../samples/machine-learning/tutorials/IrisClustering/Program.cs#2)] +[!code-csharp[Add usings for paths](~/samples/machine-learning/tutorials/IrisFlowerClustering/Program.cs#UsingsForPaths)] -## Create a learning pipeline +## Create ML context Add the following additional `using` directives to the top of the *Program.cs* file: -[!code-csharp[Add Microsoft.ML usings](../../../samples/machine-learning/tutorials/IrisClustering/Program.cs#3)] - -In the `Main` method, replace the `Console.WriteLine("Hello World!")` with the following code: +[!code-csharp[Add Microsoft.ML usings](~/samples/machine-learning/tutorials/IrisFlowerClustering/Program.cs#MLUsings)] -[!code-csharp[Call the Train method](../../../samples/machine-learning/tutorials/IrisClustering/Program.cs#4)] +In the `Main` method, replace the `Console.WriteLine("Hello World!");` line with the following code: -The `Train` method trains the model. Create that method just below the `Main` method, using the following code: +[!code-csharp[Create ML context](~/samples/machine-learning/tutorials/IrisFlowerClustering/Program.cs#CreateContext)] -```csharp -private static PredictionModel Train() -{ +The class represents the machine learning environment and provides mechanisms for logging and entry points for data loading, model training, prediction, and other tasks. This is comparable conceptually to using `DbContext` in Entity Framework. -} -``` +## Setup data loading -The learning pipeline loads all of the data and algorithms necessary to train the model. Add the following code into the `Train` method: +Add the following code to the `Main` method to setup the way to load data: -[!code-csharp[Initialize pipeline](../../../samples/machine-learning/tutorials/IrisClustering/Program.cs#5)] +[!code-csharp[Create text loader](~/samples/machine-learning/tutorials/IrisFlowerClustering/Program.cs#SetupTextLoader)] -## Load and transform data +Note that the column names and indices match the schema defined by the `IrisData` class. The value specifies the `float` type. -The first step to perform is to load the training data set. In our case, the training data set is stored in the text file with a path defined by the `_dataPath` field. Columns in the file are separated by the comma (","). Add the following code into the `Train` method: +Use instantiated instance to create an instance, which represents the data source for the training data set: -[!code-csharp[Add step to load data](../../../samples/machine-learning/tutorials/IrisClustering/Program.cs#6)] +[!code-csharp[Create IDataView](~/samples/machine-learning/tutorials/IrisFlowerClustering/Program.cs#CreateDataView)] -The next step is to combine all of the feature columns into the **Features** column using the transformation class. By default, a learning algorithm processes only features from the **Features** column. Add the following code: - -[!code-csharp[Add step to concatenate columns](../../../samples/machine-learning/tutorials/IrisClustering/Program.cs#7)] +## Create a learning pipeline -## Choose a learning algorithm +For this tutorial, the learning pipeline of the clustering task comprises two following steps: -After adding the data to the pipeline and transforming it into the correct input format, you select a learning algorithm (**learner**). The learner trains the model. ML.NET provides a learner that implements [k-means algorithm](https://en.wikipedia.org/wiki/K-means_clustering) with an improved method for choosing the initial cluster centroids. +- concatenate loaded columns into one **Features** column, which is used by a clustering trainer; +- use a trainer to train the model using the k-means++ clustering algorithm. -Add the following code into the `Train` method following the data processing code added in the previous step: +Add the following code to the `Main` method: -[!code-csharp[Add a learner step](../../../samples/machine-learning/tutorials/IrisClustering/Program.cs#8)] +[!code-csharp[Create pipeline](~/samples/machine-learning/tutorials/IrisFlowerClustering/Program.cs#CreatePipeline)] -Use the property to specify number of clusters. The code above specifies that the data set should be split in three clusters. +The code specifies that the data set should be split in three clusters. ## Train the model -The steps added in the preceding sections prepared the pipeline for training, however, none have been executed. The `pipeline.Train` method produces the model that takes in an instance of the `TInput` type and outputs an instance of the `TOutput` type. Add the following code into the `Train` method: +The steps added in the preceding sections prepared the pipeline for training, however, none have been executed. Add the following line to the `Main` method to perform data loading and model training: -[!code-csharp[Train the model and return](../../../samples/machine-learning/tutorials/IrisClustering/Program.cs#9)] +[!code-csharp[Train the model](~/samples/machine-learning/tutorials/IrisFlowerClustering/Program.cs#TrainModel)] ### Save the model -At this point, you have a model that can be integrated into any of your existing or new .NET applications. To save your model to a .zip file, add the following code to the `Main` method below the call to the `Train` method: +At this point, you have a model that can be integrated into any of your existing or new .NET applications. To save your model to a .zip file, add the following code to the `Main` method: -[!code-csharp[Save the model](../../../samples/machine-learning/tutorials/IrisClustering/Program.cs#10)] +[!code-csharp[Save the model](~/samples/machine-learning/tutorials/IrisFlowerClustering/Program.cs#SaveModel)] -Using `await` in the `Main` method means the `Main` method must have the `async` modifier and return a `Task`: - -[!code-csharp[Make the Main method async](../../../samples/machine-learning/tutorials/IrisClustering/Program.cs#11)] - -You also need to add the following `using` directive at the top of the *Program.cs* file: - -[!code-csharp[Add System.Threading.Tasks using](../../../samples/machine-learning/tutorials/IrisClustering/Program.cs#12)] +## Use the model for predictions -Because the `async Main` method is the feature added in C# 7.1 and the default language version of the project is C# 7.0, you need to change the language version to C# 7.1 or higher. To do that, right-click the project node in **Solution Explorer** and select **Properties**. Select the **Build** tab and select the **Advanced** button. In the dropdown, select **C# 7.1** (or a higher version). Select the **OK** button. +To make predictions, use the class that takes instances of the input type through the transformer pipeline and produces instances of the output type. Add the following line to the `Main` method to create an instance of that class: -## Use the model for predictions +[!code-csharp[Create predictor](~/samples/machine-learning/tutorials/IrisFlowerClustering/Program.cs#Predictor)] Create the `TestIrisData` class to house test data instances: @@ -177,24 +165,24 @@ Create the `TestIrisData` class to house test data instances: 1. In the **Add New Item** dialog box, select **Class** and change the **Name** field to *TestIrisData.cs*. Then, select the **Add** button. 1. Modify the class to be static like in the following example: - [!code-csharp[Make class static](../../../samples/machine-learning/tutorials/IrisClustering/TestIrisData.cs#1)] + [!code-csharp[Make class static](~/samples/machine-learning/tutorials/IrisFlowerClustering/TestIrisData.cs#Static)] This tutorial introduces one iris data instance within this class. You can add other scenarios to experiment with the model. Add the following code into the `TestIrisData` class: -[!code-csharp[Test data](../../../samples/machine-learning/tutorials/IrisClustering/TestIrisData.cs#2)] +[!code-csharp[Test data](~/samples/machine-learning/tutorials/IrisFlowerClustering/TestIrisData.cs#TestData)] To find out the cluster to which the specified item belongs to, go back to the *Program.cs* file and add the following code into the `Main` method: -[!code-csharp[Predict and output results](../../../samples/machine-learning/tutorials/IrisClustering/Program.cs#13)] +[!code-csharp[Predict and output results](~/samples/machine-learning/tutorials/IrisFlowerClustering/Program.cs#PredictionExample)] -Run the program to see which cluster contains the specified data instance and squared distances from that instance to the cluster centroids. Your results should be similar to the following. As the pipeline processes, it might display warnings or processing messages. These have been removed from the following output for clarity. +Run the program to see which cluster contains the specified data instance and squared distances from that instance to the cluster centroids. Your results should be similar to the following: ```text Cluster: 2 -Distances: 0.4192338 0.0008847713 0.9660053 +Distances: 11.69127 0.02159119 25.59896 ``` -Congratulations! You've now successfully built a machine learning model for iris clustering and used it to make predictions. You can find the source code for this tutorial at the [dotnet/samples](https://github.com/dotnet/samples/tree/master/machine-learning/tutorials/IrisClustering) GitHub repository. +Congratulations! You've now successfully built a machine learning model for iris clustering and used it to make predictions. You can find the source code for this tutorial at the [dotnet/samples](https://github.com/dotnet/samples/tree/master/machine-learning/tutorials/IrisFlowerClustering) GitHub repository. ## Next steps diff --git a/docs/standard/delegates-lambdas.md b/docs/standard/delegates-lambdas.md index a3c463419560f..d9fcaa1b680da 100644 --- a/docs/standard/delegates-lambdas.md +++ b/docs/standard/delegates-lambdas.md @@ -149,6 +149,8 @@ public MainWindow() } ``` +The `+=` operator in this context is used to subscribe to an [event](../../docs/csharp/language-reference/keywords/event.md). For more information, see [How to: Subscribe to and Unsubscribe from Events](../../docs/csharp/programming-guide/events/how-to-subscribe-to-and-unsubscribe-from-events.md). + ## Further reading and resources * [Delegates](../../docs/csharp/programming-guide/delegates/index.md) diff --git a/docs/standard/garbage-collection/media/backgroundworkstn.png b/docs/standard/garbage-collection/media/backgroundworkstn.png index 994ac160ee0cc..fda88c20081cc 100644 Binary files a/docs/standard/garbage-collection/media/backgroundworkstn.png and b/docs/standard/garbage-collection/media/backgroundworkstn.png differ diff --git a/docs/toc.md b/docs/toc.md index f81932ec1dccb..11773068b0e60 100644 --- a/docs/toc.md +++ b/docs/toc.md @@ -1177,7 +1177,7 @@ ## [Tutorials](machine-learning/tutorials/index.md) ### [Sentiment analysis (binary classification)](machine-learning/tutorials/sentiment-analysis.md) ### [Taxi fare predictor (regression)](machine-learning/tutorials/taxi-fare.md) -### [Iris petals (clustering)](machine-learning/tutorials/iris-clustering.md) +### [Iris flowers (clustering)](machine-learning/tutorials/iris-clustering.md) ## [How-to guides](machine-learning/how-to-guides/index.md) ### [Apply categorical feature engineering ](machine-learning/how-to-guides/train-model-categorical-ml-net.md) ### [Apply textual feature engineering ](machine-learning/how-to-guides/train-model-textual-ml-net.md)