Skip to content

add missing metadata and other fixes #9262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/core/additional-tools/dotnet-svcutil-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
title: WCF svcutil tool overview - .NET Core
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: 08/20/2018
ms.custom: "seodec18"
---
Expand Down
79 changes: 50 additions & 29 deletions docs/core/additional-tools/dotnet-svcutil.xmlserializer-guide.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
---
title: Using dotnet-svcutil.xmlserializer on .NET Core
description: Learn how you can use the `dotnet-svcutil.xmlserializer` NuGet package to pre-generate a serialization assembly for .NET Core projects.
author: huanwu
ms.date: 11/27/2018
---
# Using dotnet-svcutil.xmlserializer on .NET Core

## Prerequisites
The `dotnet-svcutil.xmlserializer` NuGet package can pre-generate a serialization assembly for .NET Core projects. It pre-generates C# serialization code for the types in the client application that are used by the WCF Service Contract and that can be serialized by the XmlSerializer. This improves the startup performance of XML serialization when serializing or deserializing objects of those types.

The following is required for dotnet-svcutil.xmlserializer to work.
## Prerequisites

* [.NET Core 2.1 SDK or later](https://www.microsoft.com/net/download/dotnet-core/sdk-2.1.300)
* [.NET Core Runtime 2.1 or later](https://www.microsoft.com/net/download/dotnet-core/runtime-2.1.0)
* [.NET Core 2.1 SDK](https://www.microsoft.com/net/download) or later
* Your favorite code editor

You can use the command `dotnet --info` to check which versions of .NET Core SDK and runtime you already have installed.

To use dotnet-svcutil.xmlserializer in a .NET Core console application:
## Getting started

To use `dotnet-svcutil.xmlserializer` in a .NET Core console application:

1. Create a WCF Service named 'MyWCFService' using the default template 'WCF Service Application' in .NET Framework. Add ```[XmlSerializerFormat]``` attribute on the service method like the following
```c#
1. Create a WCF Service named 'MyWCFService' using the default template 'WCF Service Application' in .NET Framework. Add `[XmlSerializerFormat]` attribute on the service method like the following:

```csharp
[ServiceContract]
public interface IService1
{
Expand All @@ -21,34 +30,42 @@ To use dotnet-svcutil.xmlserializer in a .NET Core console application:
string GetData(int value);
}
```
2. Create a .NET Core console application as WCF client application that targets at netcoreapp 2.1, e.g. create an app named 'MyWCFClient' with the command,
```

2. Create a .NET Core console application as WCF client application that targets at .NET Core 2.1 or later versions. For example, create an app named 'MyWCFClient' with the following command:

```console
dotnet new console --name MyWCFClient
```
Make sure your csproj targets a netcoreapp 2.1. This is done using the following XML element in your .csproj file

To ensure your project is targeting .NET Core 2.1 or later, inspect the `TargetFramework` XML element in your project file:

```xml
<TargetFramework>netcoreapp2.1</TargetFramework>
```
3. Add a package reference to System.ServiceModel.Http by running the following command:

```dotnet add package System.ServiceModel.Http -v 4.5.0```

3. Add a package reference to `System.ServiceModel.Http` by running the following command:

```console
dotnet add package System.ServiceModel.Http
```

4. Add the WCF Client code:

```csharp
using System.ServiceModel;

class Program
{
static void Main(string[] args)

class Program
{
var myBinding = new BasicHttpBinding();
var myEndpoint = new EndpointAddress("http://localhost:2561/Service1.svc"); //Fill your service url here
var myChannelFactory = new ChannelFactory<IService1>(myBinding, myEndpoint);
IService1 client = myChannelFactory.CreateChannel();
string s = client.GetData(1);
((ICommunicationObject)client).Close();
static void Main(string[] args)
{
var myBinding = new BasicHttpBinding();
var myEndpoint = new EndpointAddress("http://localhost:2561/Service1.svc"); //Fill your service url here
var myChannelFactory = new ChannelFactory<IService1>(myBinding, myEndpoint);
IService1 client = myChannelFactory.CreateChannel();
string s = client.GetData(1);
((ICommunicationObject)client).Close();
}
}
}

[ServiceContract]
public interface IService1
Expand All @@ -58,17 +75,21 @@ To use dotnet-svcutil.xmlserializer in a .NET Core console application:
string GetData(int value);
}
```
5. Edit the .csproj file and add a reference to the dotnet-svcutil.xmlserializer package. For example:

i. Run command: `dotnet add package dotnet-svcutil.xmlserializer -v 1.0.0`
5. Add a reference to the `dotnet-svcutil.xmlserializer` package by running the following command:

```console
dotnet add package dotnet-svcutil.xmlserializer
```

ii. Add the following lines in MyWCFClient.csproj,
Running the command should add an entry to your project file similar to this:

```xml
<ItemGroup>
<DotNetCliToolReference Include="dotnet-svcutil.xmlserializer" Version="1.0.0" />
</ItemGroup>
```

6. Build the application by running `dotnet build`. If everything succeeds, an assembly named MyWCFClient.XmlSerializers.dll will be generated in the output folder. You will see warnings in the build output if the tool failed to generate the assembly.
6. Build the application by running `dotnet build`. If everything succeeds, an assembly named *MyWCFClient.XmlSerializers.dll* is generated in the output folder. If the tool failed to generate the assembly, you'll see warnings in the build output.

7. Start the WCF service e.g. by running http://localhost:2561/Service1.svc in the browser. Then start the client application, and it will automatically load and use the pre-generated serializers at runtime.
7. Start the WCF service by, for example, running `http://localhost:2561/Service1.svc` in the browser. Then start the client application, and it will automatically load and use the pre-generated serializers at runtime.
9 changes: 4 additions & 5 deletions docs/core/additional-tools/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
title: .NET Core additional CLI tools - .NET Core
description: An overview of the additional tools you can install that support and extend .NET Core functionality.
author: mlacouture
ms.author: johalex
ms.date: 01/19/2018
ms.custom: "seodec18"
ms.date: 11/27/2018
ms.custom: "mvc, seodec18"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BillWagner is this how we're supposed to do multiple values?

---
# .NET Core additional tools overview

Expand All @@ -16,12 +15,12 @@ The WCF (Windows Communication Foundation) Web Service Reference is a Visual Stu

## [WCF dotnet-svcutil tool](dotnet-svcutil-guide.md)

The WCF (Windows Communication Foundation) 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 source file compatible with .NET Core, defining a WCF proxy class with methods that you can use to access the web service operations.
The WCF (Windows Communication Foundation) 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 source file compatible with .NET Core, defining a WCF proxy class with methods that you can use to access the web service operations.
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 which 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.

## [WCF dotnet-svcutil.xmlserializer tool](dotnet-svcutil.xmlserializer-guide.md)

On the .NET Framework, you can pre-generate a serialization assembly using the svcutil tool. The dotnet-svcutil.xmlserializer NuGet package provides similar functionality on .NET Core. It per-generates C# serialization code for the types in the client application that are used by the WCF Service Contract and that can be serialized by the <xref:System.Xml.Serialization.XmlSerializer>. This improves the startup performance of XML serialization when serializing or deserializing objects of those types.
On the .NET Framework, you can pre-generate a serialization assembly using the svcutil tool. The dotnet-svcutil.xmlserializer NuGet package provides similar functionality on .NET Core. It pre-generates C# serialization code for the types in the client application that are used by the WCF Service Contract and that can be serialized by the <xref:System.Xml.Serialization.XmlSerializer>. This improves the startup performance of XML serialization when serializing or deserializing objects of those types.

## [XML Serializer Generator](xml-serializer-generator.md)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
title: Add WCF Web Service Reference - .NET Core
description: An overview of the Microsoft WCF Web Service Reference Provider Tool that adds functionality for .NET Core and ASP.NET Core projects, similar to Add Service Reference for .NET Framework projects.
author: mlacouture
ms.author: johalex
ms.date: 04/19/2018
ms.custom: "mvc, seodec18"
---
Expand Down
42 changes: 20 additions & 22 deletions docs/core/additional-tools/xml-serializer-generator.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
title: "Microsoft XML Serializer Generator - .NET Core"
description: An overview of the Microsoft XML Serializer Generator. Use the XML Serializer Generator to generate an XML serialization assembly for the types contained in your project.
author: mlacouture
ms.author: johalex
ms.date: 01/19/2017
ms.topic: tutorial
ms.custom: "mvc, seodec18"
Expand All @@ -16,16 +15,16 @@ This tutorial teaches you how to use the Microsoft XML Serializer Generator in a
> * How to add a reference to the Microsoft.XmlSerializer.Generator package
> * How to edit your MyApp.csproj to add dependencies
> * How to add a class and an XmlSerializer
> * How to build and run the application
> * How to build and run the application

Like the [Xml Serializer Generator (sgen.exe)](../../standard/serialization/xml-serializer-generator-tool-sgen-exe.md) for the .NET Framework, the [Microsoft.XmlSerializer.Generator NuGet package](https://www.nuget.org/packages/Microsoft.XmlSerializer.Generator) is the equivalent for .NET Core and .NET Standard projects. It creates an XML serialization assembly for types contained in an assembly to improve the startup performance of XML serialization when serializing or de-serializing objects of those types using <xref:System.Xml.Serialization.XmlSerializer>.

## Prerequisites

To complete this tutorial:

* Install [.NET Core 2.1 SDK or later](https://www.microsoft.com/net/download).
* Install your favorite code editor, if you haven't already.
* [.NET Core 2.1 SDK](https://www.microsoft.com/net/download) or later
* Your favorite code editor.

> [!TIP]
> Need to install a code editor? Try [Visual Studio](https://aka.ms/vsdownload?utm_source=mscom&utm_campaign=msdocs)!
Expand All @@ -47,11 +46,11 @@ dotnet new console
Use the [`dotnet add package`](../tools//dotnet-add-package.md) command to add the reference in your project.

Type:
```console
dotnet add package Microsoft.XmlSerializer.Generator -v 1.0.0
```

```console
dotnet add package Microsoft.XmlSerializer.Generator -v 1.0.0
```

### Verify changes to MyApp.csproj after adding the package

Open your code editor and let's get started! We're still working from the *MyApp* directory we built the app in.
Expand All @@ -65,17 +64,17 @@ After running the [`dotnet add package`](../tools//dotnet-add-package.md) comman
<PackageReference Include="Microsoft.XmlSerializer.Generator" Version="1.0.0" />
</ItemGroup>
```

### Add another ItemGroup section for .NET Core CLI Tool support
Add the following lines after the `ItemGroup` section that we inspected:

Add the following lines after the `ItemGroup` section that we inspected:

```xml
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.XmlSerializer.Generator" Version="1.0.0" />
</ItemGroup>
```

### Add a class in the application

Open *Program.cs* in your text editor. Add the class named *MyClass* in *Program.cs*.
Expand All @@ -101,9 +100,10 @@ Still within the *MyApp* folder, run the application via [`dotnet run`](../tools

Type the following command in your console window:

```console
$ dotnet run
```
```console
$ dotnet run
```

> [!NOTE]
> [`dotnet run`](../tools/dotnet-run.md) calls [`dotnet build`](../tools/dotnet-build.md) to ensure that the build targets have been built, and then calls `dotnet <assembly.dll>` to run the target application.

Expand All @@ -112,18 +112,16 @@ Type the following command in your console window:

If everything succeeds, an assembly named *MyApp.XmlSerializers.dll* is generated in the output folder.



Congratulations! You have just:
> [!div class="checklist"]
> * Created a .NET Core app.
> * Added a reference to the Microsoft.XmlSerializer.Generator package.
> * Edited your MyApp.csproj to add dependencies.
> * Added a class and an XmlSerializer.
> * Built and ran the application.
> * Built and ran the application.

## Related Resources
## Related resources

* [Introducing XML Serialization](../../standard/serialization/introducing-xml-serialization.md)
* [How to: Serialize Using XmlSerializer (C#)](../../csharp/programming-guide/concepts/linq/how-to-serialize-using-xmlserializer.md)
* [How to: Serialize Using XmlSerializer (Visual Basic)](../../visual-basic/programming-guide/concepts/linq/how-to-serialize-using-xmlserializer.md)
* [How to: Serialize Using XmlSerializer (Visual Basic)](../../visual-basic/programming-guide/concepts/linq/how-to-serialize-using-xmlserializer.md)