Application config file using system.web in app.config

I have a windows form, I am using a webbased security module that has worked on other machines - When I add the module and run the app -I get this error "An error occurred creating the configuration section handler for system.web/membership: Request failed. "
The line that fails is marked by an arrow below

My system.web section in the app config file is as follows:
<system.web>
    <roleManager defaultProvider="KKRoleProvider" enabled="true" cacheRolesInCookie="true" cookieName=".KKROLES" cookieSlidingExpiration="true" cookieTimeout="120" cookiePath="/" cookieRequireSSL="false" cookieProtection="All">
      <providers>
        <clear/>
        <!--NOTE, THE ",SENTRY" APPENDED TO THE END OF THE TYPE VALUE IS EXTREMELY IMPORTANT.-->
        <add name="KKRoleProvider" type="Sentry.Security.KKRoleProvider, Sentry"/>
      </providers>
    </roleManager>
    <membership defaultProvider="KKMembershipProvider" userIsOnlineTimeWindow="130"> <-----here is where the error is
      <providers>
        <clear/>
        <!--NOTE, THE ",SENTRY" APPENDED TO THE END OF THE TYPE VALUE IS EXTREMELY IMPORTANT.-->
        <add name="KKMembershipProvider" type="Sentry.Security.KKMembershipProvider, Sentry" passwordFormat="Encrypted" />
      </providers>
    </membership>
  </system.web>

Open in new window

I am new here and I am all out of ideas - I got this app config from another winapp using the same module

Here is the stack trace
System.Configuration.ConfigurationErrorsException was unhandled
  Message=An error occurred creating the configuration section handler for system.web/membership: Request failed. (\\Dal-prod-fs01\Users\michael.canino\My Documents\Visual Studio 2010\Projects\PLM Admin(R)\PLM Admin(R)\bin\Debug\PLM Admin(R).vshost.exe.Config line 41)
  Source=System.Configuration
  BareMessage=An error occurred creating the configuration section handler for system.web/membership: Request failed.
  Filename=\\Dal-prod-fs01\Users\michael.canino\My Documents\Visual Studio 2010\Projects\PLM Admin(R)\PLM Admin(R)\bin\Debug\PLM Admin(R).vshost.exe.Config
  Line=41
  StackTrace:
       at System.Configuration.BaseConfigurationRecord.EvaluateOne(String[] keys, SectionInput input, Boolean isTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult)
       at System.Configuration.BaseConfigurationRecord.Evaluate(FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult, Boolean getLkg, Boolean getRuntimeObject, Object& result, Object& resultRuntimeObject)
       at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
       at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
       at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
       at System.Configuration.BaseConfigurationRecord.GetSection(String configKey, Boolean getLkg, Boolean checkPermission)
       at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
       at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName)
       at System.Configuration.ConfigurationManager.GetSection(String sectionName)
       at System.Web.Configuration.ClientRuntimeConfig.GetSectionObject(String sectionName)
       at System.Web.Configuration.RuntimeConfig.GetSection(String sectionName, Type type, ResultsIndex index)
       at System.Web.Configuration.RuntimeConfig.get_Membership()
       at System.Web.Security.Membership.Initialize()
       at System.Web.Security.MembershipUser..ctor(String providerName, String name, Object providerUserKey, String email, String passwordQuestion, String comment, Boolean isApproved, Boolean isLockedOut, DateTime creationDate, DateTime lastLoginDate, DateTime lastActivityDate, DateTime lastPasswordChangedDate, DateTime lastLockoutDate)
       at Sentry.Security.KKMembershipUser..ctor(String providername, String username, Object providerUserKey, String email, String passwordQuestion, String comment, Boolean isApproved, Boolean isLockedOut, DateTime createdDate, DateTime lastLoginDate, DateTime lastActivityDate, DateTime lastPasswordChangedDate, DateTime lastLockedOutDate, String FirstName, String LastName, Int32 UserTypeID, Int32 FactoryUID, Int32 RepUID, Boolean AsiaUser, Boolean useractive, String ideaPrefix, List`1 Roles, List`1 mrgRoles) in C:\KidKraft\Source\current_projects\Sentry\Security\KKMembershipUser.cs:line 79
       at KKPlmData.User.LoadUser() in C:\KidKraft\Source\current_projects\KKPLM\Branches\2.0\KKPlmApp\KKPlmData\User.cs:line 40
       at KKPlmData.User.Get(Boolean refresh) in C:\KidKraft\Source\current_projects\KKPLM\Branches\2.0\KKPlmApp\KKPlmData\User.cs:line 96
       at KKPlmData.User.set_UserName(String value) in C:\KidKraft\Source\current_projects\KKPLM\Branches\2.0\KKPlmApp\KKPlmData\User.cs:line 23
       at KKPlmData.User.Get(Boolean refresh) in C:\KidKraft\Source\current_projects\KKPLM\Branches\2.0\KKPlmApp\KKPlmData\User.cs:line 89
       at PLM_Admin_R_.Forms.MainControl.GetSqlString() in \\Dal-prod-fs01\Users\michael.canino\My Documents\Visual Studio 2010\Projects\PLM Admin(R)\PLM Admin(R)\MainControl.cs:line 185
       at PLM_Admin_R_.Forms.MainControl.MasterMenuControl_MasterMenuItemClick(MC12072009ItemClickArgs e) in \\Dal-prod-fs01\Users\michael.canino\My Documents\Visual Studio 2010\Projects\PLM Admin(R)\PLM Admin(R)\MainControl.cs:line 136
       at MC12072009.MC12072009.OnMouseDown(MouseEventArgs e)
       at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at System.Windows.Forms.ContainerControl.WndProc(Message& m)
       at System.Windows.Forms.UserControl.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(Form mainForm)
       at PLM_Admin_R_.Program.Main() in \\Dal-prod-fs01\Users\michael.canino\My Documents\Visual Studio 2010\Projects\PLM Admin(R)\PLM Admin(R)\Program.cs:line 19
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.Security.SecurityException
       Message=Request failed.
       Source=mscorlib
       GrantedSet=""
       PermissionState=<PermissionSet class="System.Security.PermissionSet"
