Я объявил 2 провайдеров членства:C# членства ошибка несколько провайдеров CreateUser
<membership defaultProvider="AspNetSqlMembershipProvider">
<providers>
<clear/>
<add connectionStringName="ConnectionString1" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" passwordFormat="Hashed" minRequiredNonalphanumericCharacters="2" minRequiredPasswordLength="8" maxInvalidPasswordAttempts="5" passwordAttemptWindow="30" applicationName="/" name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web,Version=2.0.0.0, Culture=neutral, PublicKeyToken=xzxzxz"/>
<add connectionStringName="ConnectionString2" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" passwordFormat="Hashed" minRequiredNonalphanumericCharacters="2" minRequiredPasswordLength="8" maxInvalidPasswordAttempts="5" passwordAttemptWindow="30" applicationName="/" name="AspNetSqlMembershipProviderProduction" type="System.Web.Security.SqlMembershipProvider, System.Web,Version=2.0.0.0, Culture=neutral, PublicKeyToken=xxxx"/>
</providers>
</membership>
Но когда я звоню CreateUser с помощью одного из провайдеров:
var membershipProviderProduction = Membership.Providers["AspNetSqlMembershipProviderProduction"];
MembershipUser newUser = membershipProviderProduction.CreateUser(username, password, email, question, answer, isAproved, out cs);
Я получаю эту ошибку:
Error 65 No overload for method 'CreateUser' takes 7 arguments
Как и первый ответ «ProviderUserKey»: Ошибка ясна. У вас слишком мало или много аргументов. Что скачал вам googling? ... [msdn] https://msdn.microsoft.com/en-us/library/system.web.security.membershipprovider.createuser (v = vs.110) .aspx – JHBonarius