-
Notifications
You must be signed in to change notification settings - Fork 451
System.Configuration.ConfigurationErrorsException when usin AppSettings #328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Also coming up against this problem. |
Same, run into this issue when adding a connectionStrings section to the local.settings.json file. |
I also ran into this issue, and System.Configuration.ConfigurationManager appears to be unusable because of this. Removing the |
I came across the same error when debugging my function locally. Using Azure Functions CLI 2.1.0-beta (installed through the extension in Visual Studio) and I have the SDK v1.0.6 |
In 2.0, we have moved to the new ASP.NET Core configuration model. We intend to support binding to an IConfiguration instance that will provide a similar API, but in the meantime, the workaround is to read environment variables as opposed to relying on the |
See this blog for instructions on how to use AppSettings and ConnectionStrings in v2 https://blog.jongallant.com/2018/01/azure-function-config/ |
I'm using a third party product (NHiberate) that uses System.Configuration internally. What's the suggestion to work around this? There is no way for me to adjust their code so I'm pretty much stuck, as I would be if I use any of the other hundreds of packages out there that probably also use ConfigurationManager. @fabiocav - if I understand you correctly, asking us to use Environment variables or (in future) then use a new configuration api isn't going to be an option where we use third party produces under Azure Functions. There must be an alternative surely? (btw, NHibernate "just works in ASP.NET Core 2.0" so is there a difference with what you're doing in Azure Functions?) e.g.: 2018-05-11 09:53:23.61699,3,System.TypeInitializationException at NHibernate.NHibernateLogger.For(Type type) 2018-05-11 09:53:23.62025,3,System.Configuration.ConfigurationErrorsException at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey) 2018-05-11 09:53:23.63227,3,System.Configuration.ConfigurationErrorsException at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal) |
Closing as stale |
@jimmyca15 - Does AppConfig work with functions and is this a new recommended workaround for this? |
The following code for accessing
AppSettings
viaConfigurationManager
:throws a
System.Configuration.ConfigurationErrorsException
:It seems that
Azure.Functions.Cli.dll.config
refers toSystem.ServiceModel
, which appears to be depracated/removed from .Net Core.Info
Azure Functions Core Tools (2.0.1-beta.21)
Function Runtime Version: 2.0.11370.0
dotnet --version: 2.1.1
The text was updated successfully, but these errors were encountered: