0

我正在尝试在我的 ASP.NET 应用程序中实现 SQL Azure 瞬态故障配置。我正在尝试关注:http: //msdn.microsoft.com/en-us/library/hh680899 (v=pandp.50).aspx

虽然我没有找到关于如何在配置文件中配置它的块。我The type RetryManager does not have an accessible constructor.的代码出现错误。我在某个论坛上读到我应该使用配置文件对其进行配置,但是我的问题是什么。谢谢。

编辑:我正在使用 Enterprise Lib 5.0

4

1 回答 1

1

这是一个示例配置:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="RetryPolicyConfiguration" type="Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.Configuration.RetryPolicyConfigurationSettings, Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling, Version=5.1.1209.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
    <section name="typeRegistrationProvidersConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.TypeRegistrationProvidersConfigurationSection, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
  </configSections>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
  </startup>
  <RetryPolicyConfiguration defaultRetryStrategy="Incremental Retry Strategy" defaultSqlConnectionRetryStrategy="Backoff Retry Strategy" defaultSqlCommandRetryStrategy="Incremental Retry Strategy" defaultAzureStorageRetryStrategy="Incremental Retry Strategy" defaultAzureServiceBusRetryStrategy="Fixed Interval Retry Strategy">
    <incremental name="Incremental Retry Strategy" retryIncrement="00:00:05" maxRetryCount="5" />
    <fixedInterval name="Fixed Interval Retry Strategy" retryInterval="00:00:01" maxRetryCount="10" />
    <exponentialBackoff name="Backoff Retry Strategy" minBackoff="00:00:01" maxBackoff="00:00:30" deltaBackoff="00:00:10" maxRetryCount="10" />
  </RetryPolicyConfiguration>
  <typeRegistrationProvidersConfiguration>
    <clear />
    <add name="Caching" sectionName="cachingConfiguration" />
    <add name="Cryptography" sectionName="securityCryptographyConfiguration" />
    <add name="Exception Handling" sectionName="exceptionHandling" />
    <add name="Instrumentation" sectionName="instrumentationConfiguration" />
    <add name="Logging" sectionName="loggingConfiguration" />
    <add name="Policy Injection" sectionName="policyInjection" />
    <add name="Security" sectionName="securityConfiguration" />
    <add name="Data Access" providerType="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSyntheticConfigSettings, Microsoft.Practices.EnterpriseLibrary.Data" />
    <add name="Validation" providerType="Microsoft.Practices.EnterpriseLibrary.Validation.Configuration.ValidationTypeRegistrationProvider, Microsoft.Practices.EnterpriseLibrary.Validation" />
    <add sectionName="RetryPolicyConfiguration" name="RetryPolicyConfiguration" />
  </typeRegistrationProvidersConfiguration>
  <appSettings>
  </appSettings>
</configuration>
于 2013-09-25T01:53:16.863 回答