Asp.net MVC4,PostgreSQL和在分离模式MembershipProviders的表(NauckIT / pgProvider) [英] Asp.net MVC4, PostgreSQL and tables of MembershipProviders (NauckIT/ pgProvider) in separated schema

查看:236
本文介绍了Asp.net MVC4,PostgreSQL和在分离模式MembershipProviders的表(NauckIT / pgProvider)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发布了关于简单的配置与这些会员供应商的问题(和答案):

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

<一个href=\"http://stackoverflow.com/questions/22550572/asp-net-mvc4-postgresql-and-simplemembership\">Asp.net MVC4,PostgreSQL和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提供者不希望与Npgsql 2.1上班,只能用2.0.12:

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.

非常可悲的是

pgProvider抛出异常:

pgProvider throws an exception:

42501: you must be an owner of type user_record

我认为这个问题与分离的架构中不必要的功能工作自动创建表:
的https://$c$c.google.com/p/pgprovider/wiki /安装

是的,这是可能得到的来源,做什么,我需要...
但我感到惊讶,这是不可能找到准备使用...

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? ))

推荐答案

对于一个更好的解决办法是强求什么用Npgsql的程序集的版本,你可以做到这一点的设置你的web.config这样的:

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>

这篇关于Asp.net MVC4,PostgreSQL和在分离模式MembershipProviders的表(NauckIT / pgProvider)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