Page 1 of 1

"Provider not specified" Membership Provider Exception

Posted: Mon 11 Aug 2014 21:54
by idem84
Hi!
I try to follow instructions in http://www.devart.com/dotconnect/univer ... iders.html

I am not able to implement dotConnectUniversal MembershipProvider with MySql Uniprovider and dotConnect Universal 3.50.668.0

if i set passwordFormat=Clear
{"An exception occurred. Please contact your administrator."}
Inner exception says "Provider not specified" in Membership.CreateUser method

if i set passwordFormat=Hashed
Provider can not encode password
Inner exception says "Provider not specified" in Membership.CreateUser method

if i set passwordFormat=Encrypted
"You must specify a non-autogenerated machine key to store passwords in the encrypted format. Either specify a different passwordFormat, or change the machineKey configuration to use a non-autogenerated decryption key."

Thanks in advance

Sample web.config:
===========
<configuration>
<connectionStrings>
<remove name="UniServices" />
<add name="Provider" connectionString="MySQL"/>
<add name="UniServices" connectionString="User Id=root;password=root;Host=localhost;Database=aspnetprovider" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0" />

<membership defaultProvider="AspNetUniMembershipProvider"
userIsOnlineTimeWindow="15">
<providers>
<add
name="AspNetUniMembershipProvider"
type="Devart.Data.Universal.Web.Providers.UniMembershipProvider,
Devart.Data.Universal.Web, Version=3.50.668.0, Culture=neutral,
PublicKeyToken=09af7300eec23701"
connectionStringName="UniServices"
enablePasswordRetrieval="true"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
minRequiredPasswordLength="6"
minRequiredNonalphanumericCharacters="0"
requiresUniqueEmail="false"
passwordFormat="Clear"
maxInvalidPasswordAttempts="5"
passwordAttemptWindow="10" />
</providers>
</membership>

</system.web>

</configuration>
===========

Sample code:
===========
var outMemberCreateStatus = new MembershipCreateStatus();
var res = Membership.CreateUser("anyuser", "anypassword1845", "[email protected]", "anyquestion", "anyanswer", true, null, out outMemberCreateStatus); //Here exceptions thrown
===========

Stacktrace:
at Devart.Data.Universal.n.a(String A_0, Boolean A_1)
at Devart.Data.Universal.n.b(String A_0)
at Devart.Data.Universal.UniConnectionStringBuilder.a(String A_0)
at Devart.Data.Universal.UniConnectionStringBuilder.set_ConnectionString(String value)
at Devart.Data.Universal.UniConnectionStringBuilder..ctor(String connectionString)
at Devart.Data.Universal.n.a(String A_0, da A_1)
at Devart.Common.DbConnectionFactory.a(String A_0, da& A_1)
at Devart.Common.DbConnectionBase.set_ConnectionString(String value)
at Devart.Data.Universal.UniConnection.set_ConnectionString(String value)
at Devart.Common.Web.Providers.DbMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object userId, MembershipCreateStatus& status)

Re: "Provider not specified" Membership Provider Exception

Posted: Mon 11 Aug 2014 22:07
by idem84
Fixed. Actually official web documentation has missed Provider value( http://www.devart.com/dotconnect/univer ... iders.html)
<add name="UniServices" connectionString="User Id=root;Host=localhost;Database=Test" />

Should be
<add name="UniServices" connectionString="Provider=MySQL;User Id=root;Host=localhost;Database=Test" />

Re: "Provider not specified" Membership Provider Exception

Posted: Wed 13 Aug 2014 15:26
by Pinturiccio
You are right, you need to specify the 'Provider' connection string parameter. We will make the corresponding changes to our documentation and post here about the results as soon as possible.

Re: "Provider not specified" Membership Provider Exception

Posted: Tue 16 Sep 2014 14:49
by Pinturiccio
Thank you for the information, we have changed our documentation. For more information, please refer to http://www.devart.com/dotconnect/univer ... iders.html