At first I got a helpful message about unity, but when I stripped unity out of my config I was left with a generic exception so then I stripped all sections except the microsfoft ones but still got a generic exception.
It works if I strip it down to connectionstring and appsettings. Is that expected?
$ dotnet config2json Web.config
Checking 'Web.config'...
Path 'Web.config' is a file
Migrating Web.config...
None of the parsers could parse [<unity configSource="config\Unity.config" />]!
An error occurred migrating Web.config:
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Extensions.Configuration.ConfigFile.KeyValueParser.AddToDictionary(XElement element, Stack`1 context, SortedDictionary`2 results) in C:\projects\dotnet-config2json\src\dotnet-config2json\Parser\KeyValueParser.cs:line 146
at Microsoft.Extensions.Configuration.ConfigFile.KeyValueParser.ParseElement(XElement element, Stack`1 context, SortedDictionary`2 results) in C:\projects\dotnet-config2json\src\dotnet-config2json\Parser\KeyValueParser.cs:line 85
at Microsoft.Extensions.Configuration.ConfigFile.KeyValueParser.ParseElement(XElement element, Stack`1 context, SortedDictionary`2 results) in C:\projects\dotnet-config2json\src\dotnet-config2json\Parser\KeyValueParser.cs:line 104
at Microsoft.Extensions.Configuration.ConfigFile.KeyValueParser.ParseElement(XElement element, Stack`1 context, SortedDictionary`2 results) in C:\projects\dotnet-config2json\src\dotnet-config2json\Parser\KeyValueParser.cs:line 104
at Microsoft.Extensions.Configuration.ConfigFile.ConfigFileConfigurationProvider.ParseElement(XElement element, Stack`1 context, SortedDictionary`2 results) in C:\projects\dotnet-config2json\src\dotnet-config2json\Parser\ConfigFileConfigurationProvider.cs:line 103
at Microsoft.Extensions.Configuration.ConfigFile.ConfigFileConfigurationProvider.Load() in C:\projects\dotnet-config2json\src\dotnet-config2json\Parser\ConfigFileConfigurationProvider.cs:line 85
at Config2Json.FileMigrator.MigrateFile(String file) in C:\projects\dotnet-config2json\src\dotnet-config2json\FileMigrator.cs:line 53
Migration complete.
jogai@myPc C:\SRC\myProj\myProj.Web\myProj.Web
$ dotnet config2json Web.config
Checking 'Web.config'...
Path 'Web.config' is a file
Migrating Web.config...
An error occurred migrating Web.config:
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Extensions.Configuration.ConfigFile.KeyValueParser.AddToDictionary(XElement element, Stack`1 context, SortedDictionary`2 results) in C:\projects\dotnet-config2json\src\dotnet-config2json\Parser\KeyValueParser.cs:line 146
at Microsoft.Extensions.Configuration.ConfigFile.KeyValueParser.ParseElement(XElement element, Stack`1 context, SortedDictionary`2 results) in C:\projects\dotnet-config2json\src\dotnet-config2json\Parser\KeyValueParser.cs:line 85
at Microsoft.Extensions.Configuration.ConfigFile.KeyValueParser.ParseElement(XElement element, Stack`1 context, SortedDictionary`2 results) in C:\projects\dotnet-config2json\src\dotnet-config2json\Parser\KeyValueParser.cs:line 104
at Microsoft.Extensions.Configuration.ConfigFile.KeyValueParser.ParseElement(XElement element, Stack`1 context, SortedDictionary`2 results) in C:\projects\dotnet-config2json\src\dotnet-config2json\Parser\KeyValueParser.cs:line 104
at Microsoft.Extensions.Configuration.ConfigFile.ConfigFileConfigurationProvider.ParseElement(XElement element, Stack`1 context, SortedDictionary`2 results) in C:\projects\dotnet-config2json\src\dotnet-config2json\Parser\ConfigFileConfigurationProvider.cs:line 103
at Microsoft.Extensions.Configuration.ConfigFile.ConfigFileConfigurationProvider.Load() in C:\projects\dotnet-config2json\src\dotnet-config2json\Parser\ConfigFileConfigurationProvider.cs:line 85
at Config2Json.FileMigrator.MigrateFile(String file) in C:\projects\dotnet-config2json\src\dotnet-config2json\FileMigrator.cs:line 53
Migration complete.
jogai@myPc C:\SRC\myProj\myProj.Web\myProj.Web
$ dotnet config2json Web.config
Checking 'Web.config'...
Path 'Web.config' is a file
Migrating Web.config...
An error occurred migrating Web.config:
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Extensions.Configuration.ConfigFile.KeyValueParser.AddToDictionary(XElement element, Stack`1 context, SortedDictionary`2 results) in C:\projects\dotnet-config2json\src\dotnet-config2json\Parser\KeyValueParser.cs:line 146
at Microsoft.Extensions.Configuration.ConfigFile.KeyValueParser.ParseElement(XElement element, Stack`1 context, SortedDictionary`2 results) in C:\projects\dotnet-config2json\src\dotnet-config2json\Parser\KeyValueParser.cs:line 85
at Microsoft.Extensions.Configuration.ConfigFile.KeyValueParser.ParseElement(XElement element, Stack`1 context, SortedDictionary`2 results) in C:\projects\dotnet-config2json\src\dotnet-config2json\Parser\KeyValueParser.cs:line 104
at Microsoft.Extensions.Configuration.ConfigFile.KeyValueParser.ParseElement(XElement element, Stack`1 context, SortedDictionary`2 results) in C:\projects\dotnet-config2json\src\dotnet-config2json\Parser\KeyValueParser.cs:line 104
at Microsoft.Extensions.Configuration.ConfigFile.ConfigFileConfigurationProvider.ParseElement(XElement element, Stack`1 context, SortedDictionary`2 results) in C:\projects\dotnet-config2json\src\dotnet-config2json\Parser\ConfigFileConfigurationProvider.cs:line 103
at Microsoft.Extensions.Configuration.ConfigFile.ConfigFileConfigurationProvider.Load() in C:\projects\dotnet-config2json\src\dotnet-config2json\Parser\ConfigFileConfigurationProvider.cs:line 85
at Config2Json.FileMigrator.MigrateFile(String file) in C:\projects\dotnet-config2json\src\dotnet-config2json\FileMigrator.cs:line 53
Migration complete.