C
C#2y ago
+_+

I keep getting "PlatformNotSupportedException" when using ConfigurationManager.GetSection on Windows

How is GetSection not supported on Windows? I'm pretty sure this must be some bug or a issue on my side right? my project is targetting NET Standard 2.0 here are some screenshots to show what's happening https://cdn.discordapp.com/attachments/1106166175253151845/1112071483049656360/image.png https://cdn.discordapp.com/attachments/1106166175253151845/1112071495900999802/image.png if you guys need any more information please let me know
5 Replies
JakenVeina
JakenVeina2y ago
it's not .GetSection(), it's the fact that that's the first call into tge system, which is triggering everything to load what's InnerException?
+_+
+_+OP2y ago
StackTrace:
at System.Configuration.ClientConfigPaths..ctor(String exePath, Boolean includeUserConfig)
at System.Configuration.ClientConfigPaths.GetPaths(String exePath, Boolean includeUserConfig)
at System.Configuration.ClientConfigurationHost.get_ConfigPaths()
at System.Configuration.ClientConfigurationHost.GetStreamName(String configPath)
at System.Configuration.ClientConfigurationHost.get_IsAppConfigHttp()
at System.Configuration.ClientConfigurationSystem..ctor()
at System.Configuration.ConfigurationManager.EnsureConfigurationSystem()
at System.Configuration.ClientConfigPaths..ctor(String exePath, Boolean includeUserConfig)
at System.Configuration.ClientConfigPaths.GetPaths(String exePath, Boolean includeUserConfig)
at System.Configuration.ClientConfigurationHost.get_ConfigPaths()
at System.Configuration.ClientConfigurationHost.GetStreamName(String configPath)
at System.Configuration.ClientConfigurationHost.get_IsAppConfigHttp()
at System.Configuration.ClientConfigurationSystem..ctor()
at System.Configuration.ConfigurationManager.EnsureConfigurationSystem()
Source: System.Configuration.ConfigurationManager
+_+
+_+OP2y ago
JakenVeina
JakenVeina2y ago
hmmmm something to do with paths, eh? what's your config config look like?
+_+
+_+OP2y ago
I think it might be the version of System.Configuration.ConfigurationManager I'm upgrading to 4.6.2 ill let you know if it fixes it Okay I fixed it, I had to reference System.Configuration.ConfigurationManager in my project referencing my configuration library because some reason it wasnt
Want results from more Discord servers?
Add your server