Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions docs/core/tools/cli-msbuild-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,5 @@ This command is publishing an application into a `pub` folder using the "Release

The notable exception to this rule are `new` and `run` commands, as they have not been implemented as MSBuild targets.

<a name="dotnet-restore-note"></a>
[!INCLUDE[DotNet Restore Note](~/includes/dotnet-restore-note.md)]
<a name="dotnet-restore-note"></a>
[!INCLUDE[DotNet Restore Note](~/includes/dotnet-restore-note.md)]
12 changes: 6 additions & 6 deletions docs/core/versions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ The installer UI in those downloads was also modified to clearly present the nam
Here are some examples of this format:

```
dotnet-runtime-2.0.4-macos.10.12-x64.pkg # Mac runtime installer
dotnet-sdk-2.0.4-win10-x64.exe # Windows SDK installer
dotnet-sdk-2.0.4-fedora.24-x64.tar.gz # Fedora 24 binary archive
dotnet-runtime-2.0.4-osx.10.12-x64.pkg # Mac runtime installer
dotnet-sdk-2.0.4-win-x64.exe # Windows SDK installer
dotnet-sdk-2.0.4-linux-x64.tar.gz # Linux binary archive

#Ubuntu file set needed for the SDK
dotnet-host-2.0.4-ubuntu.16.04-x64.deb # Host / muxer and host policy
dotnet-runtime-2.0.4-ubuntu.16.04-x64.deb # runtime
dotnet-sdk-2.0.4-ubuntu.16.04-x64.deb # SDK tools
dotnet-host-2.0.4-ubuntu.16.04-x64.deb # Host / muxer and host policy
dotnet-runtime-2.0.4-ubuntu.16.04-x64.deb # runtime
dotnet-sdk-2.0.4-ubuntu.16.04-x64.deb # SDK tools
```

The format is readable and clearly shows what you're downloading, what version it is, and where you can use it. The runtime package name includes `runtime`, and the SDK includes `SDK`.
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/tour-of-csharp/classes-and-objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ The following program uses the `Expression` classes to evaluate the expression `

### Method overloading

Method *overloading* permits multiple methods in the same class to have the same name as long as they have unique signatures. When compiling an invocation of an overloaded method, the compiler uses *overload resolution* to determine the specific method to invoke. Overload resolution finds the one method that best matches the arguments or reports an error if no single best match can be found. The following example shows overload resolution in effect. The comment for each invocation in the `Main` method shows which method is actually invoked.
Method *overloading* permits multiple methods in the same class to have the same name as long as they have unique signatures. When compiling an invocation of an overloaded method, the compiler uses *overload resolution* to determine the specific method to invoke. Overload resolution finds the one method that best matches the arguments or reports an error if no single best match can be found. The following example shows overload resolution in effect. The comment for each invocation in the `UsageExample` method shows which method is actually invoked.

[!code-csharp[OverloadUsage](../../../samples/snippets/csharp/tour/classes-and-objects/Overloading.cs#L3-L41)]

Expand Down
4 changes: 2 additions & 2 deletions docs/machine-learning/tutorials/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ms.date: 06/06/2018

The following tutorials enable you to understand how to use [ML.NET](../index.md) to build custom machine learning solutions and integrate them into your .NET applications:

* [Sentiment Analysis](sentiment-analysis.md): demonstrates how to apply a binary classification task using ML.NET.
* [Taxi Fare Predictor](taxi-fare.md): demonstrates how to apply a regression task using ML.NET.
* [Sentiment analysis](sentiment-analysis.md): demonstrates how to apply a binary classification task using ML.NET.
* [Taxi fare predictor](taxi-fare.md): demonstrates how to apply a regression task using ML.NET.

For more examples that use ML.NET, check the [dotnet/machinelearning-samples](https://github.com/dotnet/machinelearning-samples) GitHub repository.
2 changes: 1 addition & 1 deletion docs/machine-learning/tutorials/sentiment-analysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ The `Train` method executes the following tasks:
Create the `Train` method, just after the `Main` method, using the following code:

```csharp
public static PredictionModel<SentimentData, SentimentPrediction> Train()
public static async Task<PredictionModel<SentimentData, SentimentPrediction>> Train()
{

}
Expand Down
147 changes: 76 additions & 71 deletions docs/machine-learning/tutorials/taxi-fare.md

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions docs/standard/choosing-core-framework-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Choose between .NET Core and .NET Framework for server apps
description: A guide on which implementation of .NET you should consider when building a server app in .NET.
author: cartermp
ms.author: mairaw
ms.date: 03/15/2018
ms.date: 06/19/2018
---
# Choosing between .NET Core and .NET Framework for server apps

