Some changes.
This commit is contained in:
parent
fa4467f5b7
commit
14fee3a2dd
|
@ -13,15 +13,15 @@ The instructions assume you are using [.NET Core SDK daily builds](https://githu
|
||||||
1. cd into it, e.g. `cd MyData`
|
1. cd into it, e.g. `cd MyData`
|
||||||
|
|
||||||
1. Add a `nuget.config` file in the root of the project, using the following:
|
1. Add a `nuget.config` file in the root of the project, using the following:
|
||||||
* `dotnet new nuget`
|
* `dotnet new nuget`
|
||||||
* Edit the new `nuget.config`. Remove `<clear />` and add the following line,
|
* Edit the new `nuget.config`. Remove `<clear />` and add the following line,
|
||||||
|
|
||||||
`<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />`
|
`<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />`
|
||||||
* The final file should look like [nuget.config](nuget.config).
|
* The final file should look like [nuget.config](nuget.config).
|
||||||
|
|
||||||
4. `dotnet add package Microsoft.XmlSerializer.Generator -v 1.0.0-preview1-25718-03`
|
4. `dotnet add package Microsoft.XmlSerializer.Generator -v 1.0.0-preview1-25718-03`
|
||||||
|
|
||||||
4. Add the following lines in MyData.csproj. The version must match the package version.
|
4. Add the following lines in MyData.csproj.
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -29,12 +29,10 @@ The instructions assume you are using [.NET Core SDK daily builds](https://githu
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
```
|
```
|
||||||
|
|
||||||
6. Run `dotnet restore` to retore the package.
|
6. Run `dotnet restore`.
|
||||||
|
|
||||||
6. Run `dotnet build` to build the package.
|
6. Run `dotnet build` to build the package. If all succeed, a file named <AssemblyName>.XmlSerializers.dll will be generated under the output folder. You would see warnings in the output window if the serializer fail to generate.
|
||||||
If all succeed, a file named <AssemblyName>.XmlSerializers.dll will be generated under the debug folder. You should check the warning in the output window if the serializer fail to generate.
|
|
||||||
|
|
||||||
6. Create a console app and add a project reference for the library. Build and the library assembly and its generated serializer will all be in the output folder of the console app.
|
6. Create a console app and add a project reference to the library. Building the app will generate serialization code for the library and the assembly will be copied to the output folder of the app.
|
||||||
|
|
||||||
6. Run `dotnet publish` to publish the package.
|
6. Run `dotnet publish` to publish the app.
|
||||||
The generated serializer will be copied to the `PublishOutput` folder as well as the output assembly.
|
|
||||||
|
|
Loading…
Reference in a new issue