1

web.configからキャッシング要素を取得しようとしましたが、これまでのところ失敗しています。

このコードを使用する場合:

Configuration conf  = WebConfigurationManager.OpenWebConfiguration(System.Web.Hosting.HostingEnvironment.ApplicationVirtualPath);

web.confighファイルを取得できます。使うとき

conf.GetSection("system.web/membership");

メンバーシップセクションを取得しました。

使うとき

conf.GetSection("system.web/caching");

nullになります。

何か案は ?

以下のweb.configの一部:

    <system.web>
<caching>
  <sqlCacheDependency enabled="true" pollTime="1000">
    <databases>
      <clear />
      <add name="Tests" pollTime="1000" connectionStringName="TestsConnectionString"/>          
    </databases>        
  </sqlCacheDependency>      
</caching>
        <authentication mode="Forms">
        <forms loginUrl="~/Account/Login.aspx" timeout="2880"/>
    </authentication>
    <membership>
        <providers>
            <clear/>
            <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/>
        </providers>
    </membership>

...。

4

1 に答える 1