cake-contrib / Cake.Recipe

:page_with_curl: A set of convention based Cake scripts
https://cake-contrib.github.io/Cake.Recipe
MIT License
70 stars 53 forks source link

Unable to deserialize content of newly added cake-version.yml #961

Closed Jericho closed 1 year ago

Jericho commented 1 year ago

I get and exception when I try to parse the content of cake-version.yml

This code:

var deserializer = new YamlDotNet.Serialization.Deserializer();
var yamlConfig = deserializer.Deserialize<CakeVersionYamlConfig>(...the content of the yml file...);

results in the following exception:

(Line: 1, Col: 1, Idx: 0) - (Line: 1, Col: 19, Idx: 18): Property '?TargetCakeVersion' not found on type 'Cake.AddinDiscoverer.Models.CakeVersionYamlConfig'.

when I open the yml file on GitHub I get the following (notice the warning at the top of this screenshot and also notice the red character at the begining of the file): image

I believe this "red character" is causing the issue. It's probably some sort of 'byte order mark' (AKA BOM), or something. I'm not quite sure.

Jericho commented 1 year ago

I confirm that removing the BOM fixed the issue