问题描述
我发布了关于简单的配置与这些会员供应商的问题(和答案):
I posted a question (and answer) about simple configuration with these membership providers:
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
我认为这个问题与分离的架构中不必要的功能工作自动创建表:
是的,这是可能得到的来源,做什么,我需要...
但我感到惊讶,这是不可能找到准备使用...
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)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!