系统之家 - 系统光盘下载网站!

当前位置:系统之家 > 系统教程 > windowsazure经常出现的问题及解决方法(2)

windowsazure经常出现的问题及解决方法(2)

时间:2012-09-14 09:07:31 作者:木木 来源:系统之家 1. 扫描二维码随时看资讯 2. 请使用手机浏览器访问: https://m.xitongzhijia.net/xtjc/20120912/16171.html 手机查看 评论

  【1.4】 合理利用PartitionKey & RowKey

  具体参见: More about “PartitionKey”&"RowKey” in windows azure table storage

  <2> using customer httphandler in windows azure webrole, 在webrole中使用自定义HttpHandler.

  由于部署以后的webrole实际运行在IIS7上面,如果您配置的是:

  <system.web>

  <httpHandlers>

  将会报错,正确的配置是在节点中。

  <system.webServer>

  <modules runAllManagedModulesForAllRequests="true"/>

  <validation validateIntegratedModeConfiguration="false"></validation>

  <handlers>

  <add path="*.do" name="KeywordsHandler" verb="GET" type="KeywordsWebRole.KeywordsHandler,KeywordsWebRole" resourceType="Unspecified" allowPathInfo="true"></add>

  </handlers>

  </system.webServer>

     <3> 使用role配置文件里的storage连接信息创建client account时,使用以下代码:

  CloudStorageAccount account = CloudStorageAccount.FromConfigurationSetting("DataConnectionString");

  出现以下错误:

  Exception: SetConfigurationSettingPublisher needs to be called before FromConfigurationSetting can be used.

  解决方案:

  在 public override bool OnStart()中加入以下代码:

  CloudStorageAccount.SetConfigurationSettingPublisher((configName, configSetter) =>

  {

  configSetter(RoleEnvironment.GetConfigurationSettingValue(configName));

  RoleEnvironment.Changed += (anotherSender, arg) =>

  {

  if (arg.Changes.OfType()

  .Any((change) => (change.ConfigurationSettingName == configName)))

  {

  if (!configSetter(RoleEnvironment.GetConfigurationSettingValue(configName)))

  {

  RoleEnvironment.RequestRecycle();

  }

  }

  };

  });

  WindowsAzure平台是微软自主研发的一个云服务平台,是很专业性的产品,所以平时生活中我们也很少会遇到这种技术层面的东西,可以随便看看,当做多认识一个新鲜的事物.

发表评论

0

没有更多评论了

评论就这些咯,让大家也知道你的独特见解

立即评论

以上留言仅代表用户个人观点,不代表系统之家立场

其他版本软件

人气教程排行

XP系统推荐

扫码关注
扫码关注

扫码关注 官方交流群 软件收录