Skip to content
Merged
4 changes: 4 additions & 0 deletions .openpublishing.redirection.json
Original file line number Diff line number Diff line change
Expand Up @@ -1305,6 +1305,10 @@
{
"source_path":"docs/csharp/programming-guide/classes-and-structs/how-to-access-a-collection-class-with-foreach.md",
"redirect_url":"/dotnet/csharp/language-reference/keywords/foreach-in"
},
{
"source_path":"docs/framework/windows-workflow-foundation/samples/using-the-invokemethod-activity.md",
"redirect_url":"/dotnet/framework/windows-workflow-foundation/samples/built-in-activities"
}
]
}
21 changes: 13 additions & 8 deletions docs/core/additional-tools/dotnet-svcutil-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ title: Microsoft WCF dotnet-svcutil tool
description: An overview of the Microsoft WCF dotnet-svcutil tool that adds functionality for .NET Core and ASP.NET Core projects, similar to the WCF svcutil tool for .NET Framework projects.
author: mlacouture
ms.author: jralexander
ms.date: 05/31/2018
ms.date: 06/04/2018
---
# Microsoft WCF dotnet-svcutil tool

The Windows Communication Foundation (WCF) **dotnet-svcutil** tool is a .NET Core CLI tool that retrieves metadata from a web service on a network location or from a WSDL file, and generates a WCF class containing client proxy methods that access the web service operations.

Similar to the [**Service Model Metadata - svcutil**](../../framework/wcf/servicemodel-metadata-utility-tool-svcutil-exe) tool for .NET Framework projects, the **dotnet-svcutil** is a command-line tool for generating a web service reference compatible with .NET Core and .NET Standard projects.
Similar to the [**Service Model Metadata - svcutil**](../../framework/wcf/servicemodel-metadata-utility-tool-svcutil-exe.md) tool for .NET Framework projects, the **dotnet-svcutil** is a command-line tool for generating a web service reference compatible with .NET Core and .NET Standard projects.

The **dotnet-svcutil** tool is an alternative option to the [**WCF Web Service Reference**](wcf-web-service-reference-guide) Visual Studio connected service provider that first shipped with Visual Studio 2017 v15.5. The **dotnet-svcutil** tool as a .NET Core CLI tool, is available cross-platform on Linux, macOS, and Windows.
The **dotnet-svcutil** tool is an alternative option to the [**WCF Web Service Reference**](wcf-web-service-reference-guide.md) Visual Studio connected service provider that first shipped with Visual Studio 2017 v15.5. The **dotnet-svcutil** tool as a .NET Core CLI tool, is available cross-platform on Linux, macOS, and Windows.

> [!IMPORTANT]
> You should only reference services from a trusted source. Adding references from an untrusted source may compromise security.
> You should only reference services from a trusted source. Adding references from an untrusted source may compromise security.

## Prerequisites

