gpt4 book ai didi

c# - 无法从 Azure KeyVault 读取值。指定的用户没有有效的配置文件

转载 作者:行者123 更新时间:2023-12-03 03:49:31 25 4
gpt4 key购买 nike

我们有多个服务器,在 IIS 上托管 ASP.NET 网站。在网站中,我们尝试从 Azure KeyVault 获取值。

在一台服务器中,由于某种原因,它无法从 Azure KeyVault 读取值,并出现错误“指定的用户没有有效的配置文件”。我们已经完成了调查、双重检查配置、文件权限 - 一切看起来都很好。还尝试调整 IIS 中的配置文件,但没有任何帮助。

这是堆栈跟踪:

Exception information: 
Exception type: ConfigurationErrorsException
Exception message: An error occurred loading a configuration file: The specified user does not have a valid profile. Unable to load 'Microsoft.Configuration.ConfigurationBuilders.Azure, Version=2.0.0.0, Culture=neutral'. (D:\<website_path> line 77)
at System.Configuration.BaseConfigurationRecord.EvaluateOne(String[] keys, SectionInput input, Boolean isTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult)
at System.Configuration.BaseConfigurationRecord.Evaluate(FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult, Boolean getLkg, Boolean getRuntimeObject, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey, Boolean getLkg, Boolean checkPermission)
at System.Web.Util.AppSettings.GetAppSettingsSection()
at System.Web.Util.AppSettings.EnsureSettingsLoaded()
at System.Web.Util.AppSettings.get_PortableCompilationOutput()
at System.Web.Compilation.BuildManager.RestorePortableCompilationOutputSnapshot()
at System.Web.Compilation.BuildManager.ExecutePreAppStart()
at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException)
The specified user does not have a valid profile. Unable to load 'Microsoft.Configuration.ConfigurationBuilders.Azure, Version=2.0.0.0, Culture=neutral'.
at System.Configuration.TypeUtil.GetTypeImpl(String typeString, Boolean throwOnError)
at System.Configuration.ConfigurationBuildersSection.InstantiateBuilder(ProviderSettings ps)
at System.Configuration.ConfigurationBuildersSection.GetBuilderFromName(String builderName)
at System.Configuration.BaseConfigurationRecord.GetSectionXmlReader(String[] keys, SectionInput input)

有人遇到过类似的问题吗?

任何帮助将不胜感激。

最佳答案

我在这里回答了类似的问题:Function app in Azure could not load file or assembly 'Microsoft.Extensions.Logging.Abstractions'

一定要检查一下 - 可能是出于同样的原因。可能有一个 nuget 包需要不同版本的 Microsoft.Configuration.ConfigurationBuilders.Azure:2.0.0。但是,您安装的版本不兼容。

关于c# - 无法从 Azure KeyVault 读取值。指定的用户没有有效的配置文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67325202/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com