configSource valid relative path in app.config throws System.Configuration.ConfigurationErrorsException: 'The configSource attribute must be a relative physical path. (C:\Projekte\MyProject\bin\Debug\.build\Debug\net6.0-windows\MyProject.dll.config line 7)' #74565
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In a .NET Framework 4.8 project i used the configSource in the App.config to load a custom configuration like following:
Now i try to to do the same in a .NET 6.0 project, but i throws the exception
System.Configuration.ConfigurationErrorsException: 'The configSource attribute must be a relative physical path. (C:\Projekte\MyProject\bin\Debug\.build\Debug\net6.0-windows\MyProject.dll.config line 7)'
in System.Configuration.BaseConfigurationRecord.NormalizeConfigSource @3206 because the System.Configuration.ConfigPathUtility.IsValid returns false @45. I can modify the configSource in a way that IsValid returns true, but then the xmlreader can't find the Config.config. Can someone explain me what i'm doing wrong or is this a bug?Beta Was this translation helpful? Give feedback.
All reactions