aaubry / YamlDotNet

YamlDotNet is a .NET library for YAML
MIT License
2.49k stars 466 forks source link

How do I build the .NET Core library ? #267

Closed ststeiger closed 7 years ago

ststeiger commented 7 years ago

I want to build the libary for .NET Core from source. It can't be done with the YamlDotNet project.

In the readmy it says - Support for .NET Core (netstandard1.3). But when I try to compile it, I see that it's using the Serializable attribute, which isn't present in .NET Core. I don't want to get a nuget package with no source-code.

How do I build it from source for .NET Core ?

aaubry commented 7 years ago

The project uses a cake script to specify the build recipe. If you are on Windows, use the buid.ps1 script to build the project:

.\build.ps1 -Target Build -Configuration Release-DotNetStandard-Unsigned

You should see an output similar to this.

If you are on Linux, use build.sh:

.\build.sh --target Build --configuration Release-DotNetStandard-Unsigned

Alternatively, if you want to avoid installing the build tools, there is another script that uses a docker container to build. Just replace build.sh by docker-build.sh:

.\docker-build.sh --target Build --configuration Release-DotNetStandard-Unsigned

If you prefer to build manually, you need to define the NETSTANDARD1_3 and PORTABLE preprocessor constants. This will ensure that the correct code is enabled.


Please let me know if you are able to build successfully, or if you encounter any problem.

aaubry commented 7 years ago

I encourage you to read CONTRIBUTING.md that contains more information about the build process.