-
Notifications
You must be signed in to change notification settings - Fork 204
ConfigBuilder.AddJsonFile throws ArgumentOutOfRange if given an empty file #335
Comments
I assume that configPath = System.IO.Path.GetTempPath() + Guid.NewGuid().ToString() + ".json" ? |
@pgrudzien12 Fixed, thanks. That's what I get for copy-pasting from two different files. |
I get the same error with a configuration file that has only one setting, such as this:
Note, though, that a second line will workaround the issue.
` |
This is happening because if
|
It is strange because we use |
+1
@ses4j first example is corrupted (it has extra comma). Nevertheless in RC1 it loads correctly for me. Could you provide an example of your code that loads configuration and version of dependencies you used? |
I agreed it would be nice to wrap any of these exception during parsing into a |
@kirthik can you look into this for rc2? |
I will if you don't mind (both of you). |
Sure thing! Looking forward to your PR. |
Thanks @Eilon thanks. @pgrudzien12 actually provided the fix in #337 and a better one in #358 and the PRs are already assigned to @HaoK. |
Thanks @pgrudzien12 for the fix! |
Given the following code:
You'll get the following exception:
Now I know that that's probably not the right way to use AddJsonFile but I would have expected a FormatException or something like that.
I'm using 1.0.0-rc2-15822, I attempted to add this as a unit test but I'm having issues with AddJsonFile being in a class that's not referenced by the unit test file I was editing.
The text was updated successfully, but these errors were encountered: