diff --git a/docs/core/docker/building-net-docker-images.md b/docs/core/docker/building-net-docker-images.md index 0b17ee90d3d5d..d956fcda97fcc 100644 --- a/docs/core/docker/building-net-docker-images.md +++ b/docs/core/docker/building-net-docker-images.md @@ -78,6 +78,17 @@ Latest versions of each variant: * This .NET Core Docker sample demonstrates a best practice pattern for [building Docker images for .NET Core apps for production.](https://github.com/dotnet/dotnet-docker/tree/master/samples/dotnetapp) +## Forward the request scheme and original IP address + +Proxy servers, load balancers, and other network appliances often obscure information about a request before it reaches the containerized app: + +* When HTTPS requests are proxied over HTTP, the original scheme (HTTPS) is lost and must be forwarded in a header. +* Because an app receives a request from the proxy and not its true source on the Internet or corporate network, the original client IP address must also be forwarded in a header. + +This information may be important in request processing, for example in redirects, authentication, link generation, policy evaluation, and client geolocation. + +To forward the scheme and original IP address to a containerized ASP.NET Core app, use Forwarded Headers Middleware. For more information, see [Configure ASP.NET Core to work with proxy servers and load balancers](/aspnet/core/host-and-deploy/proxy-load-balancer). + ## Your first ASP.NET Core Docker app For this tutorial, lets use an ASP.NET Core Docker sample application for the app we want to dockerize. This ASP.NET Core Docker sample application demonstrates a best practice pattern for building Docker images for ASP.NET Core apps for production. The sample works with both Linux and Windows containers. @@ -253,7 +264,6 @@ Congratulations! you have just: > * Built and ran the sample with Docker for Linux containers > * Built and ran the sample with Docker for Windows containers - **Next Steps** Here are some next steps you can take: diff --git a/docs/core/versions/selection.md b/docs/core/versions/selection.md index 21031709da865..323b175692dee 100644 --- a/docs/core/versions/selection.md +++ b/docs/core/versions/selection.md @@ -47,7 +47,7 @@ The process for selecting an SDK version is: 1. `dotnet` uses the SDK specified in the first *global.json* found. 1. `dotnet` uses the latest installed SDK if no *global.json* is found. -You can learn more about selecting an SDK version in the [matching rules](../tools/global-json.md) section of the topic on *global.json*. +You can learn more about selecting an SDK version in the [Matching rules](../tools/global-json.md#matching-rules) section of the topic on *global.json*. ## Target Framework Monikers define build time APIs diff --git a/docs/csharp/programming-guide/classes-and-structs/fields.md b/docs/csharp/programming-guide/classes-and-structs/fields.md index ef30b6f415e0b..0741f3d11e523 100644 --- a/docs/csharp/programming-guide/classes-and-structs/fields.md +++ b/docs/csharp/programming-guide/classes-and-structs/fields.md @@ -35,7 +35,7 @@ A *field* is a variable of any type that is declared directly in a [class](../.. A field can optionally be declared [static](../../../csharp/language-reference/keywords/static.md). This makes the field available to callers at any time, even if no instance of the class exists. For more information, see [Static Classes and Static Class Members](../../../csharp/programming-guide/classes-and-structs/static-classes-and-static-class-members.md). - A field can be declared [readonly](../../../csharp/language-reference/keywords/readonly.md). A read-only field can only be assigned a value during initialization or in a constructor. A `static``readonly` field is very similar to a constant, except that the C# compiler does not have access to the value of a static read-only field at compile time, only at run time. For more information, see [Constants](../../../csharp/programming-guide/classes-and-structs/constants.md). + A field can be declared [readonly](../../../csharp/language-reference/keywords/readonly.md). A read-only field can only be assigned a value during initialization or in a constructor. A `static readonly` field is very similar to a constant, except that the C# compiler does not have access to the value of a static read-only field at compile time, only at run time. For more information, see [Constants](../../../csharp/programming-guide/classes-and-structs/constants.md). ## C# Language Specification [!INCLUDE[CSharplangspec](~/includes/csharplangspec-md.md)] diff --git a/docs/framework/configure-apps/file-schema/network/proxy-element-network-settings.md b/docs/framework/configure-apps/file-schema/network/proxy-element-network-settings.md index 1f9840c2c4b57..bd79a7bbc899f 100644 --- a/docs/framework/configure-apps/file-schema/network/proxy-element-network-settings.md +++ b/docs/framework/configure-apps/file-schema/network/proxy-element-network-settings.md @@ -42,7 +42,7 @@ Defines a proxy server. |`autoDetect`|Specifies whether the proxy is automatically detected. The default value is `unspecified`.| |`bypassonlocal`|Specifies whether the proxy is bypassed for local resources. Local resources include the local server (`http://localhost`, `http://loopback`, or `http://127.0.0.1`) and a URI without a period (`http://webserver`). The default value is `unspecified`.| |`proxyaddress`|Specifies the proxy URI to use.| -|`scriptLocation`|Specifies the location of the configuration script.| +|`scriptLocation`|Specifies the location of the configuration script. Do not use the `bypassonlocal` attribute with this attribute. | |`usesystemdefault`|Specifies whether to use Internet Explorer proxy settings. If set to `true`, subsequent attributes will override Internet Explorer proxy settings. The default value is `unspecified`.| ### Child Elements @@ -61,7 +61,7 @@ Defines a proxy server. The value for the `proxyaddress` attribute should be a well-formed Uniform Resource Indicator (URI). - The `scriptLocation` attribute refers to the automatic detection of proxy configuration scripts. The class will attempt to locate a configuration script (usually named Wpad.dat) when the **Use automatic configuration script** option is selected in Internet Explorer. + The `scriptLocation` attribute refers to the automatic detection of proxy configuration scripts. The class will attempt to locate a configuration script (usually named Wpad.dat) when the **Use automatic configuration script** option is selected in Internet Explorer. If `bypassonlocal` is set to any value, `scriptLocation` is ignored. Use the `usesystemdefault` attribute for .NET Framework version 1.1 applications that are migrating to version 2.0. diff --git a/docs/framework/data/adonet/ef/language-reference/entity-sql-reference.md b/docs/framework/data/adonet/ef/language-reference/entity-sql-reference.md index 94976960bb890..c34d4b1819af9 100644 --- a/docs/framework/data/adonet/ef/language-reference/entity-sql-reference.md +++ b/docs/framework/data/adonet/ef/language-reference/entity-sql-reference.md @@ -48,7 +48,7 @@ Equality and inequality are defined for any object type that has identity, such |[< (Less Than)](less-than-entity-sql.md)|Compares two expressions to determine whether the left expression has a value less than the right expression.| |[<= (Less Than or Equal To)](less-than-or-equal-to-entity-sql.md)|Compares two expressions to determine whether the left expression has a value less than or equal to the right expression.| |[\[NOT\] BETWEEN](between-entity-sql.md)|Determines whether an expression results in a value in a specified range.| -|[!= (Not Equal To)](not-equal-to-entity-sql.md)|Compares two expressions to determine whether the left expression isn't equal to the right expression.| +|[\!= (Not Equal To)](not-equal-to-entity-sql.md)|Compares two expressions to determine whether the left expression isn't equal to the right expression.| |[\[NOT\] LIKE](like-entity-sql.md)|Determines whether a specific character string matches a specified pattern.| ## Logical and case expression operators @@ -58,7 +58,7 @@ Logical operators test for the truth of a condition. The CASE expression evaluat |Operator|Description| |--------------|-----------------| |[&& (Logical AND)](and-entity-sql.md)|Logical AND.| -|[! (Logical NOT)](not-entity-sql.md)|Logical NOT.| +|[\! (Logical NOT)](not-entity-sql.md)|Logical NOT.| |[|| (Logical OR)](or-entity-sql.md)|Logical OR.| |[CASE](case-entity-sql.md)|Evaluates a set of Boolean expressions to determine the result.| |[THEN](then-entity-sql.md)|The result of a [WHEN](http://msdn.microsoft.com/library/6233fe9f-00b0-460e-8372-64e138a5f998) clause when it evaluates to true.| diff --git a/docs/fsharp/get-started/get-started-visual-studio.md b/docs/fsharp/get-started/get-started-visual-studio.md index c0e601844431e..aca02c4ecdaa4 100644 --- a/docs/fsharp/get-started/get-started-visual-studio.md +++ b/docs/fsharp/get-started/get-started-visual-studio.md @@ -41,7 +41,7 @@ It is in this function that we call the `square` function with an argument of `1 ## Running your code -You can run the code and see results by pressing **ctrl-f5**. This will run the program without debugging and allows you to see the results. Alternatively, you can choose the **Debug** top-level menu item in Visual Studio and choose **Start Without Debugging**. +You can run the code and see results by pressing **Ctrl**+**F5**. This runs the program without debugging and allows you to see the results. Alternatively, you can choose the **Debug** top-level menu item in Visual Studio and choose **Start Without Debugging**. You should now see the following printed to the console window that Visual Studio popped up: @@ -56,7 +56,8 @@ Congratulations! You've created your first F# project in Visual Studio, written If you haven't already, check out the [Tour of F#](../tour.md), which covers some of the core features of the F# language. It will give you an overview of some of the capabilities of F#, and provide ample code samples that you can copy into Visual Studio and run. There are also some great external resources you can use, showcased in the [F# Guide](../index.md). ## See also - [Tour of F#](../tour.md) - [F# language reference](../language-reference/index.md) - [Type inference](../language-reference/type-inference.md) - [Symbol and operator reference](../language-reference/symbol-and-operator-reference/index.md) + +- [Tour of F#](../tour.md) +- [F# language reference](../language-reference/index.md) +- [Type inference](../language-reference/type-inference.md) +- [Symbol and operator reference](../language-reference/symbol-and-operator-reference/index.md) diff --git a/docs/machine-learning/tutorials/sentiment-analysis.md b/docs/machine-learning/tutorials/sentiment-analysis.md index f1cf0a0939c72..b194131dd1aeb 100644 --- a/docs/machine-learning/tutorials/sentiment-analysis.md +++ b/docs/machine-learning/tutorials/sentiment-analysis.md @@ -100,7 +100,7 @@ Classification tasks are frequently one of the following types: 1. Download the [WikiPedia detox-250-line-data.tsv](https://github.com/dotnet/machinelearning/blob/master/test/data/wikipedia-detox-250-line-data.tsv) and the [wikipedia-detox-250-line-test.tsv](https://github.com/dotnet/machinelearning/blob/master/test/data/wikipedia-detox-250-line-test.tsv) data sets and save them to the *Data* folder previously created. The first dataset trains the machine learning model and the second can be used to evaluate how accurate your model is. -2. In Solution Explorer, right-click each of the \*.tsv files and select **Properties**. Under **Advanced**, change the value of **Copy to Output Directory** to **Always**. +2. In Solution Explorer, right-click each of the \*.tsv files and select **Properties**. Under **Advanced**, change the value of **Copy to Output Directory** to **Copy if newer**. ### Create classes and define paths diff --git a/docs/machine-learning/tutorials/taxi-fare.md b/docs/machine-learning/tutorials/taxi-fare.md index 89fe10b3d1467..55903ae1997e6 100644 --- a/docs/machine-learning/tutorials/taxi-fare.md +++ b/docs/machine-learning/tutorials/taxi-fare.md @@ -3,7 +3,7 @@ title: Use ML.NET to predict New York taxi fares (regression) description: Learn how to use ML.NET in a regression scenario. author: aditidugar ms.author: johalex -ms.date: 06/18/2018 +ms.date: 07/02/2018 ms.topic: tutorial ms.custom: mvc #Customer intent: As a developer, I want to use ML.NET so that I can train and build a model in a regression scenario to predict New York taxi fares. @@ -11,7 +11,7 @@ ms.custom: mvc # Tutorial: Use ML.NET to predict New York taxi fares (regression) > [!NOTE] -> This topic refers to ML.NET, which is currently in Preview, and material may be subject to change. For more information, visit [the ML.NET introduction](https://www.microsoft.com/net/learn/apps/machine-learning-and-ai/ml-dotnet). +> This topic refers to ML.NET, which is currently in Preview, and material may be subject to change. For more information, see the [ML.NET introduction](https://www.microsoft.com/net/learn/apps/machine-learning-and-ai/ml-dotnet). This tutorial illustrates how to use ML.NET to build a [regression model](../resources/glossary.md#regression) for predicting New York City taxi fares. @@ -33,21 +33,21 @@ In this tutorial, you learn how to: ## Understand the problem -This problem is centered around **predicting the fare of a taxi trip in New York City**. At first glance, it may seem to depend simply on the distance traveled. However, taxi vendors in New York charge varying amounts for other factors such as additional passengers or paying with a credit card instead of cash. +This problem is about predicting the fare of a taxi trip in New York City. At first glance, it may seem to depend simply on the distance traveled. However, taxi vendors in New York charge varying amounts for other factors such as additional passengers or paying with a credit card instead of cash. ## Select the appropriate machine learning task -To predict the taxi fare, you first select the appropriate machine learning task. You are looking to predict a real value (a double that represents price) based on the other factors in the dataset. You choose a [**regression**](../resources/glossary.md#regression) task. +You want to predict the price value, which is a real value, based on the other factors in the data set. To do that you choose a [regression](../resources/glossary.md#regression) machine learning task. ## Create a console application 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 "TaxiFarePrediction" and then select the **OK** button. -2. Create a directory named *Data* in your project to save the data set files: +1. Create a directory named *Data* in your project to store the data set and model files: In **Solution Explorer**, right-click the project and select **Add** > **New Folder**. Type "Data" and hit Enter. -3. Install the **Microsoft.ML NuGet Package**: +1. Install the **Microsoft.ML** NuGet Package: In **Solution Explorer**, right-click the project and select **Manage NuGet Packages**. Choose "nuget.org" as the Package source, select the **Browse** tab, search for **Microsoft.ML**, select that package in the list, and select the **Install** button. Select the **OK** button on the **Preview Changes** dialog and then select the **I Accept** button on the **License Acceptance** dialog if you agree with the license terms for the packages listed. @@ -55,9 +55,9 @@ To predict the taxi fare, you first select the appropriate machine learning task 1. Download the [taxi-fare-train.csv](https://github.com/dotnet/machinelearning/blob/master/test/data/taxi-fare-train.csv) and the [taxi-fare-test.csv](https://github.com/dotnet/machinelearning/blob/master/test/data/taxi-fare-test.csv) data sets and save them to the *Data* folder you've created at the previous step. We use these data sets to train the machine learning model and then evaluate how accurate the model is. These data sets are originally from the [NYC TLC Taxi Trip data set](http://www.nyc.gov/html/tlc/html/about/trip_record_data.shtml). -2. In **Solution Explorer**, right-click each of the \*.csv files and select **Properties**. Under **Advanced**, change the value of **Copy to Output Directory** to **Always**. +1. In **Solution Explorer**, right-click each of the \*.csv files and select **Properties**. Under **Advanced**, change the value of **Copy to Output Directory** to **Copy if newer**. -3. Open the **taxi-fare-train.csv** data set and look at column headers in the first row. Take a look at each of the columns. Understand the data and decide which columns are **features** and which one is the **label**. +1. Open the **taxi-fare-train.csv** data set and look at column headers in the first row. Take a look at each of the columns. Understand the data and decide which columns are **features** and which one is the **label**. The **label** is the identifier of the column you want to predict. The identified **features** are used to predict the label. @@ -87,7 +87,10 @@ Remove the existing class definition and add the following code, which has two c `TaxiTrip` is the input data class and has definitions for each of the data set columns. Use the [Column](xref:Microsoft.ML.Runtime.Api.ColumnAttribute) attribute to specify the indices of the source columns in the data set. -The `TaxiTripFarePrediction` class is used to represent predicted results. It has a single float (`FareAmount`) field with a `Score` [ColumnName](xref:Microsoft.ML.Runtime.Api.ColumnNameAttribute) attribute applied. The **Score** column is the special column in ML.NET. The model outputs predicted values into that column. +The `TaxiTripFarePrediction` class represents predicted results. It has a single float field, `FareAmount`, with a `Score` [ColumnName](xref:Microsoft.ML.Runtime.Api.ColumnNameAttribute) attribute applied. In case of the regression task the **Score** column contains predicted label values. + +> [!NOTE] +> Use the `float` type to represent floating-point values in the input and prediction data classes. ## Define data and model paths @@ -111,7 +114,7 @@ Add the following additional `using` directives to the top of the *Program.cs* f [!code-csharp[AddUsings](../../../samples/machine-learning/tutorials/TaxiFarePrediction/Program.cs#1 "Add necessary usings")] -In `Main`, replace the `Console.WriteLine("Hello World!")` with the following code: +In the `Main` method, replace the `Console.WriteLine("Hello World!")` with the following code: ```csharp PredictionModel model = Train(); @@ -134,7 +137,7 @@ var pipeline = new LearningPipeline(); ## Load and transform data -The first step that the learning pipeline performs is loading data from the training data set. In our case, training data set is stored in the text file with a path defined by the `_datapath` field. That file contains the header with the column names, so the first row should be ignored while loading data. Columns in the file are separated by the comma (","). Add the following code into the `Train` method: +The first step to perform is to load data from the training data set. In our case, training data set is stored in the text file with a path defined by the `_datapath` field. That file has the header with the column names, so the first row should be ignored while loading data. Columns in the file are separated by the comma (","). Add the following code into the `Train` method: ```csharp pipeline.Add(new TextLoader(_datapath).CreateFrom(useHeader: true, separator: ',')); @@ -142,7 +145,7 @@ pipeline.Add(new TextLoader(_datapath).CreateFrom(useHeader: true, sep In the next steps we refer to the columns by the names defined in the `TaxiTrip` class. -When the model is trained and evaluated, the values in the **Label** column are considered as correct values to be predicted. As we want to predict the taxi trip fare, copy the `FareAmount` column into the **Label** column. To do that, use and add the following code: +When the model is trained and evaluated, by default, the values in the **Label** column are considered as correct values to be predicted. As we want to predict the taxi trip fare, copy the `FareAmount` column into the **Label** column. To do that, use and add the following code: ```csharp pipeline.Add(new ColumnCopier(("FareAmount", "Label"))); @@ -156,7 +159,7 @@ pipeline.Add(new CategoricalOneHotVectorizer("VendorId", "PaymentType")); ``` -The last step in data preparation combines all of the feature columns into the **Features** column using the transformation class. This step is necessary as a learner processes only features from the **Features** column. Add the following code: +The last step in data preparation combines 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: ```csharp pipeline.Add(new ColumnConcatenator("Features", @@ -174,7 +177,7 @@ Notice that the `TripTime` column, which corresponds to the `trip_time_in_secs` ## Choose a learning algorithm -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. You chose a **regression task** for this problem, so you add a learner, which is one of the regression learners provided by ML.NET. +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. You chose a **regression** task for this problem, so you use a learner, which is one of the regression learners provided by ML.NET. learner utilizes gradient boosting. Gradient boosting is a machine learning technique for regression problems. It builds each regression tree in a step-wise fashion. It uses a pre-defined loss function to measure the error in each step and correct for it in the next. The result is a prediction model that is actually an ensemble of weaker prediction models. For more information about gradient boosting, see [Boosted Decision Tree Regression](/azure/machine-learning/studio-module-reference/boosted-decision-tree-regression). @@ -198,7 +201,7 @@ And that's it! You have successfully trained a machine learning model that can p ### Save the model -Before you go onto the next step, save the model to a .zip file by adding the following code at the end of 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 the model to a .zip file, add the following code at the end of the `Train` method: [!code-csharp[SaveModel](../../../samples/machine-learning/tutorials/TaxiFarePrediction/Program.cs#5 "Save the model asynchronously and return the model")] @@ -222,7 +225,7 @@ Because the `async Main` method is the feature added in C# 7.1 and the default l ## Evaluate the model -Evaluation is the process of checking how well the model predicts label values. It's important that the model makes good predictions on data that was not used to train the model. One way to do this is to split the data into train and test data sets, as it's done in this tutorial. Now that you've trained the model on the train data, you can see how well it performs on the test data. +Evaluation is the process of checking how well the model predicts label values. It's important that the model makes good predictions on data that was not used to train the model. One way to do this is to split the data into training and test data sets, as it's done in this tutorial. Now that you've trained the model on the training data, you can see how well it performs on the test data. Go back to the `Main` method and add the following code beneath the call to the `Train`method: @@ -255,7 +258,7 @@ Add the following code to evaluate the model and produce the evaluation metrics: ## Use the model for predictions -Next, create a class to house test scenarios that you can use to make sure the model is working correctly: +Create a class to house test data instances: 1. In **Solution Explorer**, right-click the project, and then select **Add** > **New Item**. 1. In the **Add New Item** dialog box, select **Class** and change the **Name** field to *TestTrips.cs*. Then, select the **Add** button. @@ -275,7 +278,7 @@ To predict the fare of the specified trip, go back to the *Program.cs* file and Run the program to see the predicted taxi fare for your test case. -Congratulations! You've now successfully built a machine learning model for predicting taxi trip fares, evaluated its accuracy, 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/TaxiFarePrediction) repository. +Congratulations! You've now successfully built a machine learning model for predicting taxi trip fares, evaluated its accuracy, 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/TaxiFarePrediction) GitHub repository. ## Next steps diff --git a/docs/visual-basic/language-reference/statements/end-keyword-statement.md b/docs/visual-basic/language-reference/statements/end-keyword-statement.md index 6fb3729ddd529..ce1a28fc48da0 100644 --- a/docs/visual-basic/language-reference/statements/end-keyword-statement.md +++ b/docs/visual-basic/language-reference/statements/end-keyword-statement.md @@ -8,124 +8,91 @@ helpviewer_keywords: ms.assetid: 42d6e088-ab0f-4cda-88e8-fdce3e5fcf4f --- # End <keyword> Statement (Visual Basic) -When followed by an additional keyword, terminates the definition of the statement block introduced by that keyword. - -## Syntax - -``` -End AddHandler -End Class -End Enum -End Event -End Function -End Get -End If -End Interface -End Module -End Namespace -End Operator -End Property + +When followed by an additional keyword, terminates the definition of the statement block introduced by that keyword. + +## Syntax + +```vb +End AddHandler +End Class +End Enum +End Event +End Function +End Get +End If +End Interface +End Module +End Namespace +End Operator +End Property End RaiseEvent End RemoveHandler -End Select -End Set -End Structure -End Sub -End SyncLock -End Try -End While +End Select +End Set +End Structure +End Sub +End SyncLock +End Try +End While End With ``` -## Parts - `End` - Required. Terminates the definition of the programming element. - - `AddHandler` - Required to terminate an `AddHandler` accessor begun by a matching `AddHandler` statement in a custom [Event Statement](../../../visual-basic/language-reference/statements/event-statement.md). - - `Class` - Required to terminate a class definition begun by a matching [Class Statement](../../../visual-basic/language-reference/statements/class-statement.md). - - `Enum` - Required to terminate an enumeration definition begun by a matching [Enum Statement](../../../visual-basic/language-reference/statements/enum-statement.md). - - `Event` - Required to terminate a `Custom` event definition begun by a matching [Event Statement](../../../visual-basic/language-reference/statements/event-statement.md). - - `Function` - Required to terminate a `Function` procedure definition begun by a matching [Function Statement](../../../visual-basic/language-reference/statements/function-statement.md). If execution encounters an `End``Function` statement, control returns to the calling code. - - `Get` - Required to terminate a `Property` procedure definition begun by a matching [Get Statement](../../../visual-basic/language-reference/statements/get-statement.md). If execution encounters an `End``Get` statement, control returns to the statement requesting the property's value. - - `If` - Required to terminate an `If`...`Then`...`Else` block definition begun by a matching `If` statement. See [If...Then...Else Statement](../../../visual-basic/language-reference/statements/if-then-else-statement.md). - - `Interface` - Required to terminate an interface definition begun by a matching [Interface Statement](../../../visual-basic/language-reference/statements/interface-statement.md). - - `Module` - Required to terminate a module definition begun by a matching [Module Statement](../../../visual-basic/language-reference/statements/module-statement.md). - - `Namespace` - Required to terminate a namespace definition begun by a matching [Namespace Statement](../../../visual-basic/language-reference/statements/namespace-statement.md). - - `Operator` - Required to terminate an operator definition begun by a matching [Operator Statement](../../../visual-basic/language-reference/statements/operator-statement.md). - - `Property` - Required to terminate a property definition begun by a matching [Property Statement](../../../visual-basic/language-reference/statements/property-statement.md). - - `RaiseEvent` - Required to terminate a `RaiseEvent` accessor begun by a matching `RaiseEvent` statement in a custom [Event Statement](../../../visual-basic/language-reference/statements/event-statement.md). - - `RemoveHandler` - Required to terminate a `RemoveHandler` accessor begun by a matching `RemoveHandler` statement in a custom [Event Statement](../../../visual-basic/language-reference/statements/event-statement.md). - - `Select` - Required to terminate a `Select`...`Case` block definition begun by a matching `Select` statement. See [Select...Case Statement](../../../visual-basic/language-reference/statements/select-case-statement.md). - - `Set` - Required to terminate a `Property` procedure definition begun by a matching [Set Statement](../../../visual-basic/language-reference/statements/set-statement.md). If execution encounters an `End``Set` statement, control returns to the statement setting the property's value. - - `Structure` - Required to terminate a structure definition begun by a matching [Structure Statement](../../../visual-basic/language-reference/statements/structure-statement.md). - - `Sub` - Required to terminate a `Sub` procedure definition begun by a matching [Sub Statement](../../../visual-basic/language-reference/statements/sub-statement.md). If execution encounters an `End``Sub` statement, control returns to the calling code. - - `SyncLock` - Required to terminate a `SyncLock` block definition begun by a matching `SyncLock` statement. See [SyncLock Statement](../../../visual-basic/language-reference/statements/synclock-statement.md). - - `Try` - Required to terminate a `Try`...`Catch`...`Finally` block definition begun by a matching `Try` statement. See [Try...Catch...Finally Statement](../../../visual-basic/language-reference/statements/try-catch-finally-statement.md). - - `While` - Required to terminate a `While` loop definition begun by a matching `While` statement. See [While...End While Statement](../../../visual-basic/language-reference/statements/while-end-while-statement.md). - - `With` - Required to terminate a `With` block definition begun by a matching `With` statement. See [With...End With Statement](../../../visual-basic/language-reference/statements/with-end-with-statement.md). - -## Remarks - The [End Statement](../../../visual-basic/language-reference/statements/end-statement.md), without an additional keyword, terminates execution immediately. - - When preceded by a number sign (`#`), the `End` keyword terminates a preprocessing block introduced by the corresponding directive. - - `#End` - Required. Terminates the definition of the preprocessing block. - - `#ExternalSource` - Required to terminate an external source block begun by a matching [#ExternalSource Directive](../../../visual-basic/language-reference/directives/externalsource-directive.md). - - `#If` - Required to terminate a conditional compilation block begun by a matching `#If` directive. See [#If...Then...#Else Directives](../../../visual-basic/language-reference/directives/if-then-else-directives.md). - - `#Region` - Required to terminate a source region block begun by a matching [#Region Directive](../../../visual-basic/language-reference/directives/region-directive.md). - +## Parts + +|Part|Description| +|---|---| +|`End`|Required. Terminates the definition of the programming element.| +|`AddHandler`|Required to terminate an `AddHandler` accessor begun by a matching `AddHandler` statement in a custom [Event Statement](event-statement.md).| +|`Class`|Required to terminate a class definition begun by a matching [Class Statement](class-statement.md).| +|`Enum`|Required to terminate an enumeration definition begun by a matching [Enum Statement](enum-statement.md).| +|`Event`|Required to terminate a `Custom` event definition begun by a matching [Event Statement](event-statement.md).| +|`Function`|Required to terminate a `Function` procedure definition begun by a matching [Function Statement](function-statement.md). If execution encounters an `End Function` statement, control returns to the calling code.| +|`Get`|Required to terminate a `Property` procedure definition begun by a matching [Get Statement](get-statement.md). If execution encounters an `End Get` statement, control returns to the statement requesting the property's value.| +|`If`|Required to terminate an `If`...`Then`...`Else` block definition begun by a matching `If` statement. See [If...Then...Else Statement](if-then-else-statement.md).| +|`Interface`|Required to terminate an interface definition begun by a matching [Interface Statement](interface-statement.md).| +|`Module`|Required to terminate a module definition begun by a matching [Module Statement](module-statement.md).| +|`Namespace`|Required to terminate a namespace definition begun by a matching [Namespace Statement](namespace-statement.md).| +|`Operator`|Required to terminate an operator definition begun by a matching [Operator Statement](operator-statement.md).| +|`Property`|Required to terminate a property definition begun by a matching [Property Statement](property-statement.md).| +|`RaiseEvent`|Required to terminate a `RaiseEvent` accessor begun by a matching `RaiseEvent` statement in a custom [Event Statement](event-statement.md).| +|`RemoveHandler`|Required to terminate a `RemoveHandler` accessor begun by a matching `RemoveHandler` statement in a custom [Event Statement](event-statement.md).| +|`Select`|Required to terminate a `Select`...`Case` block definition begun by a matching `Select` statement. See [Select...Case Statement](select-case-statement.md). +|`Set`|Required to terminate a `Property` procedure definition begun by a matching [Set Statement](set-statement.md). If execution encounters an `End Set` statement, control returns to the statement setting the property's value. +|`Structure`|Required to terminate a structure definition begun by a matching [Structure Statement](structure-statement.md). +|`Sub`|Required to terminate a `Sub` procedure definition begun by a matching [Sub Statement](sub-statement.md). If execution encounters an `End Sub` statement, control returns to the calling code. +|`SyncLock`|Required to terminate a `SyncLock` block definition begun by a matching `SyncLock` statement. See [SyncLock Statement](synclock-statement.md). +|`Try`|Required to terminate a `Try`...`Catch`...`Finally` block definition begun by a matching `Try` statement. See [Try...Catch...Finally Statement](try-catch-finally-statement.md). +|`While`|Required to terminate a `While` loop definition begun by a matching `While` statement. See [While...End While Statement](while-end-while-statement.md). +|`With`| Required to terminate a `With` block definition begun by a matching `With` statement. See [With...End With Statement](with-end-with-statement.md). +||| + +## Directives + +When preceded by a number sign (`#`), the `End` keyword terminates a preprocessing block introduced by the corresponding directive. + +```vb +#End ExternalSource +#End If +#End Region +``` + +|Part|Description| +|---|---| +|`#End`|Required. Terminates the definition of the preprocessing block.| +|`#ExternalSource`|Required to terminate an external source block begun by a matching [#ExternalSource Directive](../directives/externalsource-directive.md).| +|`#If`|Required to terminate a conditional compilation block begun by a matching `#If` directive. See [#If...Then...#Else Directives](../directives/if-then-else-directives.md).| +|`#Region`|Required to terminate a source region block begun by a matching [#Region Directive](../directives/region-directive.md).| +||| + +## Remarks + +The [End Statement](end-statement.md), without an additional keyword, terminates execution immediately. + ## Smart Device Developer Notes - The `End` statement, without an additional keyword, is not supported. + +The `End` statement, without an additional keyword, is not supported. -## See Also - [End Statement](../../../visual-basic/language-reference/statements/end-statement.md) +## See also + +[End Statement](end-statement.md)