reinforced / Reinforced.Typings

Converts C# classes to TypeScript interfaces (and many more) within project build. 0-dependency, minimal, gluten-free
MIT License
507 stars 82 forks source link

RT0999: Input string was not in a correct format. #254

Open j-mok opened 1 year ago

j-mok commented 1 year ago

RT version: 1.6.1 .NET 6

I've been getting this when building:

Reinforced.Typings : Unexpected error RT0999: Input string was not in a correct format.

After some investigation I've found that what sparked a cascade of problems is a newline in my Reinforced.Typings.settings.xml (I didn't do it on purpose, it was a hard wrap from the formatter):

<RtConfigurationMethod>MyFancyReinforcedTypingsConfigurationWithALongClassName.Configure
    </RtConfigurationMethod>

From what I understand the MsBuild <RtCli> task puts all input props (including whitespace) in a temp file that is then parsed line-by-line by the command line tool. The extra newline in this prop (and possibly others?) seems to break the parsing, as the parses assumes one parameter per line. The error directly comes from here: https://github.com/reinforced/Reinforced.Typings/blob/2e58769b8b8b3ec8eab5356b492aef62fe36f42b/Reinforced.Typings.Cli/ExporterConsoleParameters.cs#L132-L134