Expand Down Expand Up @@ -83,8 +83,6 @@ Some .NET Framework technologies aren't available in .NET Core. Some of them mig

* ASP.NET Web Pages applications: ASP.NET Web Pages aren't included in ASP.NET Core. ASP.NET Core [Razor Pages](/aspnet/core/mvc/razor-pages/) have many similarities with Web Pages.

* ASP.NET SignalR server/client implementation. Currently, [ASP.NET SignalR](https://github.com/aspnet/SignalR) is available in preview mode with ASP.NET Core 2.1.

* WCF services implementation. Even when there’s a [WCF-Client library](https://github.com/dotnet/wcf) to consume WCF services from .NET Core, WCF server implementation is currently only available in the .NET Framework. This scenario is not part of the current plan for .NET Core but it’s being considered for the future.

* Workflow-related services: Windows Workflow Foundation (WF), Workflow Services (WCF + WF in a single service) and WCF Data Services (formerly known as "ADO.NET Data Services") are only available in the .NET Framework. There are no plans to bring WF/WCF+WF/WCF Data Services to .NET Core.
Expand Down
65 changes: 32 additions & 33 deletions docs/standard/exceptions/index.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
title: "Handling and Throwing Exceptions"
ms.date: "03/30/2017"
title: "Handling and throwing exceptions in .NET"
ms.date: "06/19/2018"
ms.technology: dotnet-standard
helpviewer_keywords:
- "exceptions [.NET Framework], handling"
- "exceptions [.NET], handling"
- "runtime, exceptions"
- "filtering exceptions"
- "errors [.NET Framework], exceptions"
- "exceptions [.NET Framework], throwing"
- "exceptions [.NET Framework]"
- "errors [.NET], exceptions"
- "exceptions [.NET], throwing"
- "exceptions [.NET]"
- "common language runtime, exceptions"
ms.assetid: f99a1d29-a2a8-47af-9707-9909f9010735
author: "mairaw"
Expand All @@ -20,7 +20,7 @@ Applications must be able to handle errors that occur during execution in a cons

## Exceptions

An exception is any error condition or unexpected behavior that is encountered by an executing program. Exceptions can be thrown because of a fault in your code or in code that you call (such as a shared library), unavailable operating system resources, unexpected conditions that the runtime encounters (such as code that cannot be verified), and so on. Your application can recover from some of these conditions, but not from others. Although you can recover from most application exceptions, you cannot recover from most runtime exceptions.
An exception is any error condition or unexpected behavior that is encountered by an executing program. Exceptions can be thrown because of a fault in your code or in code that you call (such as a shared library), unavailable operating system resources, unexpected conditions that the runtime encounters (such as code that can't be verified), and so on. Your application can recover from some of these conditions, but not from others. Although you can recover from most application exceptions, you can't recover from most runtime exceptions.

In .NET, an exception is an object that inherits from the <xref:System.Exception?displayProperty=nameWithType> class. An exception is thrown from an area of code where a problem has occurred. The exception is passed up the stack until the application handles it or the program terminates.

Expand All @@ -30,38 +30,37 @@ Traditionally, a language's error-handling model relied on either the language's

- Exception throwing and handling works the same for .NET programming languages.

- Does not require any particular language syntax for handling exceptions, but allows each language to define its own syntax.
- Doesn't require any particular language syntax for handling exceptions, but allows each language to define its own syntax.

- Exceptions can be thrown across process and even machine boundaries.

- Exception-handling code can be added to an application to increase program reliability.

Exceptions offer advantages over other methods of error notification, such as return codes. Failures do not go unnoticed because if an exception is thrown and you don't handle it, the runtime terminates your application. Invalid values do not continue to propagate through the system as a result of code that fails to check for a failure return code.
Exceptions offer advantages over other methods of error notification, such as return codes. Failures don't go unnoticed because if an exception is thrown and you don't handle it, the runtime terminates your application. Invalid values don't continue to propagate through the system as a result of code that fails to check for a failure return code.

## Common Exceptions
## Common exceptions

The following table lists some common exceptions with examples of what can cause them.

| Exception type | Base type | Description | Example |
| -------------- | --------- | ----------- | ------- |
| <xref:System.Exception> | <xref:System.Object> | Base class for all exceptions. | None (use a derived class of this exception). |
| <xref:System.IndexOutOfRangeException> | <xref:System.Exception> | Thrown by the runtime only when an array is indexed improperly. | Indexing an array outside its valid range: `arr[arr.Length+1]` |
| <xref:System.NullReferenceException> | <xref:System.Exception> | Thrown by the runtime only when a null object is referenced. | `object o = null; o.ToString();` |
| <xref:System.InvalidOperationException> | <xref:System.Exception> | Thrown by methods when in an invalid state. | Calling `Enumerator.GetNext()` after removing an Item from the underlying collection. |
| <xref:System.ArgumentException> | <xref:System.Exception> | Base class for all argument exceptions. | None (use a derived class of this exception). |
| <xref:System.ArgumentNullException> | <xref:System.Exception> | Thrown by methods that do not allow an argument to be null. | `String s = null; "Calculate".IndexOf (s);` |
| <xref:System.ArgumentOutOfRangeException> | <xref:System.Exception> | Thrown by methods that verify that arguments are in a given range. | `String s = "string"; s.Substring(s.Length+1);` |

## See Also

* [Exception Class and Properties](exception-class-and-properties.md)
* [How to: Use the Try-Catch Block to Catch Exceptions](how-to-use-the-try-catch-block-to-catch-exceptions.md)
* [How to: Use Specific Exceptions in a Catch Block](how-to-use-specific-exceptions-in-a-catch-block.md)
* [How to: Explicitly Throw Exceptions](how-to-explicitly-throw-exceptions.md)
* [How to: Create User-Defined Exceptions](how-to-create-user-defined-exceptions.md)
* [Using User-Filtered Exception Handlers](using-user-filtered-exception-handlers.md)
* [How to: Use Finally Blocks](how-to-use-finally-blocks.md)
* [Handling COM Interop Exceptions](handling-com-interop-exceptions.md)
* [Best Practices for Exceptions](best-practices-for-exceptions.md)

To learn more about how exceptions work in .NET, see [What Every Dev needs to Know About Exceptions in the Runtime](https://github.com/dotnet/coreclr/blob/master/Documentation/botr/exceptions.md).
| Exception type | Description | Example |
| -------------- | ----------- | ------- |
| <xref:System.Exception> | Base class for all exceptions. | None (use a derived class of this exception). |
| <xref:System.IndexOutOfRangeException> | Thrown by the runtime only when an array is indexed improperly. | Indexing an array outside its valid range: <br /> `arr[arr.Length+1]` |
| <xref:System.NullReferenceException> | Thrown by the runtime only when a null object is referenced. | `object o = null;` <br /> `o.ToString();` |
| <xref:System.InvalidOperationException> | Thrown by methods when in an invalid state. | Calling `Enumerator.MoveNext()` after removing an item from the underlying collection. |
| <xref:System.ArgumentException> | Base class for all argument exceptions. | None (use a derived class of this exception). |
| <xref:System.ArgumentNullException> | Thrown by methods that do not allow an argument to be null. | `String s = null;` <br /> `"Calculate".IndexOf(s);`|
| <xref:System.ArgumentOutOfRangeException> | Thrown by methods that verify that arguments are in a given range. | `String s = "string";` <br /> `s.Substring(s.Length+1);` |

## See also

[Exception Class and Properties](exception-class-and-properties.md)
[How to: Use the Try-Catch Block to Catch Exceptions](how-to-use-the-try-catch-block-to-catch-exceptions.md)
[How to: Use Specific Exceptions in a Catch Block](how-to-use-specific-exceptions-in-a-catch-block.md)
[How to: Explicitly Throw Exceptions](how-to-explicitly-throw-exceptions.md)
[How to: Create User-Defined Exceptions](how-to-create-user-defined-exceptions.md)
[Using User-Filtered Exception Handlers](using-user-filtered-exception-handlers.md)
[How to: Use Finally Blocks](how-to-use-finally-blocks.md)
[Handling COM Interop Exceptions](handling-com-interop-exceptions.md)
[Best Practices for Exceptions](best-practices-for-exceptions.md)
[What Every Dev needs to Know About Exceptions in the Runtime](https://github.com/dotnet/coreclr/blob/master/Documentation/botr/exceptions.md).
8 changes: 4 additions & 4 deletions docs/standard/io/how-to-read-text-from-a-file.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "How to: Read Text from a File"
ms.date: "03/30/2017"
ms.date: "06/19/2018"
ms.technology: dotnet-standard
dev_langs:
- "csharp"
Expand All @@ -18,16 +18,16 @@ ms.author: "mairaw"
# How to: Read Text from a File
The following examples show how to read text synchronously and asynchronously from a text file using .NET for desktop apps. In both examples, when you create the instance of the <xref:System.IO.StreamReader> class, you provide the relative or absolute path to the file. The following examples assume that the file named TestFile.txt is in the same folder as the application.

These code examples do not apply developing for Windows Store Apps because the Windows Runtime provides different streams types reading and writing to files. For an example that shows how to read text from a file within the context of a Windows Store app, see [Quickstart: Reading and writing files](http://msdn.microsoft.com/library/windows/apps/hh758325.aspx). For examples that show how to convert between .NET Framework streams and Windows runtime streams see [How to: Convert Between .NET Framework Streams and Windows Runtime Streams](../../../docs/standard/io/how-to-convert-between-dotnet-streams-and-winrt-streams.md).
These code examples do not apply to developing for Windows Store Apps because the Windows Runtime provides different stream types for reading and writing to files. For an example that shows how to read text from a file in a Windows Store app, see [Quickstart: Reading and writing files](https://docs.microsoft.com/en-us/previous-versions/windows/apps/hh758325(v=win.10)). For examples that show how to convert between .NET Framework streams and Windows runtime streams, see [How to: Convert Between .NET Framework Streams and Windows Runtime Streams](../../../docs/standard/io/how-to-convert-between-dotnet-streams-and-winrt-streams.md).

## Example
The first example shows a synchronous read operation within a console application. In this example, the text file is opened using a stream reader, the contents are copied to a string and string is output to the console.
The following example shows a synchronous read operation within a console application. In this example, the text file is opened using a stream reader, the contents are copied to a string, and the string is output to the console.

[!code-csharp[Conceptual.BasicIO.TextFiles#3](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.basicio.textfiles/cs/source3.cs#3)]
[!code-vb[Conceptual.BasicIO.TextFiles#3](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.basicio.textfiles/vb/source3.vb#3)]

## Example
The second example shows an asynchronous read operation within a Windows Presentation Foundation (WPF) application.
The following example shows an asynchronous read operation in a Windows Presentation Foundation (WPF) application.

[!code-csharp[Conceptual.BasicIO.TextFiles#6](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.basicio.textfiles/cs/source6.cs#6)]
[!code-vb[Conceptual.BasicIO.TextFiles#6](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.basicio.textfiles/vb/source6.vb#6)]
Expand Down
2 changes: 1 addition & 1 deletion docs/standard/net-standard.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: .NET Standard
description: Learn about .NET Standard, its versions and the .NET implementations that support it.
author: mairaw
ms.author: mairaw
ms.date: 08/13/2017
ms.date: 05/18/2018
ms.technology: dotnet-standard
ms.assetid: c044882c-af15-45f2-96d1-534557a5ee9b
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ This document describes how to use the TPL Dataflow Library to implement a produ
**vbc.exe /r:System.Threading.Tasks.Dataflow.dll DataflowProducerConsumer.vb**

## Robust Programming
This example uses just one consumer to process the source data. If you have multiple consumers in your application, use the <xref:System.Threading.Tasks.Dataflow.IReceivableSourceBlock%601.TryReceive%2A> method to read data from the source block, as shown in the following example.
The preceding example uses just one consumer to process the source data. If you have multiple consumers in your application, use the <xref:System.Threading.Tasks.Dataflow.IReceivableSourceBlock%601.TryReceive%2A> method to read data from the source block, as shown in the following example.

[!code-csharp[TPLDataflow_ProducerConsumer#2](../../../samples/snippets/csharp/VS_Snippets_Misc/tpldataflow_producerconsumer/cs/dataflowproducerconsumer.cs#2)]
[!code-vb[TPLDataflow_ProducerConsumer#2](../../../samples/snippets/visualbasic/VS_Snippets_Misc/tpldataflow_producerconsumer/vb/dataflowproducerconsumer.vb#2)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
|Scope|Edge|
|Version|4.7.2|
|Type|Retargeting|
|Affected APIs|<ul><li><xref:System.Diagnostics.StackTrace.%23ctor(System.Boolean)?displayProperty=nameWithType></li><li>`System.Diagnostics.StackTrace.%23ctor(System.Exception,System.Boolean)`<li><xref:System.Diagnostics.StackTrace.%23ctor(System.Exception,System.Int32,System.Boolean)?displayProperty=nameWithType></li></ul>|
|Affected APIs|<ul><li><xref:System.Diagnostics.StackTrace.%23ctor(System.Boolean)?displayProperty=nameWithType></li><li><xref:System.Diagnostics.StackTrace.%23ctor(System.Exception,System.Boolean)?displayProperty=nameWithType><li><xref:System.Diagnostics.StackTrace.%23ctor(System.Exception,System.Int32,System.Boolean)?displayProperty=nameWithType></li></ul>|