Skip to content

Commit

Permalink
Got rid of warning CS0618: 'Deserializer.Deserializer on Build
Browse files Browse the repository at this point in the history
  • Loading branch information
arturcic committed Oct 23, 2018
1 parent a75cf7e commit fa1b4fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/GitVersionCore/Configuration/ConfigSerialiser.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GitVersion
namespace GitVersion
{
using System.IO;
using YamlDotNet.Serialization;
Expand All @@ -8,7 +8,7 @@ public class ConfigSerialiser
{
public static Config Read(TextReader reader)
{
var deserializer = new Deserializer(null, new HyphenatedNamingConvention());
var deserializer = new DeserializerBuilder().WithNamingConvention(new HyphenatedNamingConvention()).Build();
var deserialize = deserializer.Deserialize<Config>(reader);
if (deserialize == null)
{
Expand All @@ -19,8 +19,8 @@ public static Config Read(TextReader reader)

public static void Write(Config config, TextWriter writer)
{
var serializer = new Serializer(SerializationOptions.None, new HyphenatedNamingConvention());
var serializer = new SerializerBuilder().WithNamingConvention(new HyphenatedNamingConvention()).Build();
serializer.Serialize(writer, config);
}
}
}
}
5 changes: 3 additions & 2 deletions src/GitVersionCore/Configuration/LegacyConfigNotifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ public class LegacyConfigNotifier

public static void Notify(StringReader reader)
{
var deserializer = new Deserializer(null, new NullNamingConvention(), ignoreUnmatched: true);
var deserializer = new DeserializerBuilder().WithNamingConvention(new NullNamingConvention()).IgnoreUnmatchedProperties().Build();

var legacyConfig = deserializer.Deserialize<LegacyConfig>(reader);
if (legacyConfig == null)
return;
Expand Down Expand Up @@ -59,4 +60,4 @@ public static void Notify(StringReader reader)
throw new OldConfigurationException("GitVersion configuration file contains old configuration, please fix the following errors:\r\n" + string.Join("\r\n", issues));
}
}
}
}

0 comments on commit fa1b4fc

Please sign in to comment.