Parser Error Message: The configBuilder 'KeyPerFileAppSettings' failed while processing the configuration section 'appSettings'.: 'KeyPerFileAppSettings' Initialization Error: 'directoryPath' does not exist.
If I downgrade to version 2.0.0, it works again.
This is an ASP.NET WebForms application targeting .NET Framework 4.8
Functional Impacts
Application will not run when directoryPath in web.config is set to a network path.
Minimal repro steps
Create a ASP.NET Web application targeting .NET Framework 4.8
Add the version 2.0.0 nuget package Microsoft.Configuration.ConfigurationBuilders.KeyPerFile
Edit the web.config to configure the KeyPerfile configuration with directoryPath attribute set to a network path (be sure the path actually exists, the application pool identity or current user has permissions, and the file for the corresponding appsetting key exists)
Observe that the key loads successfully with version 2.0.0 of the package
Upgrade the NuGet package to version 3.0.0, rebuild, and run. Observe that now the network path is not found.
Expected Result
Keys are successfully loaded from files under the specified network path (assuming the path exists and appropriate application pool identity permissions are applied to the network path).
Actual Behavior
Configuration errors out with:
Parser Error Message: The configBuilder 'KeyPerFileAppSettings' failed while processing the
configuration section 'appSettings'.: 'KeyPerFileAppSettings'
Initialization Error: 'directoryPath' does not exist.
However, in fact the network path actually does exist.
Further Technical Details
I did not find any explicit mention of directoryPath support in the V3 updates of README.md.
However, I wonder if it could be related to the new "fallback" functionality:
Utils.MapPath - This was somewhat broken in ASP.Net scenarios previously. It should now reliably go against Server.MapPath() in ASP.Net scenarios. It has also been updated to fall back against the directory of the config file being processed when resolving the app root in the case of a Configuration object being created by ConfigurationManager.OpenConfiguration* API's rather than being part of a fully-initialized runtime configuration stack.
Version 3.0.0 breaks
directoryPath
on network pathsI've been using https://www.nuget.org/packages/Microsoft.Configuration.ConfigurationBuilders.KeyPerFile/2.0.0 successfully for some time where
directoryPath
is set to a network path (e.g.directoryPath="\\blah.blah.com\blah\AppSettings"
)However, upon updating to https://www.nuget.org/packages/Microsoft.Configuration.ConfigurationBuilders.KeyPerFile/3.0.0, I get the YSOD error
If I downgrade to version 2.0.0, it works again.
This is an ASP.NET WebForms application targeting .NET Framework 4.8
Functional Impacts
Application will not run when
directoryPath
in web.config is set to a network path.Minimal repro steps
Microsoft.Configuration.ConfigurationBuilders.KeyPerFile
directoryPath
attribute set to a network path (be sure the path actually exists, the application pool identity or current user has permissions, and the file for the corresponding appsetting key exists)Expected Result
Keys are successfully loaded from files under the specified network path (assuming the path exists and appropriate application pool identity permissions are applied to the network path).
Actual Behavior
Configuration errors out with:
However, in fact the network path actually does exist.
Further Technical Details
I did not find any explicit mention of
directoryPath
support in the V3 updates of README.md.However, I wonder if it could be related to the new "fallback" functionality: