Click here to Skip to main content
15,888,461 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
Line 35:             {
Line 36:                 using (var context = new RsHunterDBEntities())
Line 37:                     context.Users.Find(1);
Line 38: 
Line 39:                 if (!WebSecurity.Initialized)

Source File: c:\Users\Developer\Documents\Visual Studio 2013\Projects\XeroConsultingApp\XeroConsultingWebApp\Global.asax.cs    Line: 37 

Stack Trace: 


[ArgumentException: Keyword not supported: 'initial catalog'.]
   System.Data.EntityClient.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Hashtable synonyms) +8442668
   System.Data.EntityClient.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms) +82
   System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString) +105
   System.Data.EntityClient.EntityConnection..ctor(String connectionString) +43
   System.Data.Entity.Internal.LazyInternalConnection.InitializeFromConnectionStringSetting(ConnectionStringSettings appConfigConnection) +78
   System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(String name, AppConfig config) +32
   System.Data.Entity.Internal.LazyInternalConnection.Initialize() +127
   System.Data.Entity.Internal.LazyInternalConnection.get_ProviderName() +13
   System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +346
   System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +18
   System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +52
   System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext() +15
   System.Data.Entity.Internal.Linq.InternalSet`1.Find(Object[] keyValues) +23
   System.Data.Entity.DbSet`1.Find(Object[] keyValues) +10
   XeroConsultingWebApp.SimpleMembershipInitializer..ctor() in c:\Users\Developer\Documents\Visual Studio 2013\Projects\XeroConsultingApp\XeroConsultingWebApp\Global.asax.cs:37

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +113
   System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +206
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +83
   System.Activator.CreateInstance(Type type) +11
   System.Threading.LazyHelpers`1.ActivatorFactorySelector() +68
   System.Threading.LazyInitializer.EnsureInitializedCore(T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory) +115
   System.Threading.LazyInitializer.EnsureInitialized(T& target, Boolean& initialized, Object& syncLock) +106
   XeroConsultingWebApp.Global.Application_Start(Object sender, EventArgs e) in c:\Users\Developer\Documents\Visual Studio 2013\Projects\XeroConsultingApp\XeroConsultingWebApp\Global.asax.cs:29

[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
   System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +9960905
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +118
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +339
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296

[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9942412
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +90
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +261

======================================================================================
XML
<configuration>
  <configSections>
        <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    </configSections>
  <system.web>
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />
    
  </system.web>
  <system.web>
    <membership defaultProvider="SimpleMembershipProvider">
      <providers>
        <clear/>
        <add name="SimpleMembershipProvider" type="WebMatrix.WebData.SimpleMembershipProvider, WebMatrix.WebData"/>
      </providers>
    </membership>
    <roleManager enabled="true" defaultProvider="SimpleMembershipProvider">

      <providers>
        <add name="SimpleMembershipProvider" type="System.Web.Security.SimpleMembershipProvider" applicatinonName="XeroConsultingWebApp" connectionStringName="RsHunterDBEntities"/>
        <clear />
        <add name="SimpleMembershipProvider" type="WebMatrix.WebData.SimpleRoleProvider, WebMatrix.WebData" />
        
      </providers>
    </roleManager>
  </system.web>
  <connectionStrings>
    <add name="RsHunterDBEntities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=FUTURE-TECH\SQLEXPRESS;initial catalog=RsHunterDB;user id=sa;password=C0mpaq007;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
  </connectionStrings>
 <appSettings>
      <add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
     <add key="webPages:Version" value="2.0"/>
    </appSettings>
  <system.webServer>
    <!--<modules>
      <remove name="RoleManager"/>
    </modules>-->
  </system.webServer>

</configuration>


What I have tried:

It seems i'm using an older version of the AspNetSqlRoleProvider maybe 2.0.
i also tried using webmatrix SimpleMembershipProvider.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900