Expand All @@ -24,6 +24,7 @@ The **dotnet-svcutil** tool is an alternative option to the [**WCF Web Service R
## Getting started

The following example walks you through the steps required to add a web service reference to a .NET Core console project and invoke the service. You will create a .NET Core console application named _HelloSvcutil_ and will add a reference to a web service that implements the following contract:

```csharp
[ServiceContract]
public interface ISayHello
Expand All @@ -32,9 +33,10 @@ public interface ISayHello
string Hello(string name);
}
```
For this example, the web service will be assumed to be hosted at the following address: _http://myhost/SayHello.svc_

From a `Windows`, `macOS`, or `Linux` command window perform the following steps:
For this example, the web service will be assumed to be hosted at the following address: `http://contoso.com/SayHello.svc`

From a Windows, macOS, or Linux command window perform the following steps:

1. Create a directory named _HelloSvcutil_ for your project and make it your current directory, as in the following example:

Expand Down Expand Up @@ -66,7 +68,7 @@ dotnet restore
5. Run _dotnet_ with the _svcutil_ command to generate the web service reference file as follows:

```console
dotnet svcutil http://myhost/SayHello.svc
dotnet svcutil http://contoso.com/SayHello.svc
```
The generated file is saved as _HelloSvcutil/ServiceReference1/Reference.cs_. The _dotnet_svcutil_ tool also adds to the project the appropriate WCF packages required by the proxy code as package references.

Expand Down Expand Up @@ -103,10 +105,13 @@ dotnet svcutil --help
## Next steps

### Feedback & questions

If you have any questions or feedback, [open an issue on GitHub](https://github.com/dotnet/wcf/issues/new). You can also review any existing questions or issues [at the WCF repo on GitHub](https://github.com/dotnet/wcf/issues?utf8=%E2%9C%93&q=is:issue%20label:tooling).

### Release notes
* Refer to the [Release notes](https://github.com/dotnet/wcf/blob/master/release-notes/dotnet-svcutil-notes.md) for updated release information, including known issues.

* Refer to the [Release notes](https://github.com/dotnet/wcf/blob/master/release-notes/dotnet-svcutil-notes.md) for updated release information, including known issues.

### Information

* [dotnet-svcutil NuGet Package](https://nuget.org/packages/dotnet-svcutil)
18 changes: 8 additions & 10 deletions docs/core/tools/dotnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ title: dotnet command - .NET Core CLI
description: Learn about the dotnet command (the generic driver for the .NET Core CLI tools) and its usage.
author: mairaw
ms.author: mairaw


ms.date: 05/30/2018
ms.date: 06/04/2018
---
# dotnet command

Expand Down Expand Up @@ -257,13 +255,13 @@ Command | Function

Starting with .NET Core SDK 2.1.300, a number of tools that were available only on a per project basis using `DotnetCliToolReference` are now available as part of the .NET Core SDK. These tools include:

| Tool | Function |
| --------------------------------------- | ------------------------------------------------------------ |
| dev-certs | Creates and manages development certificates. |
| [ef](/ef/core/miscellaneous/cli/dotnet) | Entity Framework Core command-line tools. |
| sql-cache | SQL Server cache command-line tools. |
| user-secrets | Manages development user secrets. |
| watch | Starts a file watcher that runs a command when files change. |
| Tool | Function |
| ------------------------------------------------- | ------------------------------------------------------------ |
| dev-certs | Creates and manages development certificates. |
| [ef](/ef/core/miscellaneous/cli/dotnet) | Entity Framework Core command-line tools. |
| sql-cache | SQL Server cache command-line tools. |
| [user-secrets](/aspnet/core/security/app-secrets) | Manages development user secrets. |
| [watch](/aspnet/core/tutorials/dotnet-watch) | Starts a file watcher that runs a command when files change. |

For more information about each tool, execute `dotnet <tool-name> --help`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ The <xref:System.Data.DataTable> object is often used for data binding. The <xre

[!code-csharp[DP Custom CopyToDataTable Examples#ObjectShredderClass](../../../../samples/snippets/csharp/VS_Snippets_ADO.NET/DP Custom CopyToDataTable Examples/CS/Program.cs#objectshredderclass)]
[!code-vb[DP Custom CopyToDataTable Examples#ObjectShredderClass](../../../../samples/snippets/visualbasic/VS_Snippets_ADO.NET/DP Custom CopyToDataTable Examples/VB/Module1.vb#objectshredderclass)]


The preceding example assumes that the properties of the `DataColumn` are not nullable types. To handle properties with nullable types, use the following code:

```csharp
DataColumn dc = table.Columns.Contains(p.Name) ? table.Columns[p.Name] : table.Columns.Add(p.Name, Nullable.GetUnderlyingType(p.PropertyType) ?? p.PropertyType);
```

2. Implement the custom `CopyToDataTable<T>` extension methods in a class:

[!code-csharp[DP Custom CopyToDataTable Examples#CustomCopyToDataTableMethods](../../../../samples/snippets/csharp/VS_Snippets_ADO.NET/DP Custom CopyToDataTable Examples/CS/Program.cs#customcopytodatatablemethods)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ SQL Injection is the process by which a malicious user enters Transact-SQL state

|Resource|Description|
|--------------|-----------------|
|[Stored Procedures](http://go.microsoft.com/fwlink/?LinkId=98233) and [SQL Injection](http://go.microsoft.com/fwlink/?LinkId=98234) in SQL Server Books Online|Topics describe how to create stored procedures and how SQL Injection works.|
|[New SQL Truncation Attacks And How To Avoid Them](http://msdn.microsoft.com/msdnmag/issues/06/11/SQLSecurity/) in MSDN Magazine.|Describes how to delimit characters and strings, SQL injection, and modification by truncation attacks.|
|[Stored Procedures](/sql/relational-databases/stored-procedures/stored-procedures-database-engine) and [SQL Injection](/sql/relational-databases/security/sql-injection) in SQL Server Books Online|Topics describe how to create stored procedures and how SQL Injection works.|

## See Also
[Securing ADO.NET Applications](../../../../../docs/framework/data/adonet/securing-ado-net-applications.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ The following sections list the best practices to consider when creating secure
- the use of stronger cryptographic algorithms, and

- the greater difficulty of utilizing forwarded X509 credentials.

For an overview of NTLM forwarding attacks, go to [http://msdn.microsoft.com/msdnmag/issues/06/09/SecureByDesign/default.aspx](http://go.microsoft.com/fwlink/?LinkId=109571).


## Always Revert After Impersonation
When using APIs that enable impersonation of a client, be sure to revert to the original identity. For example, when using the <xref:System.Security.Principal.WindowsIdentity> and <xref:System.Security.Principal.WindowsImpersonationContext>, use the C# `using` statement or the Visual Basic`Using` statement, as shown in the following code. The <xref:System.Security.Principal.WindowsImpersonationContext> class implements the <xref:System.IDisposable> interface, and therefore the common language runtime (CLR) automatically reverts to the original identity once the code leaves the `using` block.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ This is the third of six tasks required to create a Windows Communication Founda

2. Step 2 – Creates an instance of the <xref:System.ServiceModel.ServiceHost> class to host the service. The constructor takes two parameters, the type of the class that implements the service contract, and the base address of the service.

3. Step 3 – Creates a <!--zz <xref:System.ServiceModel.ServiceEndpoint>--> ` System.ServiceModel.ServiceEndpoint` instance. A service endpoint is composed of an address, a binding, and a service contract. The <!--zz <xref:System.ServiceModel.ServiceEndpoint>--> ` System.ServiceModel.ServiceEndpoint` constructor therefore takes the service contract interface type, a binding, and an address. The service contract is `ICalculator`, which you defined and implement in the service type. The binding used in this sample is <xref:System.ServiceModel.WSHttpBinding> which is a built-in binding that is used for connecting to endpoints that conform to the WS-* specifications. For more information about WCF bindings, see [WCF Bindings Overview](../../../docs/framework/wcf/bindings-overview.md). The address is appended to the base address to identify the endpoint. The address specified in this code is "CalculatorService" so the fully qualified address for the endpoint is `"http://localhost:8000/GettingStarted/CalculatorService"` Adding a service endpoint is optional when using .NET Framework 4.0 or later. In these versions, if no endpoints are added in code or configuration, WCF adds one default endpoint for each combination of base address and contract implemented by the service. For more information about default endpoints see [Specifying an Endpoint Address](../../../docs/framework/wcf/specifying-an-endpoint-address.md). For more information about default endpoints, bindings, and behaviors, see [Simplified Configuration](../../../docs/framework/wcf/simplified-configuration.md) and [Simplified Configuration for WCF Services](../../../docs/framework/wcf/samples/simplified-configuration-for-wcf-services.md).
3. Step 3 – Creates a <xref:System.ServiceModel.Description.ServiceEndpoint> instance. A service endpoint is composed of an address, a binding, and a service contract. The <xref:System.ServiceModel.Description.ServiceEndpoint> constructor therefore takes the service contract interface type, a binding, and an address. The service contract is `ICalculator`, which you defined and implement in the service type. The binding used in this sample is <xref:System.ServiceModel.WSHttpBinding> which is a built-in binding that is used for connecting to endpoints that conform to the WS-* specifications. For more information about WCF bindings, see [WCF Bindings Overview](../../../docs/framework/wcf/bindings-overview.md). The address is appended to the base address to identify the endpoint. The address specified in this code is "CalculatorService" so the fully qualified address for the endpoint is `"http://localhost:8000/GettingStarted/CalculatorService"` Adding a service endpoint is optional when using .NET Framework 4.0 or later. In these versions, if no endpoints are added in code or configuration, WCF adds one default endpoint for each combination of base address and contract implemented by the service. For more information about default endpoints see [Specifying an Endpoint Address](../../../docs/framework/wcf/specifying-an-endpoint-address.md). For more information about default endpoints, bindings, and behaviors, see [Simplified Configuration](../../../docs/framework/wcf/simplified-configuration.md) and [Simplified Configuration for WCF Services](../../../docs/framework/wcf/samples/simplified-configuration-for-wcf-services.md).

> [!IMPORTANT]
> Adding a service endpoint is optional when using .NET Framework 4 or later. In these versions, if no endpoints are added in code or configuration, WCF adds one default endpoint for each combination of base address and contract implemented by the service. For more information about default endpoints see [Specifying an Endpoint Address](../../../docs/framework/wcf/specifying-an-endpoint-address.md). For more information about default endpoints, bindings, and behaviors, see [Simplified Configuration](../../../docs/framework/wcf/simplified-configuration.md) and [Simplified Configuration for WCF Services](../../../docs/framework/wcf/samples/simplified-configuration-for-wcf-services.md).
Expand Down

This file was deleted.

Loading