Back to list
Views:   6.7K
Replies:  1
Archived

Membership API issues

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>

 
Venkatasai Gorugantu, Nov 11, 2011
I just got the software about 2 weeks ago, and I also cannot log-in. The documentation says that the Membership is tied to the local machine.config SQLEXPRESS and there are access issues. I did manage to access the Product link but I still cannot log-in. I can access the aspnetdb thru Server Explorer, so my problem is not a connection issue. I manage access by changing the server to another instance of sqlexpress. I suggest you edit machine.config to the server you are using or maybe you can edit the membership connection string and create one similar to your server in the action server web.config. I am curious as to how you went about your membership API issue since your post was last November. As to another issue, I am getting this &quot;A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll&quot;. I read somewhere in an MVC3 book that the reason they recommend IIS7 is because of some socket issues with VS web host.
Jan 11, 2012
Reply 1
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.
Alex B, Jan 11, 2012


Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Licensing       EULA       Sitemap      
© Data & Object Factory, LLC.
Made with    in Austin, Texas.      Vsn 1.2.2