【发布时间】:2018-04-26 15:12:11
【问题描述】:
配置值存储在Web.config 中。当我构建 Web 项目时,Web.config 会以{ProjectName}.dll.config 的形式复制到构建文件夹中。在本地运行 Web 应用程序可以正常运行,使用 ConfigurationManager.AppSettings["{key}"]; 可以毫无问题地读取配置值。
但是,当我构建云服务时,{ProjectName}.dll.config 不会被复制到我上传并在 Azure 上运行的 cspkg 文件中。我希望它位于approot/bin。但是approot 中有一个Web.config。
在 Azure 上运行该应用程序在尝试使用 ConfigurationManager.AppSettings["{key}"]; 从应用程序设置中读取时失败。
我知道CloudConfigurationManager,但我想避免在Web.config 和云cscfg 中维护配置。
【问题讨论】:
标签: azure azure-web-roles azure-cloud-services