0

I posted a question (and answer) about simple configuration with these membership providers:

Asp.net MVC4, PostgreSQL and SimpleMembership

But now I want that all necessary tables for membership provider are located in separated schema, not in public. I created user and schema:

CREATE USER user1 WITH password 'user1';
CREATE SCHEMA user1 AUTHORIZATION user1;

My test application works ok with this schema and this connection string:

<add name="MovieDBContext" connectionString="Server=127.0.0.1;Port=5432;Database=postgres;User Id=user1;Password=user1;" 
     providerName="Npgsql" />

But non of mentioned membership providers…

NauckIT provider doesn’t want to work with Npgsql 2.1, only with 2.0.12:

Could not load file or assembly 'Npgsql, Version=2.0.12.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7' or one of its dependencies.

Very sadly

pgProvider throws an exception:

42501: you must be an owner of type user_record

I think that the problem to work with separated schema in unnecessary functional for creating tables automatically: https://code.google.com/p/pgprovider/wiki/Installation

Yes, it is possible to get sources and do what I need… But I surprised that it is impossible to find something ready to use…

May be I am mistaken? ))

Community
  • 1
  • 1
Billy Bons
  • 91
  • 1
  • 7

2 Answers2

1

A better solution for that is to force anything to use your assembly version of Npgsql, you can do that setting your web.config like this:

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Npgsql" publicKeyToken="5d8b90d52f46fda7" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
Ueslei Lima
  • 191
  • 1
  • 6
0

Ok, in separated schema may work NauckIT Membership Provider.

Download sources:

https://github.com/dnauck/AspSQLProvider

Open in VisualStudio

Do

Install-Package Npgsql -Version 2.1.0

Build

Ok

P.S. To generate keys go here:

http://aspnetresources.com/tools/machineKey

Billy Bons
  • 91
  • 1
  • 7