Seems NET9 changes the System.AppContext.BaseDirectory and AppDomain.CurrentDomain.BaseDirectory to UNC paths:
\\?\UNC\rwells\very\special\bin\Development\net9.0\NLog.config
\\?\C:\Temp\NLog.config
These paths cannot be handled by Uri-object, which is used inside XmlReader for loading NLog.config-file. Uri throws System.UriFormatException - Invalid URI: The hostname could not be parsed..
Possible work-around is to manually read the contents of the NLog.config-file, and give the stream/string to the XmlReader (Only apply work-around when path starts with \\?\)
See also: https://stackoverflow.com/q/79208703/193178
Seems NET9 changes the
System.AppContext.BaseDirectoryandAppDomain.CurrentDomain.BaseDirectoryto UNC paths:\\?\UNC\rwells\very\special\bin\Development\net9.0\NLog.config\\?\C:\Temp\NLog.configThese paths cannot be handled by
Uri-object, which is used inside XmlReader for loading NLog.config-file. Uri throwsSystem.UriFormatException - Invalid URI: The hostname could not be parsed..Possible work-around is to manually read the contents of the NLog.config-file, and give the stream/string to the XmlReader (Only apply work-around when path starts with
\\?\)See also: https://stackoverflow.com/q/79208703/193178