2
Vote

How config for deverloper

description

I cant start sulution...
It error in membership




Server Error in '/' Application.
Value cannot be null.
Parameter name: Can not finish membership signin with membership not set.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: Can not finish membership signin with membership not set.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[ArgumentNullException: Value cannot be null.
Parameter name: Can not finish membership signin with membership not set.]
NearForums.Web.Controllers.Helpers.SecurityHelper.TryFinishMembershipLogin(SessionWrapper session, MembershipUser membershipUser, IUsersService service) +170
NearForums.Web.Controllers.Helpers.SecurityHelper.TryFinishMembershipLogin(HttpContextBase context, SessionWrapper session, MembershipProvider provider, IUsersService service) +246
NearForums.Web.Controllers.Filters.ContextAuthenticationAttribute.OnActionExecuting(ActionExecutingContext filterContext) +211
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func1 continuation) +41
System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +21
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func
1 continuation) +253
System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +21
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList1 filters, ActionDescriptor actionDescriptor, IDictionary2 parameters) +191
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +324
System.Web.Mvc.Controller.ExecuteCore() +106
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +91
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +34
System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +19
System.Web.Mvc.Async.<>c__DisplayClass81.<BeginSynchronous>b__7(IAsyncResult _) +10
System.Web.Mvc.Async.WrappedAsyncResult
1.End() +62
System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +48
System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9514812
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18408








My web.congfig is
<?xml version="1.0" encoding="utf-8"?>
<!-- For more information on how to configure your ASP.NET application, please visit http://go.microsoft.com/fwlink/?LinkId=152368 --> <configuration>
<configSections>
    <section name="routeMapping" type="NearForums.Configuration.Routing.RouteMappingConfiguration, NearForums" requirePermission="false" />
    <section name="site" type="NearForums.Configuration.SiteConfiguration, NearForums" requirePermission="false" />
    <section name="redirector" type="NearForums.Configuration.Redirector.RedirectorConfiguration, NearForums" requirePermission="false" />
    <section name="integration" type="NearForums.Configuration.Integration.IntegrationConfiguration, NearForums" requirePermission="false" />
    <section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" requirePermission="false" />
</configSections>
<appSettings>
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<routeMapping configSource="Config\Routes.config" />
<site configSource="Config\Site.config" />
<redirector configSource="Config\Redirector.config" />
<integration configSource="Config\Integration.config" />
<nlog configSource="Config\Logging.config" />
<connectionStrings>
    <!--<add name="Forums" connectionString="Data Source=nearforums;Initial Catalog=Forums;User ID=sa;Password=12345678" providerName="System.Data.SqlClient" />-->
    <add name="Membership" connectionString="Data Source=VIET-PC;Initial Catalog=forum102;User ID=sa;Password=sa" providerName="System.Data.SqlClient" />
    <!--<add name="YourDb" connectionString="Data Source=nearforums;Initial Catalog=AdventureWorksLT2008;User ID=sa;Password=12345678" providerName="System.Data.SqlClient" />-->

    <add name="Forums" connectionString="Data Source=VIET-PC;Initial Catalog=forum102;User ID=sa;Password=sa" providerName="System.Data.SqlClient"/>

    <!--
    The above connectionstring with name "forums" will be used by the site.
    Below this line you can see 2 samples of connection strings, one that points to a Microsoft SQL Server database and other that points to a MySql database.
    <add name="ForumsMSSQL" connectionString="Data Source=localhost;Initial Catalog=Forums;User ID=sa;Password=12345678" providerName="System.Data.SqlClient"/>
    <add name="ForumsMySql" connectionString="Server=localhost;Database=forums;Uid=user;Pwd=12345678;" providerName="MySql.Data.MySqlClient"/>
    -->
</connectionStrings>
<system.data>
    <DbProviderFactories>
        <remove invariant="MySql.Data.MySqlClient" />
        <add invariant="MySql.Data.MySqlClient" name="MySQL Data Provider" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data" />
    </DbProviderFactories>
</system.data>
<!-- <system.net> <mailSettings> <smtp deliveryMethod="SpecifiedPickupDirectory" from="admin@yoursite.com"> <specifiedPickupDirectory pickupDirectoryLocation="c:\Temp\" /> </smtp> </mailSettings> </system.net> -->
<system.web>
    <authentication mode="Forms" />
    <membership defaultProvider="ForumsMembershipProvider">
        <providers>
            <clear />
            <add name="ForumsMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="Membership" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" passwordFormat="Hashed" maxInvalidPasswordAttempts="30" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression="" applicationName="NearForums" />
<!-- <add name="ForumsMembershipProvider" type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=6.3.6.0, Culture=neutral" connectionStringName="Forums" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" passwordFormat="Hashed" maxInvalidPasswordAttempts="30" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression="" applicationName="NearForums"/> -->
        </providers>
    </membership>
    <compilation debug="true" targetFramework="4.0">
        <assemblies>
            <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            <add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            <add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        </assemblies>
    </compilation>
    <customErrors mode="Off" />
    <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.Routing" />
            <add namespace="System.Web.WebPages" />
        </namespaces>
    </pages>
    <trust level="Medium" />
    <httpHandlers>
        <remove verb="GET,HEAD,POST" path="*" />
        <add verb="*" path="*" type="NearForums.Web.Handlers.StaticFileHandler, NearForums.Web" />
    </httpHandlers>
    <httpModules>
        <add name="RedirectorModule" type="NearForums.Web.Modules.RedirectorModule, NearForums.Web" />
        <add name="ModelBinderModule" type="NearForums.Web.Modules.ModelBinderModule, NearForums.Web" />
        <add name="CompressionModule" type="NearForums.Web.Modules.CompressionModule, NearForums.Web" />
    </httpModules>
    <httpRuntime requestValidationMode="2.0" />
</system.web>
<!-- IIS 7.0. or above -->
<system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true">
        <add name="RedirectorModule" type="NearForums.Web.Modules.RedirectorModule, NearForums.Web" />
        <add name="ModelBinderModule" type="NearForums.Web.Modules.ModelBinderModule, NearForums.Web" />
    </modules>
</system.webServer>
<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>
            <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
        </dependentAssembly>
    </assemblyBinding>
</runtime>
</configuration>

comments

rdelacalle wrote Jun 30, 2014 at 6:39 PM

I dont know why, but I solve this by keeping the connection string named "Forums".