This commit is contained in:
Rageking8 2024-10-15 22:48:46 +08:00 коммит произвёл GitHub
Родитель f0c7de9b46
Коммит bb3fecfc9f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
34 изменённых файлов: 76 добавлений и 93 удалений

Просмотреть файл

@ -43,7 +43,7 @@ to clarify expected behavior in our community. For more information, see the [.N
- [![Markdownlint](https://github.com/dotnet/docs/actions/workflows/markdownlint.yml/badge.svg)](https://github.com/dotnet/docs/actions/workflows/markdownlint.yml): The current status for the entire repositories Markdown linter status.
- [![MSDocs build verifier](https://github.com/dotnet/docs/actions/workflows/docs-verifier.yml/badge.svg)](https://github.com/dotnet/docs/actions/workflows/docs-verifier.yml): Runs various Markdown verifications, beyond the linter, such as ensuring links and redirects are valid.
- [![No response](https://github.com/dotnet/docs/actions/workflows/no-response.yml/badge.svg)](https://github.com/dotnet/docs/actions/workflows/no-response.yml): If an issue is labeled with `needs-more-info` and the op doesn't respond within 14 days, the issue is closed.
- [![OPS status checker](https://github.com/dotnet/docs/actions/workflows/check-for-build-warnings.yml/badge.svg)](https://github.com/dotnet/docs/actions/workflows/check-for-build-warnings.yml): Builds the site for the PR in context, and verifies the build reporting either, `success,` `warnings`, or `error`.
- [![OPS status checker](https://github.com/dotnet/docs/actions/workflows/check-for-build-warnings.yml/badge.svg)](https://github.com/dotnet/docs/actions/workflows/check-for-build-warnings.yml): Builds the site for the PR in context, and verifies the build reporting either, `success`, `warnings`, or `error`.
- [![Snippets 5000](https://github.com/dotnet/docs/actions/workflows/snippets5000.yml/badge.svg)](https://github.com/dotnet/docs/actions/workflows/snippets5000.yml): Custom .NET build validation, locates code impacted by a PR, and builds.
- [![Target supported version](https://github.com/dotnet/docs/actions/workflows/version-sweep.yml/badge.svg)](https://github.com/dotnet/docs/actions/workflows/version-sweep.yml): Runs monthly, creating issues on projects that target .NET versions that are out of support.
- [![Update dependabot.yml](https://github.com/dotnet/docs/actions/workflows/dependabot-bot.yml/badge.svg)](https://github.com/dotnet/docs/actions/workflows/dependabot-bot.yml): Automatically updates the `dependabot` configuration weekly, but only if required.

Просмотреть файл

@ -30,7 +30,7 @@ When the project is created, it will include a Dockerfile and the worker runtime
## How to combine serverless and Kubernetes with KEDA
In this chapter, you've seen that the Azure Functions' platform automatically scales out to meet demand. When deploying containerized functions to AKS, however, you lose the built-in scaling functionality. To the rescue comes [Kubernetes-based Event Driven (KEDA)](/azure/azure-functions/functions-kubernetes-keda). It enables fine-grained autoscaling for `event-driven Kubernetes workloads,` including containerized functions.
In this chapter, you've seen that the Azure Functions' platform automatically scales out to meet demand. When deploying containerized functions to AKS, however, you lose the built-in scaling functionality. To the rescue comes [Kubernetes-based Event Driven (KEDA)](/azure/azure-functions/functions-kubernetes-keda). It enables fine-grained autoscaling for `event-driven Kubernetes workloads`, including containerized functions.
KEDA provides event-driven scaling functionality to the Functions' runtime in a Docker container. KEDA can scale from zero instances (when no events are occurring) out to `n instances`, based on load. It enables autoscaling by exposing custom metrics to the Kubernetes autoscaler (Horizontal Pod Autoscaler). Using Functions containers with KEDA makes it possible to replicate serverless function capabilities in any Kubernetes cluster.

Просмотреть файл

@ -55,7 +55,7 @@ There are many dependency injection containers available in .NET; the eShop mult
In .NET MAUI, the `MauiProgram` class will call into the `CreateMauiApp` method to create a `MauiAppBuilder` object. The `MauiAppBuilder` object has a `Services` property of type `IServiceCollection`, which provides a place to register our components, such as views, view models, and services for dependency injection. Any components registered with the `Services` property will be provided to the dependency injection container when the `MauiAppBuilder.Build` method is called.
At runtime, the container must know which implementation of the services are being requested in order to instantiate them for the requested objects. In the eShop multi-platform app, the `IAppEnvironmentService`, `IDialogService` , `INavigationService`, and `ISettingsService` interfaces need to be resolved before it can instantiate a `ProfileViewModel` object. This involves the container performing the following actions:
At runtime, the container must know which implementation of the services are being requested in order to instantiate them for the requested objects. In the eShop multi-platform app, the `IAppEnvironmentService`, `IDialogService`, `INavigationService`, and `ISettingsService` interfaces need to be resolved before it can instantiate a `ProfileViewModel` object. This involves the container performing the following actions:
- Deciding how to instantiate an object that implements the interface. This is known as *registration*.
- Instantiating the object that implements the required interface and the `ProfileViewModel` object. This is known as *resolution*.

Просмотреть файл

@ -364,7 +364,7 @@ public async Task<T> GetAsync<T>(string id)
}
```
In the preceding code, the first `Log{LogLevel}` parameter,`AppLogEvents.Read`, is the [Log event ID](#log-event-id). The second parameter is a message template with placeholders for argument values provided by the remaining method parameters. The method parameters are explained in the [message template](#log-message-template) section later in this article.
In the preceding code, the first `Log{LogLevel}` parameter, `AppLogEvents.Read`, is the [Log event ID](#log-event-id). The second parameter is a message template with placeholders for argument values provided by the remaining method parameters. The method parameters are explained in the [message template](#log-message-template) section later in this article.
Configure the appropriate log level and call the correct `Log{LogLevel}` methods to control how much log output is written to a particular storage medium. For example:

Просмотреть файл

@ -180,7 +180,7 @@ The settings under `<PropertyGroup>` in the XML snippet are broken into two grou
The first group deals with properties required for a NuGet package. The four `<Package*>` settings have to do with the NuGet package properties to identify your package on a NuGet feed. The `<PackageId>` value, while used by NuGet, is also used to uninstall the template package. The remaining settings, such as `<Title>` and `<PackageTags>`, have to do with metadata displayed on the NuGet feed and .NET package manager. For more information about NuGet settings, see [NuGet and MSBuild properties](/nuget/reference/msbuild-targets).
> [!NOTE]
> To ensure that the template package appears in `dotnet new search` results,`<PackageType>` must be set to `Template`.
> To ensure that the template package appears in `dotnet new search` results, `<PackageType>` must be set to `Template`.
In the second group, the `<TargetFramework>` setting ensures that MSBuild runs properly when you run the pack command to compile and pack the project. The group also includes settings that have to do with configuring the project to include the templates in the appropriate folder in the NuGet package when it's created:

Просмотреть файл

@ -1,7 +1,7 @@
---
title: "Attributes interpreted by the compiler: Nullable static analysis"
ms.date: 05/20/2022
description: Learn about attributes that are interpreted by the compiler to provide better static analysis for nullable and non-nullable reference types.
ms.date: 05/20/2022
---
# Attributes for null-state static analysis interpreted by the C# compiler
@ -22,7 +22,7 @@ The preceding example follows the familiar `Try*` pattern in .NET. There are two
- Callers shouldn't pass `null` as the argument for `key`.
- Callers can pass a variable whose value is `null` as the argument for `message`.
- If the `TryGetMessage` method returns `true`, the value of `message` isn't null. If the return value is `false,` the value of `message` is null.
- If the `TryGetMessage` method returns `true`, the value of `message` isn't null. If the return value is `false`, the value of `message` is null.
The rule for `key` can be expressed succinctly: `key` should be a non-nullable reference type. The `message` parameter is more complex. It allows a variable that is `null` as the argument, but guarantees, on success, that the `out` argument isn't `null`. For these scenarios, you need a richer vocabulary to describe the expectations. The `NotNullWhen` attribute, described below describes the *null-state* for the argument used for the `message` parameter.

Просмотреть файл

@ -11,7 +11,7 @@ You can use the `ref` modifier in the declaration of a [structure type](struct.m
- A `ref struct` can't be a declared type of a field of a class or a non-`ref struct`.
- A `ref struct` can't be boxed to <xref:System.ValueType?displayProperty=nameWithType> or <xref:System.Object?displayProperty=nameWithType>.
- A `ref struct` variable can't be captured in a [lambda expression](../operators/lambda-expressions.md) or a [local function](../../programming-guide/classes-and-structs/local-functions.md).
- Before C# 13,`ref struct` variables can't be used in an `async` method. Beginning with C# 13, a `ref struct` variable can't be used in the same block as the [`await`](../operators/await.md) expression in an [`async`](../keywords/async.md) method. However, you can use `ref struct` variables in synchronous methods, for example, in methods that return <xref:System.Threading.Tasks.Task> or <xref:System.Threading.Tasks.Task%601>.
- Before C# 13, `ref struct` variables can't be used in an `async` method. Beginning with C# 13, a `ref struct` variable can't be used in the same block as the [`await`](../operators/await.md) expression in an [`async`](../keywords/async.md) method. However, you can use `ref struct` variables in synchronous methods, for example, in methods that return <xref:System.Threading.Tasks.Task> or <xref:System.Threading.Tasks.Task%601>.
- Before C# 13, a `ref struct` variable can't be used in [iterators](../../iterators.md). Beginning with C# 13, `ref struct` types and `ref` locals can be used in iterators, provided they aren't in code segments with the `yield return` statement.
- Before C# 13, a `ref struct` can't implement interfaces. Beginning with C# 13, a `ref` struct can implement interfaces, but must adhere to the [ref safety](~/_csharpstandard/standard/structs.md#1623-ref-modifier) rules. For example, a `ref struct` type can't be converted to the interface type because that requires a boxing conversion.
- Before C# 13, a `ref struct` can't be a type argument. Beginning with C# 13, a `ref struct` can be the type argument when the type parameter specifies the `allows ref struct` in its `where` clause.

Просмотреть файл

@ -2,10 +2,9 @@
title: "Generic Classes"
description: Learn about generic classes used in collections like linked lists, hash tables, stacks, queues, and trees.
ms.date: 07/20/2015
helpviewer_keywords:
helpviewer_keywords:
- "C# language, generic classes"
- "generics [C#], classes"
ms.assetid: 27d6f256-cd61-41e3-bc6e-b990a53b0224
---
# Generic Classes (C# Programming Guide)
@ -33,7 +32,7 @@ Generic classes encapsulate operations that are not specific to a particular dat
For an example of a simple generic class, see [Introduction to Generics](../../fundamentals/types/generics.md).
The rules for type parameters and constraints have several implications for generic class behavior, especially regarding inheritance and member accessibility. Before proceeding, you should understand some terms. For a generic class `Node<T>,` client code can reference the class either by specifying a type argument - to create a closed constructed type (`Node<int>`); or by leaving the type parameter unspecified - for example when you specify a generic base class, to create an open constructed type (`Node<T>`). Generic classes can inherit from concrete, closed constructed, or open constructed base classes:
The rules for type parameters and constraints have several implications for generic class behavior, especially regarding inheritance and member accessibility. Before proceeding, you should understand some terms. For a generic class `Node<T>`, client code can reference the class either by specifying a type argument - to create a closed constructed type (`Node<int>`); or by leaving the type parameter unspecified - for example when you specify a generic base class, to create an open constructed type (`Node<T>`). Generic classes can inherit from concrete, closed constructed, or open constructed base classes:
[!code-csharp[csProgGuideGenerics#16](~/samples/snippets/csharp/VS_Snippets_VBCSharp/csProgGuideGenerics/CS/Generics.cs#16)]

Просмотреть файл

@ -2,10 +2,9 @@
title: "Configuring parameters and parameter data types"
description: Command objects use parameters to pass values to SQL statements or stored procedures, providing type checking and validation in ADO.NET.
ms.date: "03/30/2017"
dev_langs:
dev_langs:
- "csharp"
- "vb"
ms.assetid: 537d8a2c-d40b-4000-83eb-bc1fcc93f707
---
# Configuring parameters and parameter data types
@ -94,7 +93,7 @@ For more information, see [Generating Commands with CommandBuilders](generating-
Stored procedures offer many advantages in data-driven applications. By using stored procedures, database operations can be encapsulated in a single command, optimized for best performance, and enhanced with additional security. Although a stored procedure can be called by passing the stored procedure name followed by parameter arguments as an SQL statement, by using the <xref:System.Data.Common.DbCommand.Parameters%2A> collection of the ADO.NET <xref:System.Data.Common.DbCommand> object enables you to more explicitly define stored procedure parameters, and to access output parameters and return values.
> [!NOTE]
> Parameterized statements are executed on the server by using `sp_executesql,` which allows for query plan reuse. Local cursors or variables in the `sp_executesql` batch are not visible to the batch that calls `sp_executesql`. Changes in database context last only to the end of the `sp_executesql` statement. For more information, see [sp_executesql (Transact-SQL)](/sql/relational-databases/system-stored-procedures/sp-executesql-transact-sql).
> Parameterized statements are executed on the server by using `sp_executesql`, which allows for query plan reuse. Local cursors or variables in the `sp_executesql` batch are not visible to the batch that calls `sp_executesql`. Changes in database context last only to the end of the `sp_executesql` statement. For more information, see [sp_executesql (Transact-SQL)](/sql/relational-databases/system-stored-procedures/sp-executesql-transact-sql).
When using parameters with a <xref:System.Data.SqlClient.SqlCommand> to execute a SQL Server stored procedure, the names of the parameters added to the <xref:System.Data.SqlClient.SqlCommand.Parameters%2A> collection must match the names of the parameter markers in the stored procedure. The .NET Framework Data Provider for SQL Server does not support the question mark (?) placeholder for passing parameters to an SQL statement or a stored procedure. It treats parameters in the stored procedure as named parameters and searches for matching parameter markers. For example, the `CustOrderHist` stored procedure is defined by using a parameter named `@CustomerID`. When your code executes the stored procedure, it must also use a parameter named `@CustomerID`.

Просмотреть файл

@ -94,7 +94,7 @@ Metadata=.\
`DataDirectory` and the ~ operator should be specified only at the beginning of a path, they are not resolved at any other position. The Entity Framework will try to resolve `~/data`, but it will treat `/data/~` as a physical path.
A path that starts with the `DataDirectory` or the ~ operator cannot resolve to a physical path outside the branch of the `DataDirectory` and the ~ operator. For example, the following paths will resolve: `~` , `~/data` , `~/bin/Model/SqlServer`. The following paths will fail to resolve: `~/..`, `~/../other`.
A path that starts with the `DataDirectory` or the ~ operator cannot resolve to a physical path outside the branch of the `DataDirectory` and the ~ operator. For example, the following paths will resolve: `~`, `~/data`, `~/bin/Model/SqlServer`. The following paths will fail to resolve: `~/..`, `~/../other`.
`DataDirectory` and the ~ operator can be extended to include sub-directories, as follows: `|DataDirectory|\Model`, `~/bin/Model`

Просмотреть файл

@ -1,6 +1,6 @@
---
description: "Learn more about the EDM Generator tool (EdmGen.exe), which is a command-line tool used for working with Entity Framework model and mapping files."
title: "EDM Generator (EdmGen.exe)"
description: "Learn more about the EDM Generator tool (EdmGen.exe), which is a command-line tool used for working with Entity Framework model and mapping files."
ms.date: "03/30/2017"
---
@ -32,9 +32,9 @@ When using the EdmGen.exe tool, you must specify one of the following modes.
|----------|-----------------|
|`/mode:ValidateArtifacts`|Validates the .csdl, .ssdl, and .msl files and displays any errors or warnings.<br /><br /> This option requires at least one of the `/inssdl` or `/incsdl` arguments. If `/inmsl` is specified, the `/inssdl` and `/incsdl` arguments are also required.|
|`/mode:FullGeneration`|Uses the database connection information specified in the `/connectionstring` option and generates .csdl, .ssdl, .msl, object layer, and view files.<br /><br /> This option requires a `/connectionstring` argument and either a `/project` argument or `/outssdl`, `/outcsdl`, `/outmsdl`, `/outobjectlayer`, `/outviews`, `/namespace`, and `/entitycontainer` arguments.|
|`/mode:FromSSDLGeneration`|Generates .csdl and .msl files, source code, and views from the specified .ssdl file.<br /><br /> This option requires the `/inssdl` argument and either a `/project` argument or the `/outcsdl`, `/outmsl`, `/outobjectlayer`, `/outviews`, `/namespace,` and `/entitycontainer` arguments.|
|`/mode:FromSSDLGeneration`|Generates .csdl and .msl files, source code, and views from the specified .ssdl file.<br /><br /> This option requires the `/inssdl` argument and either a `/project` argument or the `/outcsdl`, `/outmsl`, `/outobjectlayer`, `/outviews`, `/namespace`, and `/entitycontainer` arguments.|
|`/mode:EntityClassGeneration`|Creates a source code file that contains the classes generated from the .csdl file.<br /><br /> This option requires the `/incsdl` argument and either the `/project` argument or the `/outobjectlayer` argument. The `/language` argument is optional.|
|`/mode:ViewGeneration`|Creates a source code file that contains the views generated from the .csdl, .ssdl, and .msl files.<br /><br /> This option requires the `/inssdl`, `/incsdl`, `/inmsl,` and either the `/project` or `/outviews` arguments. The `/language` argument is optional.|
|`/mode:ViewGeneration`|Creates a source code file that contains the views generated from the .csdl, .ssdl, and .msl files.<br /><br /> This option requires the `/inssdl`, `/incsdl`, `/inmsl`, and either the `/project` or `/outviews` arguments. The `/language` argument is optional.|
## Options

Просмотреть файл

@ -1,8 +1,7 @@
---
description: "Learn more about: CLR Method to Canonical Function Mapping"
title: "CLR Method to Canonical Function Mapping"
description: "Learn more about: CLR Method to Canonical Function Mapping"
ms.date: "03/30/2017"
ms.assetid: e3363261-2cb8-4b54-9555-2870be99b929
---
# CLR Method to Canonical Function Mapping
@ -21,7 +20,7 @@ For LINQ scenarios, queries against the Entity Framework involve mapping certain
|Boolean Equals(String `a`, String `b`)|= operator|
|Boolean IsNullOrEmpty(String `value`)|(IsNull(`value`)) OR Length(`value`) = 0|
|Boolean op_Equality(String `a`, String `b`)|= operator|
|Boolean op_Inequality(String `a` , String `b`)|!= operator|
|Boolean op_Inequality(String `a`, String `b`)|!= operator|
|Microsoft.VisualBasic.Strings.Trim(String `str`)|Trim(`str`)|
|Microsoft.VisualBasic.Strings.LTrim(String `str`)|Ltrim(`str`)|
|Microsoft.VisualBasic.Strings.RTrim(String `str`)|Rtrim(`str`)|
@ -43,7 +42,7 @@ For LINQ scenarios, queries against the Entity Framework involve mapping certain
|Int32 IndexOf(String `value`)|IndexOf(`this`, `value`) - 1||
|System.String Insert(Int32 `startIndex`, String `value`)|Concat(Concat(Substring(`this`, 1, `startIndex`), `value`), Substring(`this`, `startIndex`+1, Length(`this`) - `startIndex`))||
|System.String Remove(Int32 `startIndex`)|Substring(`this`, 1, `startIndex`)||
|System.String Remove(Int32 `startIndex`, Int32 `count`)|Concat(Substring(`this`, 1, `startIndex`) , Substring(`this`, `startIndex` + `count` +1, Length(`this`) - (`startIndex` + `count`)))|Remove(`startIndex`, `count`) is only supported if `count` is an integer greater than or equal to 0.|
|System.String Remove(Int32 `startIndex`, Int32 `count`)|Concat(Substring(`this`, 1, `startIndex`), Substring(`this`, `startIndex` + `count` +1, Length(`this`) - (`startIndex` + `count`)))|Remove(`startIndex`, `count`) is only supported if `count` is an integer greater than or equal to 0.|
|System.String Replace(String `oldValue`, String `newValue`)|Replace(`this`, `oldValue`, `newValue`)||
|System.String Substring(Int32 `startIndex`)|Substring(`this`, `startIndex` +1, Length(`this`) - `startIndex`)||
|System.String Substring(Int32 `startIndex`, Int32 `length`)|Substring(`this`, `startIndex` +1, `length`)||

Просмотреть файл

@ -1,11 +1,10 @@
---
description: "Learn more about: Query Expression Syntax Examples: Ordering (LINQ to DataSet)"
title: "Query Expression Syntax Examples: Ordering (LINQ to DataSet)"
description: "Learn more about: Query Expression Syntax Examples: Ordering (LINQ to DataSet)"
ms.date: "03/30/2017"
dev_langs:
dev_langs:
- "csharp"
- "vb"
ms.assetid: 653a4a97-1e4a-4b2d-8d24-7dbe1f2a5c84
---
# Query Expression Syntax Examples: Ordering (LINQ to DataSet)
@ -60,7 +59,7 @@ The examples in this topic demonstrate how to use the <xref:System.Linq.Enumerab
### Example
This example uses `OrderBy… Descending` , which is equivalent to the <xref:System.Linq.Enumerable.ThenByDescending%2A> method, to sort a list of products, first by name and then by list price, from highest to lowest.
This example uses `OrderBy… Descending`, which is equivalent to the <xref:System.Linq.Enumerable.ThenByDescending%2A> method, to sort a list of products, first by name and then by list price, from highest to lowest.
[!code-csharp[DP LINQ to DataSet Examples#ThenByDescendingSimple](../../../../samples/snippets/csharp/VS_Snippets_ADO.NET/DP LINQ to DataSet Examples/CS/Program.cs#thenbydescendingsimple)]
[!code-vb[DP LINQ to DataSet Examples#ThenByDescendingSimple](../../../../samples/snippets/visualbasic/VS_Snippets_ADO.NET/DP LINQ to DataSet Examples/VB/Module1.vb#thenbydescendingsimple)]

Просмотреть файл

@ -18,7 +18,6 @@ helpviewer_keywords:
- "invalid images"
- "BypassNGenAttribute"
- "System.Runtime.BypassNGenAttribute"
ms.assetid: 44bf97aa-a9a4-4eba-9a0d-cfaa6fc53a66
---
# Ngen.exe (Native Image Generator)
@ -436,7 +435,7 @@ When locating assemblies and their dependencies, Ngen.exe uses the same probing
> [!NOTE]
> This is a change from Ngen.exe behavior in the .NET Framework versions 1.0 and 1.1, where the application base is set to the current directory.
An assembly can have a dependency without a reference, for example if it loads a .dll file by using the <xref:System.Reflection.Assembly.Load%2A?displayProperty=nameWithType> method. You can create a native image for such a .dll file by using configuration information for the application assembly, with the `/ExeConfig` option. The following command generates a native image for `MyLib.dll,` using the configuration information from `MyApp.exe`.
An assembly can have a dependency without a reference, for example if it loads a .dll file by using the <xref:System.Reflection.Assembly.Load%2A?displayProperty=nameWithType> method. You can create a native image for such a .dll file by using configuration information for the application assembly, with the `/ExeConfig` option. The following command generates a native image for `MyLib.dll` using the configuration information from `MyApp.exe`.
```console
ngen install c:\myfiles\MyLib.dll /ExeConfig:c:\myapps\MyApp.exe
@ -534,7 +533,7 @@ The following command uninstalls all scenarios for a specific version of `Client
ngen uninstall "ClientApp, Version=1.0.0.0"
```
The following commands uninstall all scenarios for `"ClientApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3c7ba247adcd2081, processorArchitecture=MSIL",` or just the debug scenario for that assembly:
The following commands uninstall all scenarios for `"ClientApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3c7ba247adcd2081, processorArchitecture=MSIL"`, or just the debug scenario for that assembly:
```console
ngen uninstall "ClientApp, Version=1.0.0.0, Culture=neutral,

Просмотреть файл

@ -2,13 +2,12 @@
title: "Tlbexp.exe (Type Library Exporter)"
description: Review Tlbexp.exe, the Type Library Exporter. This tool generates a type library that describes the types defined in a common language runtime (CLR) assembly.
ms.date: "03/30/2017"
helpviewer_keywords:
helpviewer_keywords:
- "exporting type library [.NET Framework]"
- "exporter tool [.NET Framework]"
- "Tlbexp.exe"
- "Type Library Exporter"
- "type libraries [.NET Framework], exporting"
ms.assetid: a487d61b-d166-467b-a7ca-d8b52fbff42d
---
# Tlbexp.exe (Type Library Exporter)
@ -111,7 +110,7 @@ tlbexp myTest.dll /out:clipper.tlb
tlbimp myLib.tlb /out:myLib.dll
```
The following command uses the C# compiler to compile the `Sample.dll,` which references `myLib.dll` created in the previous example.
The following command uses the C# compiler to compile the `Sample.dll`, which references `myLib.dll` created in the previous example.
```console
CSC Sample.cs /reference:myLib.dll /out:Sample.dll

Просмотреть файл

@ -1,6 +1,6 @@
---
description: "Learn more about: ICorDebugType::EnumerateTypeParameters Method"
title: "ICorDebugType::EnumerateTypeParameters Method"
description: "Learn more about: ICorDebugType::EnumerateTypeParameters Method"
ms.date: "03/30/2017"
api_name:
- "ICorDebugType.EnumerateTypeParameters"
@ -13,7 +13,6 @@ f1_keywords:
helpviewer_keywords:
- "EnumerateTypeParameters method, ICorDebugType interface [.NET Framework debugging]"
- "ICorDebugType::EnumerateTypeParameters method [.NET Framework debugging]"
ms.assetid: 1ee1f6e6-1bd7-4ebb-83b8-ff9a08ca03de
topic_type:
- "apiref"
---
@ -42,7 +41,7 @@ HRESULT EnumerateTypeParameters (
- ELEMENT_TYPE_FNPTR: The number of type parameters contained in the `ICorDebugTypeEnum` will be one greater than the number of arguments accepted by the function. The first type parameter contained in the `ICorDebugTypeEnum` is the return type for the function, and the subsequent type parameters are the function's parameters.
- ELEMENT_TYPE_ARRAY, ELEMENT_TYPE_SZARRAY, ELEMENT_TYPE_BYREF, or ELEMENT_TYPE_PTR: One type parameter will be returned. For example, if the type is an array type such as `int32[]`,`EnumerateTypeParameters` will return an `ICorDebugTypeEnum` that contains an object representing `int32`.
- ELEMENT_TYPE_ARRAY, ELEMENT_TYPE_SZARRAY, ELEMENT_TYPE_BYREF, or ELEMENT_TYPE_PTR: One type parameter will be returned. For example, if the type is an array type such as `int32[]`, `EnumerateTypeParameters` will return an `ICorDebugTypeEnum` that contains an object representing `int32`.
## Requirements

Просмотреть файл

@ -1,19 +1,18 @@
---
description: "Learn more about: CorBindToRuntimeHost Function"
title: "CorBindToRuntimeHost Function"
description: "Learn more about: CorBindToRuntimeHost Function"
ms.date: "03/30/2017"
api_name:
api_name:
- "CorBindToRuntimeHost"
api_location:
api_location:
- "mscoree.dll"
api_type:
api_type:
- "DLLExport"
f1_keywords:
f1_keywords:
- "CorBindToRuntimeHost"
helpviewer_keywords:
helpviewer_keywords:
- "CorBindToRuntimeHost function [.NET Framework hosting]"
ms.assetid: 5c826ba3-8258-49bc-a417-78807915fcaf
topic_type:
topic_type:
- "apiref"
---
# CorBindToRuntimeHost Function
@ -46,7 +45,7 @@ HRESULT CorBindToRuntimeHost (
Some versions of the CLR are installed with a policy statement that specifies compatibility with previous versions of the CLR. By default, the startup shim evaluates `pwszVersion` against policy statements and loads the latest version of the runtime that is compatible with the version being requested. A host can force the shim to skip policy evaluation and load the exact version specified in `pwszVersion` by passing a value of STARTUP_LOADER_SAFEMODE for the `startupFlags` parameter.
If `pwszVersion` is `null,` the method does not load any version of the CLR. Instead, it returns CLR_E_SHIM_RUNTIMELOAD, which indicates that it failed to load the runtime.
If `pwszVersion` is `null`, the method does not load any version of the CLR. Instead, it returns CLR_E_SHIM_RUNTIMELOAD, which indicates that it failed to load the runtime.
`pwszBuildFlavor`
[in] A string that specifies whether to load the server or the workstation build of the CLR. Valid values are `svr` and `wks`. The server build is optimized to take advantage of multiple processors for garbage collections, and the workstation build is optimized for client applications running on a single-processor machine.

Просмотреть файл

@ -1,20 +1,19 @@
---
description: "Learn more about: GetCORVersion Function"
title: "GetCORVersion Function"
description: "Learn more about: GetCORVersion Function"
ms.date: "03/30/2017"
api_name:
api_name:
- "GetCORVersion"
api_location:
api_location:
- "mscoree.dll"
- "mscoreei.dll"
api_type:
api_type:
- "DLLExport"
f1_keywords:
f1_keywords:
- "GetCORVersion"
helpviewer_keywords:
helpviewer_keywords:
- "GetCORVersion function [.NET Framework hosting]"
ms.assetid: 2f09cd37-bf3a-4cc5-87b0-adc42a7eed31
topic_type:
topic_type:
- "apiref"
---
# GetCORVersion Function
@ -42,7 +41,7 @@ HRESULT GetCORVersion (
The number of characters (`WCHAR`s) that can be held in `pbuffer`.
`dwLength`
A pointer to the number of characters actually returned in `pbuffer`. If `pbuffer` is a null pointer, the runtime returns E_POINTER. If the number of characters is greater then the length of `pbuffer` , the runtime returns ERROR_INSUFFICIENT_BUFFER.
A pointer to the number of characters actually returned in `pbuffer`. If `pbuffer` is a null pointer, the runtime returns E_POINTER. If the number of characters is greater then the length of `pbuffer`, the runtime returns ERROR_INSUFFICIENT_BUFFER.
## Requirements

Просмотреть файл

@ -1,10 +1,9 @@
---
description: "Learn more about: Claims and Tokens"
title: "Claims and Tokens"
description: "Learn more about: Claims and Tokens"
ms.date: "03/30/2017"
helpviewer_keywords:
- "claims [WCF], and tokens"
ms.assetid: eff167f3-33f8-483d-a950-aa3e9f97a189
---
# Claims and Tokens
@ -64,7 +63,7 @@ Where the client authenticates with a Security Assertions Markup Language (SAML)
## Identity Claims and ServiceSecurityContext.IsAnonymous
If none of the `ClaimSet` objects resulting from the client credentials contain a claim with a `Right` of `Identity,` then the <xref:System.ServiceModel.ServiceSecurityContext.IsAnonymous%2A> property returns `true`. If one or more such claims are present, the `IsAnonymous` property returns `false`.
If none of the `ClaimSet` objects resulting from the client credentials contain a claim with a `Right` of `Identity`, then the <xref:System.ServiceModel.ServiceSecurityContext.IsAnonymous%2A> property returns `true`. If one or more such claims are present, the `IsAnonymous` property returns `false`.
## See also

Просмотреть файл

@ -1,6 +1,6 @@
---
description: "Learn more about: Data Contract Schema Reference"
title: "Data Contract Schema Reference"
description: "Learn more about: Data Contract Schema Reference"
ms.date: "03/30/2017"
helpviewer_keywords:
- "data contracts [WCF], schema reference"
@ -200,7 +200,7 @@ The rules for the `ref`, `block`, `default`, `fixed`, `form`, and `id` attribute
|`keyref`|Ignored.|
|(blank)|Supported.|
\* When using the `simpleType` and `complexType,` mapping for anonymous types is the same as for non-anonymous types, except that there is no anonymous data contracts, and so a named data contract is created, with a generated name derived from the element name. The rules for anonymous types are in the following list:
\* When using the `simpleType` and `complexType`, mapping for anonymous types is the same as for non-anonymous types, except that there is no anonymous data contracts, and so a named data contract is created, with a generated name derived from the element name. The rules for anonymous types are in the following list:
- WCF implementation detail: If the `xs:element` name does not contain periods, the anonymous type maps to an inner type of the outer data contract type. If the name contains periods, the resulting data contract type is independent (not an inner type).

Просмотреть файл

@ -1,13 +1,12 @@
---
title: "Service Identity and Authentication"
description: Learn about the endpoint identity of a service, a value generated from the service WSDL, which WCF uses to authenticate the service.
description: Learn about the endpoint identity of a service, a value generated from the service WSDL, which WCF uses to authenticate the service.
ms.date: "03/30/2017"
dev_langs:
dev_langs:
- "csharp"
- "vb"
helpviewer_keywords:
helpviewer_keywords:
- "authentication [WCF], specifying the identity of a service"
ms.assetid: a4c8f52c-5b30-45c4-a545-63244aba82be
---
# Service Identity and Authentication
@ -52,7 +51,7 @@ A service's *endpoint identity* is a value generated from the service Web Servic
## Using the \<identity> Element in Configuration
If you change the client credential type in the binding previously shown to `Certificate,` then the generated WSDL contains a Base64 serialized X.509 certificate for the identity value as shown in the following code. This is the default for all client credential types other than Windows.
If you change the client credential type in the binding previously shown to `Certificate`, then the generated WSDL contains a Base64 serialized X.509 certificate for the identity value as shown in the following code. This is the default for all client credential types other than Windows.
You can change the value of the default service identity or change the type of the identity by using the `<identity>` element in configuration or by setting the identity in code. The following configuration code sets a domain name system (DNS) identity with the value `contoso.com`.

Просмотреть файл

@ -2,12 +2,11 @@
title: "Using Message Contracts"
description: Learn how to use the message contract attributes to create a message contract specifying the structure of a SOAP message in WFC.
ms.date: "03/30/2017"
dev_langs:
dev_langs:
- "csharp"
- "vb"
helpviewer_keywords:
helpviewer_keywords:
- "message contracts [WCF]"
ms.assetid: 1e19c64a-ae84-4c2f-9155-91c54a77c249
---
# Using Message Contracts
@ -96,7 +95,7 @@ public class BankingTransaction
</s:Envelope>
```
Notice that `operation` and `transactionDate` appear as SOAP headers and the SOAP body consists of a wrapper element `BankingTransaction` containing `sourceAccount`,`targetAccount`, and `amount`.
Notice that `operation` and `transactionDate` appear as SOAP headers and the SOAP body consists of a wrapper element `BankingTransaction` containing `sourceAccount`, `targetAccount`, and `amount`.
You can apply the <xref:System.ServiceModel.MessageHeaderAttribute> and <xref:System.ServiceModel.MessageBodyMemberAttribute> to all fields, properties, and events, regardless of whether they are public, private, protected, or internal.

Просмотреть файл

@ -1,10 +1,9 @@
---
description: "Learn more about: Securing Clients"
title: "Securing Clients"
description: "Learn more about: Securing Clients"
ms.date: "03/30/2017"
helpviewer_keywords:
helpviewer_keywords:
- "clients [WCF], security considerations"
ms.assetid: 44c8578c-9a5b-4acd-8168-1c30a027c4c5
---
# Securing Clients
@ -134,7 +133,7 @@ In Windows Communication Foundation (WCF), the service dictates the security req
For more information about setting the client credential, see [How to: Specify Client Credential Values](how-to-specify-client-credential-values.md).
> [!NOTE]
> `ClientCredentialType` is ignored when `SecurityMode` is set to `"TransportWithMessageCredential",` as shown in the following sample configuration.
> `ClientCredentialType` is ignored when `SecurityMode` is set to `"TransportWithMessageCredential"`, as shown in the following sample configuration.
```xml
<wsHttpBinding>

Просмотреть файл

@ -1336,7 +1336,7 @@ let y = myList.[ 0 .. 1 ]
### Formatting quoted expressions
The delimiter symbols (`<@` , `@>`, `<@@`, `@@>`) should be placed on separate lines if the quoted expression is a multi-line expression.
The delimiter symbols (`<@`, `@>`, `<@@`, `@@>`) should be placed on separate lines if the quoted expression is a multi-line expression.
```fsharp
// ✔️ OK

Просмотреть файл

@ -78,7 +78,7 @@ Here's a list of exceptions thrown by constructors that don't include pointer pa
| Exception | Condition | Thrown by |
|-----------|-----------|-----------|
|<xref:System.ArgumentNullException>|`value` is `null`.|<xref:System.String.%23ctor(System.Char%5B%5D,System.Int32,System.Int32)>|
|<xref:System.ArgumentOutOfRangeException>|`startIndex`,`length`, or `count` is less than zero.<br /><br /> -or-<br /><br /> The sum of `startIndex` and `length` is greater than the number of elements in `value`.<br /><br /> -or-<br /><br /> `count` is less than zero.|<xref:System.String.%23ctor(System.Char,System.Int32)><br /><br /> <xref:System.String.%23ctor(System.Char%5B%5D,System.Int32,System.Int32)>|
|<xref:System.ArgumentOutOfRangeException>|`startIndex`, `length`, or `count` is less than zero.<br /><br /> -or-<br /><br /> The sum of `startIndex` and `length` is greater than the number of elements in `value`.<br /><br /> -or-<br /><br /> `count` is less than zero.|<xref:System.String.%23ctor(System.Char,System.Int32)><br /><br /> <xref:System.String.%23ctor(System.Char%5B%5D,System.Int32,System.Int32)>|
Here's a list of exceptions thrown by constructors that include pointer parameters.

Просмотреть файл

@ -112,7 +112,7 @@ IEnumerable<float> sizeColumn = data.GetColumn<float>("Size").ToList();
[`IDataView`](xref:Microsoft.ML.IDataView) is lazily evaluated. To iterate over the rows of an [`IDataView`](xref:Microsoft.ML.IDataView) without converting to an [`IEnumerable`](xref:System.Collections.Generic.IEnumerable%601) as demonstrated in previous sections of this document, create a [`DataViewRowCursor`](xref:Microsoft.ML.DataViewRowCursor) by using the [`GetRowCursor`](xref:Microsoft.ML.IDataView.GetRowCursor%2A) method and passing in the [DataViewSchema](xref:Microsoft.ML.DataViewSchema) of your [`IDataView`](xref:Microsoft.ML.IDataView) as a parameter. Then, to iterate over rows, use the [`MoveNext`](xref:Microsoft.ML.DataViewRowCursor.MoveNext%2A) cursor method along with [`ValueGetter`](xref:Microsoft.ML.ValueGetter%601) delegates to extract the respective values from each of the columns.
> [!IMPORTANT]
> For performance purposes, vectors in ML.NET use [`VBuffer`](xref:Microsoft.ML.Data.VBuffer%601) instead of native collection types (that is, `Vector`,`float[]`).
> For performance purposes, vectors in ML.NET use [`VBuffer`](xref:Microsoft.ML.Data.VBuffer%601) instead of native collection types (that is, `Vector`, `float[]`).
```csharp
// Get DataViewSchema of IDataView

Просмотреть файл

@ -62,7 +62,7 @@ Add the following additional `using` directives to the top of the *Program.cs* f
[!code-csharp[AddUsings](./snippets/github-issue-classification/csharp/Program.cs#AddUsings)]
Create three global fields to hold the paths to the recently downloaded files, and global variables for the `MLContext`,`DataView`, and `PredictionEngine`:
Create three global fields to hold the paths to the recently downloaded files, and global variables for the `MLContext`, `DataView`, and `PredictionEngine`:
* `_trainDataPath` has the path to the dataset used to train the model.
* `_testDataPath` has the path to the dataset used to evaluate the model.

Просмотреть файл

@ -276,7 +276,7 @@ When you add a web API to your solution, you're prompted to name the project.
> 1. Multiply the top and bottom coordinates by the original image height, and multiply the left and right coordinates by the original image width.
> 1. Divide the top and bottom coordinates by 600, and divide the left and right coordinates by 800.
>
> For example, given the original image dimensions,`actualImageHeight` and `actualImageWidth`, and a `ModelOutput` called `prediction`, the following code snippet shows how to scale the `BoundingBox` coordinates:
> For example, given the original image dimensions, `actualImageHeight` and `actualImageWidth`, and a `ModelOutput` called `prediction`, the following code snippet shows how to scale the `BoundingBox` coordinates:
>
> ```csharp
> var top = originalImageHeight * prediction.Top / 600;

Просмотреть файл

@ -55,7 +55,7 @@ In the case when we need to store or load a state while managing the navigation
To load/save we call [LoadSubStreams](https://github.com/dotnet/wpf/blob/0354a597996adae43b12efc72bd705f76d4ba497/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/DataStreams.cs#L244)/ [SaveSubStreams](https://github.com/dotnet/wpf/blob/0354a597996adae43b12efc72bd705f76d4ba497/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/DataStreams.cs#L86) of `DataStream` class. If the element used in not part of know type handled by the new implementation, it will use [BinaryFormatter].
When a developer navigates through JournalEntry using `Navigate`,`GoForward`,or `GoBack`, the node's data is loaded or saved to a stream to save the state. If the type involved is not intrinsically handled during serialization/deserialization, [BinaryFormatter] is used.
When a developer navigates through JournalEntry using `Navigate`, `GoForward`, or `GoBack`, the node's data is loaded or saved to a stream to save the state. If the type involved is not intrinsically handled during serialization/deserialization, [BinaryFormatter] is used.
Ref: [DataStream.cs](https://github.com/dotnet/wpf/blob/4e977f5fe8c73094ee5826dbfa7a0f37c3bf0e33/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/DataStreams.cs)

Просмотреть файл

@ -800,9 +800,9 @@ The <xref:System.Text.Json?displayProperty=fullName> DOM can't add, remove, or m
### JsonElement is a union struct
`JsonDocument` exposes the `RootElement` as a property of type <xref:System.Text.Json.JsonElement>, which is a union struct type that encompasses any JSON element. `Newtonsoft.Json` uses dedicated hierarchical types like `JObject`,`JArray`, `JToken`, and so forth. `JsonElement` is what you can search and enumerate over, and you can use `JsonElement` to materialize JSON elements into .NET types.
`JsonDocument` exposes the `RootElement` as a property of type <xref:System.Text.Json.JsonElement>, which is a union struct type that encompasses any JSON element. `Newtonsoft.Json` uses dedicated hierarchical types like `JObject`, `JArray`, `JToken`, and so forth. `JsonElement` is what you can search and enumerate over, and you can use `JsonElement` to materialize JSON elements into .NET types.
Starting in .NET 6, you can use <xref:System.Text.Json.Nodes.JsonNode> type and types in the <xref:System.Text.Json.Nodes> namespace that correspond to `JObject`,`JArray`, and `JToken`. For more information, see [Use `JsonNode`](use-dom.md#use-jsonnode).
Starting in .NET 6, you can use <xref:System.Text.Json.Nodes.JsonNode> type and types in the <xref:System.Text.Json.Nodes> namespace that correspond to `JObject`, `JArray`, and `JToken`. For more information, see [Use `JsonNode`](use-dom.md#use-jsonnode).
### How to search a JsonDocument and JsonElement for sub-elements

Просмотреть файл

@ -1,14 +1,13 @@
---
description: "Learn more about: Set not permitted"
title: "Set not permitted"
description: "Learn more about: Set not permitted"
ms.date: 07/20/2015
f1_keywords:
f1_keywords:
- "vbrID387"
ms.assetid: 809f6768-7dd7-4632-b4dd-83856edfdb48
---
# Set not permitted
You attempted to change a property whose settings either cannot be set at run time or else can only be set under certain conditions. For example, you may have tried to change the `Appearance`, `ControlBox`,`MinButton`, or `MaxButton` property settings for the form at run time, or you may have tried to set the `Visible` property to `False` for the last remaining visible submenu on a parent menu.
You attempted to change a property whose settings either cannot be set at run time or else can only be set under certain conditions. For example, you may have tried to change the `Appearance`, `ControlBox`, `MinButton`, or `MaxButton` property settings for the form at run time, or you may have tried to set the `Visible` property to `False` for the last remaining visible submenu on a parent menu.
## To correct this error

Просмотреть файл

@ -1,8 +1,7 @@
---
description: "Learn more about: Walkthrough: Accessing the Web by Using Async and Await (Visual Basic)"
title: "Walkthrough: Accessing the Web by Using Async and Await"
description: "Learn more about: Walkthrough: Accessing the Web by Using Async and Await (Visual Basic)"
ms.date: 07/20/2015
ms.assetid: 84fd047f-fab8-4d89-8ced-104fb7310a91
---
# Walkthrough: Accessing the Web by Using Async and Await (Visual Basic)
@ -419,7 +418,7 @@ Visual Studio 2012 or later must be installed on your computer. For more informa
New HttpClient() With {.MaxResponseContentBufferSize = 1000000}
```
2. In `SumPageSizesAsync,` replace the call to your `GetURLContentsAsync` method with a call to the `HttpClient` method.
2. In `SumPageSizesAsync`, replace the call to your `GetURLContentsAsync` method with a call to the `HttpClient` method.
```vb
Dim urlContents As Byte() = Await client.GetByteArrayAsync(url)

Просмотреть файл

@ -1,6 +1,6 @@
---
description: "Learn more about: Inheritance Basics (Visual Basic)"
title: "Inheritance Basics"
description: "Learn more about: Inheritance Basics (Visual Basic)"
ms.date: 07/20/2015
helpviewer_keywords:
- "derived classes [Visual Basic], inheritance"
@ -20,7 +20,6 @@ helpviewer_keywords:
- "base classes [Visual Basic], inheritance"
- "abstract classes [Visual Basic], inheritance"
- "overriding, Overrides keyword"
ms.assetid: dfc8deba-f5b3-4d1d-a937-7cb826446fc5
---
# Inheritance Basics (Visual Basic)
@ -58,7 +57,7 @@ Suppose you want to define classes to handle payroll. You could define a generic
The `BonusPayroll` class can inherit, and override, the `PayEmployee` method defined in the base `Payroll` class.
The following example defines a base class, `Payroll,` and a derived class, `BonusPayroll`, which overrides an inherited method, `PayEmployee`. A procedure, `RunPayroll`, creates and then passes a `Payroll` object and a `BonusPayroll` object to a function, `Pay`, that executes the `PayEmployee` method of both objects.
The following example defines a base class, `Payroll`, and a derived class, `BonusPayroll`, which overrides an inherited method, `PayEmployee`. A procedure, `RunPayroll`, creates and then passes a `Payroll` object and a `BonusPayroll` object to a function, `Pay`, that executes the `PayEmployee` method of both objects.
[!code-vb[VbVbalrOOP#28](~/samples/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrOOP/VB/OOP.vb#28)]

Просмотреть файл

@ -1,8 +1,8 @@
---
description: "Learn more about: Procedure Parameters and Arguments (Visual Basic)"
title: "Procedure Parameters and Arguments"
description: "Learn more about: Procedure Parameters and Arguments (Visual Basic)"
ms.date: 07/20/2015
helpviewer_keywords:
helpviewer_keywords:
- "procedures [Visual Basic], arguments"
- "procedures [Visual Basic], argument lists"
- "values [Visual Basic], passing to procedures"
@ -18,7 +18,6 @@ helpviewer_keywords:
- "Visual Basic code, parameter lists"
- "argument lists [Visual Basic]"
- "procedures [Visual Basic], parameter lists"
ms.assetid: ff275aff-aa13-40df-bd4c-63486db8c1e9
---
# Procedure Parameters and Arguments (Visual Basic)
@ -42,7 +41,7 @@ In most cases, a procedure needs some information about the circumstances in whi
[!code-vb[VbVbcnProcedures#32](~/samples/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnProcedures/VB/Class1.vb#32)]
If the type checking switch ([Option Strict Statement](../../../language-reference/statements/option-strict-statement.md)) is `Off,` the `As` clause is optional, except that if any one parameter uses it, all parameters must use it. If type checking is `On`, the `As` clause is required for all procedure parameters.
If the type checking switch ([Option Strict Statement](../../../language-reference/statements/option-strict-statement.md)) is `Off`, the `As` clause is optional, except that if any one parameter uses it, all parameters must use it. If type checking is `On`, the `As` clause is required for all procedure parameters.
If the calling code expects to supply an argument with a data type different from that of its corresponding parameter, such as `Byte` to a `String` parameter, it must do one of the following: