Membership API issues

 
Nov 11, 2011
 
Hi,

I recently downloaded the .net 4.0 Design Pattern network and trying to run the Patterns in Action Web application project.
I am able to veiw the data (Products) but I am not able to login. The Membership.Validate is throwing a runtime error. I am using SQL Server(not sql express) for my database connections. Please let me know if I need to change any settings.

thanks,
Venkat

<?xml version="1.0"?>
<configuration>
<appSettings>
<!-- DataProvider. Only used in ADO.NET. Options are: System.Data.OleDb, System.Data.SqlClient, or System.Data.OracleClient. System.Data.EntityClient is not used -->
<add key="DataProvider" value="System.Data.SqlClient"/>
<!-- ConnectionName. A name in connectionstring Section. Must match with DataProvider above (if applicable)-->
<add key="ConnectionStringName" value="EntityFramework.SqlServer"/>
<!-- Log Severity. Options are: Debug, Info, Warning, Error, or Fatal -->
<add key="LogSeverity" value="Error"/>
<!-- Default Shipping Method. Options are: Fedex, UPS, or USPS  -->
<add key="ShippingMethod" value="Fedex"/>
</appSettings>
<!-- 
      Connection string settings 
    -->
<connectionStrings>
    <add name="EntityFramework.SqlExpress" connectionString="metadata=res://*/EntityFramework.Action.csdl|res://*/EntityFramework.Action.ssdl|res://*/EntityFramework.Action.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Action.mdf;Integrated Security=True;MultipleActiveResultSets=True;User Instance=True&quot;" providerName="System.Data.EntityClient" />
    <add name="EntityFramework.SqlServer" connectionString="metadata=res://*/EntityFramework.Action.csdl|res://*/EntityFramework.Action.ssdl|res://*/EntityFramework.Action.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=localhost;Initial Catalog=Action;Integrated Security=True&quot;" providerName="System.Data.EntityClient" />
    <add name="LinqToSql.SqlExpress" connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|Action.mdf"/>
    <add name="LinqToSql.SqlServer" connectionString="Data Source=localhost;Initial Catalog=Action;Integrated Security=True"/>
    <add name="ADO.NET.Access" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|action.mdb"/>
<add name="ADO.NET.SqlExpress" connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|Action.mdf"/>
<add name="ADO.NET.SqlServer" connectionString="Data Source=localhost;Initial Catalog=Action;Integrated Security=True"/>
<add name="ADO.NET.Oracle" connectionString="Data Source=OracleAction;User Id=scott;Password=tiger;Integrated Security=no;"/>
</connectionStrings>
<system.web>

    <compilation debug="true" targetFramework="4.0">
</compilation>

<authentication mode="None"/>


<membership defaultProvider="MembershipProvider">
<providers>
<clear/>
<add name="MembershipProvider"
             description="ASP.NET Membership database services."
             type="System.Web.Security.SqlMembershipProvider"
             connectionStringName="localsqlserver"  
             applicationName="/" 
             enablePasswordRetrieval="false" 
             enablePasswordReset="true" 
             requiresQuestionAndAnswer="false" 
             requiresUniqueEmail="true" 
             passwordFormat="Hashed" 
             maxInvalidPasswordAttempts="500" 
             passwordAttemptWindow="500" 
             minRequiredPasswordLength="7" 
             minRequiredNonalphanumericCharacters="0"/>
</providers>
</membership>
<pages controlRenderingCompatibilityVersion="4.0" clientIDMode="AutoID"/>
  </system.web>

<!--
        The system.webServer section is required for running ASP.NET AJAX under Internet
        Information Services 7.0.  It is not necessary for previous version of IIS.
    -->
<system.serviceModel>
<services>
<service behaviorConfiguration="behaviorAction" name="ActionService.ServiceImplementations.ActionService">
<endpoint binding="wsHttpBinding" bindingConfiguration="bindingAction" contract="ActionService.ServiceContracts.IActionService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="behaviorAction">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<wsHttpBinding>
<binding name="bindingAction" transactionFlow="false" sendTimeout="00:30:00" receiveTimeout="00:30:00">
<reliableSession enabled="true"/>
</binding>
</wsHttpBinding>
</bindings>
</system.serviceModel>
</configuration>

 



60   94.5
Jan 11, 2012
Try to connect to the ASPNETDB.MDF using the Server Explorer. When you're successful, copy the connection string and add this to the web.config file and replace the LocalSqlServer connection string with your new added string. I made the Action solution worked by changing the connection to a new instance of SQL Express 2008 R2 and running it on the IIS Exprerss 7.0 host.