version="1">
<IPermission class="System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Level="Minimal"/>
</PermissionSet>

       RefusedSet=""
       Url=""
       StackTrace:
            at System.Reflection.MethodBase.PerformSecurityCheck(Object obj, RuntimeMethodHandle method, IntPtr parent, UInt32 invocationFlags)
            at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
            at System.Reflection.ConstructorInfo.Invoke(Object[] parameters)
            at System.Configuration.TypeUtil.InvokeCtorWithReflectionPermission(ConstructorInfo ctor)
            at System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.CreateSectionImpl(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentConfig, ConfigXmlReader reader)
            at System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.CreateSectionWithRestrictedPermissions(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentConfig, ConfigXmlReader reader)
            at System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.CreateSection(Boolean inputIsTrusted, RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentConfig, ConfigXmlReader reader)
            at System.Configuration.RuntimeConfigurationRecord.CreateSection(Boolean inputIsTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentConfig, ConfigXmlReader reader)
            at System.Configuration.BaseConfigurationRecord.CallCreateSection(Boolean inputIsTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentConfig, ConfigXmlReader reader, String filename, Int32 line)
       InnerException: 

Open in new window



Someone please tell me what I am overlooking

Render
LVL 6
r3nderAsked:
Who is Participating?
 
Alan WarrenConnect With a Mentor Applications DeveloperCommented:
Hi r3nder,
are you defining a profile provider prior to instantiating your rolemanager?


    <profile enabled="true" defaultProvider="CustomizedProvider">
      <!-- Custom profile properties -->
      <providers>
        <remove name="CustomizedProvider"/>
        <add name="CustomizedProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="cnYourConnection" applicationName="yourbaredomainname" description="SqlProfileProvider for yourdomain.com"/>
      </providers>
    </profile>

Open in new window


Alan ";0)
0
 
r3nderAuthor Commented:
Got  it Thanks!!!
0
 
r3nderAuthor Commented:
Thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.