Membership Initialize

Membership Initialize

Postby ZioLuca » Tue 24 Dec 2013 10:50

Hi,
I build an MVC application using membership and role providers supplied by dotConnect. Al works fine until I install the version 8.1.55.4. After the new installation I start to receive the error "Format of the initialization string does not conform to specification starting at index 0" during Login method.

I double check my connection strings but I don'made update on it, also I made a general check but I just update dotConnect, so I guess that the problem is because the new version.

I initialize the membership in the global.asax:
Code: Select all
using Devart.Common.Web;
[..]
            if (!WebSecurity.Initialized)
            {
                WebSecurity.InitializeDatabaseConnection("DbVispe", "USERS", "ID", "USERNAME", autoCreateTables: false);
            }
[..]

My login method is like:
Code: Select all
[...]
using WebMatrix.WebData;
[...]
        [AllowAnonymous]
        [HttpPost]
        public JsonResult JsonLogin(LoginModel model, string returnUrl)
        {
            if (ModelState.IsValid)
            {
                if (WebSecurity.Login(model.UserName, model.Password, persistCookie: model.RememberMe))
                {
                    FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe);
                    return Json(new { success = true, redirect = returnUrl });
                }
                else
                {
                    ModelState.AddModelError("", Resources.Account.errLogin);
                }
            }
        return Json(new { errors = GetErrorsFromModelState() }, "text/plain");
        }
[...]

In the web config I have the following :
Code: Select all
  <system.web>
    <compilation debug="true" targetFramework="4.5">
      <assemblies>
        <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
      </assemblies>
    </compilation>
    <httpRuntime targetFramework="4.5" />
    <authentication mode="Forms">
      <forms loginUrl="~/Account/Login" timeout="2880" />
    </authentication>
    <pages>
      <namespaces>
        <add namespace="System.Web.Helpers" />
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Optimization" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Web.WebPages" />
      </namespaces>
    </pages>
     <membership defaultProvider="OracleExtendedMembershipProvider" />
    <roleManager enabled="true" defaultProvider="OracleExtendedRoleProvider" />
  </system.web>


May be I forget something?

Thanks in advance for any help.

Regards,
Luca
ZioLuca
 
Posts: 4
Joined: Thu 20 Jun 2013 09:17

Re: Membership Initialize

Postby ZioLuca » Tue 24 Dec 2013 11:05

Hi,
I solved the problem with the following web config modification:
Code: Select all
   <membership defaultProvider="OracleExtendedMembershipProvider">
      <providers>
        <remove name="OracleExtendedMembershipProvider"/>
        <add name="OracleExtendedMembershipProvider" type="Devart.Data.Oracle.Web.Providers.OracleExtendedMembershipProvider, Devart.Data.Oracle.Web, Version=8.1.55.4, Culture=neutral, PublicKeyToken=09af7300eec23701" description="dotConnect for Oracle extended membership provider" connectionStringName="DbVispe" useridcolumn="ID" usernamecolumn="USERNAME" usertablename="USERS" />
      </providers>
    </membership>
    <roleManager enabled="true" defaultProvider="OracleExtendedRoleProvider">
      <providers>
        <remove name="OracleExtendedRoleProvider"/>
        <add name="OracleExtendedRoleProvider" type="Devart.Data.Oracle.Web.Providers.OracleExtendedRoleProvider, Devart.Data.Oracle.Web, Version=8.1.55.4, Culture=neutral, PublicKeyToken=09af7300eec23701" description="dotConnect for Oracle extended role provider" connectionStringName="DbVispe" useridcolumn="ID" usernamecolumn="USERNAME" usertablename="USERS" />
      </providers>
    </roleManager>


Regards.

Luca
ZioLuca
 
Posts: 4
Joined: Thu 20 Jun 2013 09:17


Return to dotConnect for Oracle