0

我正在将我的 .NET MVC 应用程序移动到 Microsoft Azure 云服务。我计划将配置从 web.config 移动到 azure 中的 csdef/cscfg。

我的 web.config 文件几乎没有自定义配置部分。

<configuration>
  <configSections>
     <section name="myConfig1" type="MyNamespace.MyClassType" />
  </configSections>

  <myConfig1 someProperty1="someValue1" someProperty2="someValue2" someProperty3="someValue3">
     <test1 testproperty=testValue />
     <test2 xProperty=xValue />
  </myConfig1>
</configuration>

我在应用程序启动时使用此配置(global.asax)。我想把它转换成csdef/cscfg。通常 cscfg 具有配置设置的键/值对。

谁能建议我如何将自定义配置转换为 azure 中的服务配置?

4

1 回答 1

0

您的 web.config 仍将用于 Azure Web 角色。csdef 文件的目的是为您的应用程序定义环境——例如 VM 大小和任何自定义启动任务。您可以将任何键/值对放在 cscfg 文件中或将它们保留在 web.config 中。

于 2016-01-20T12:22:29.470 回答