4

Daniel Nauckhttp://dev.nauck-it.de/projects/aspsqlproviderによって作成されたPostgreSQLメンバーシッププロバイダーをASP.NETWebアプリケーション(C#)に使用しようとしてい ます

http://dev.nauck-it.de/projects/1/wiki/Install?version=11

NpgSQLとメンバーシッププロバイダーをnugetでインストールしました。

Install-Package Npgsql
Install-Package Nauck.PostgreSQLProvider

project-configuration-websiteの[セキュリティ]タブにアクセスすると、次のエラーが発生します。

スタンドアロンexe内で実行していない場合は、exepathを指定する必要があります

指定されたSQLメンバーシップテーブルをpostgresデータベースに追加し、接続文字列と、指定された構成をweb.configファイルで指定しました。

web.config:

<configuration>

  <connectionStrings>
    <add name="PostgreSQL" connectionString="Server=localhost;Port=5432;Database=mydb;User Id=postgres;Password=mypassword;Encoding=UNICODE;Sslmode=Prefer;Pooling=true;" />
  </connectionStrings>

  <system.web>
    <compilation debug="true" targetFramework="4.0" />

    <membership defaultProvider="PgMembershipProvider">
      <providers>
        <clear />
        <add name="PgMembershipProvider" type="NauckIT.PostgreSQLProvider.PgMembershipProvider" connectionStringName="PostgreSQL" requiresUniqueEmail="true" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" passwordFormat="Hashed" applicationName="AquilaWeb" />
      </providers>
    </membership>

    <roleManager enabled="true" defaultProvider="PgRoleProvider" cacheRolesInCookie="true" cookieName=".AspNetRoles" cookiePath="/" cookieProtection="All" cookieRequireSSL="false" cookieSlidingExpiration="true" createPersistentCookie="false" cookieTimeout="30" maxCachedResults="25">
      <providers>
        <clear />
        <add name="PgRoleProvider" type="NauckIT.PostgreSQLProvider.PgRoleProvider" connectionStringName="PostgreSQL" applicationName="AquilaWeb" />
      </providers>
    </roleManager>

    <profile enabled="true" defaultProvider="PgProfileProvider">
      <providers>
        <clear />
        <add name="PgProfileProvider" type="NauckIT.PostgreSQLProvider.PgProfileProvider" connectionStringName="PostgreSQL" applicationName="AquilaWeb" />
      </providers>
      <properties>
        <add name="FirstName" />
        <add name="LastName" />
      </properties>
    </profile>

    <sessionState mode="Custom" customProvider="PgSessionStateStoreProvider">
      <providers>
        <clear/>
        <add name="PgSessionStateStoreProvider" type="NauckIT.PostgreSQLProvider.PgSessionStateStoreProvider" enableExpiredSessionAutoDeletion="true" expiredSessionAutoDeletionInterval="60000" enableSessionExpireCallback="false" connectionStringName="PostgreSQL" applicationName="AquilaWeb" />
      </providers>
    </sessionState>

  </system.web>

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Npgsql" publicKeyToken="5d8b90d52f46fda7" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.0.12.0" newVersion="2.0.12.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

</configuration>
4

1 に答える 1

3

プロバイダーのバージョン2.0.0を試してみることをお勧めします。ASP.NET4+でのホスト環境検出のバグ修正が含まれています

NuGetで最新のビルドを取得できます。

ドキュメントはプロジェクトウィキで入手できます。

于 2013-01-29T12:42:06.583 に答える