problems with custom providers - membership and roles

I have created custom providers for both membership and roles. I created them in a separate VB.NET project. The relevant snippets from my Web.config:

  <connectionStrings>
    <clear/>
    <add name="VelinsConnectionString"
         connectionString="Data Source=GARTH;Initial Catalog=VelocityInsurance;Integrated Security=True"
         providerName="System.Data.SqlClient"/>
  </connectionStrings>

      <roleManager enabled="true" cacheRolesInCookie="true" defaultProvider="VelinsRoleProvider" cookieTimeout="30" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="All">
        <providers>
          <clear />
          <add name="VelinsRoleProvider"
            type="VelinsProviders.VelinsRoleProvider, Providers.dll"
            connectionStringName="VelinsConnectionString"
            applicationName="\"
            writeExceptionsToEventLog="false"
            description="The roles provider for the Velocity Insurance site"   />
        </providers>
      </roleManager>  

      <membership defaultProvider="VelinsSqlServerMembershipProvider" userIsOnlineTimeWindow="15">
        <providers>
          <clear/>
          <add name="VelinsSqlServerMembershipProvider"
               type="VelinsProviders.VelinsMembershipProvider, Providers.dll"
               connectionStringName="VelinsConnectionString"
               enablePasswordRetrieval="false"
               enablePasswordReset="true"
               requiresQuestionAndAnswer="true"
               applicationName="\"
               requiresUniqueEmail="true"
               passwordFormat="Hashed"
               maxInvalidPasswordAttempts="5"
               minRequiredPasswordLength="7"
               minRequiredNonalphanumericCharacters="1"
               passwordAttemptWindow="10"
               passwordStrengthRegularExpression=""
               description="The membership provider for the Velocity Insurance site"
               autogenerateschema="true" />    
        </providers>
      </membership>

When I open up the Web administration tool, every works fine on the providers tab where I choose my providers as the ones to be used. However, when I click on the Security tab, I get the following error message:

There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store.

The following message may help in diagnosing the problem: Could not load file or assembly 'Providers.dll' or one of its dependencies. The system cannot find the file specified. (D:\VelocityInsurance\web.config line 115)
  

 I have Googled this to death and although this is a very common error, none of the fixes have worked for me.

As you can see from the following picture, I have added references to my Providers.dll (as well as my database access dlls) and they are residing in the bin directory of my website project:

dlls

Any help will be greatly appreciated.

Regards
Kate

0
kateVanG
5/2/2009 7:19:04 AM
asp.net.security 27051 articles. 1 followers. Follow

3 Replies
1180 Views

Similar Articles

[PageSpeed] 26

You have got the type wrong in the configuration.  You need to give the fully qualified .Net type which looks something like this:

System.Web.Configuration.ScriptingWebServicesSectionGroup, 
            System.Web.Extensions, Version=1.0.61025.0, 
            Culture=neutral, PublicKeyToken=31bf3856ad364e35

It has to include the ful class name preceded by the namespace, the assembly name as you would see it in the properties section of the visual studio project, the version as specofoed in the properties section, the culture (localization) if known and the public key token.  use sn.exe -T <yourdll.dll> to get this info from the Visual Studio command prompt.


Andrew
blog.andrewrivers.co.uk
0
wildmoose
5/2/2009 9:33:00 AM

OK. I have fixed this a little bit. wildmoose was correct in that I did have the syntax a little bit off in the type attribute. When I changed it to the following, I started to get basic functionality: type="Providers.VelinsProviders.VelinsMembershipProvider, Providers"  Subtle, but it works.

That is, if I created a user using a CreateUserWizard, then the user will be created with no problems. There is, however, still a problem with the WAT. I can now bring up the security tab without that previous error. But if I click manage users, I get the following error message:

The following message may help in diagnosing the problem: Object reference not set to an instance of an object. at System.Web.Administration.WebAdminPage.CallWebAdminHelperMethod(Boolean isMembership, String methodName, Object[] parameters, Type[] paramTypes) at ASP.security_users_manageusers_aspx.Page_Load() at System.Web.Util.CalliHelper.ArglessFunctionCaller(IntPtr fp, Object o) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

This could well be a result of something that I implemented wrongly in my providers classes. If anyone does recognise the error, a nudge in the right direction would be great.

0
kateVanG
5/2/2009 11:59:40 AM

Hi kateVanG,

It may be caused by your customized provider. Since the error happens when clicking "manage users" tab, I guess you may have to check the methods related to get all users. Also, you could use Reflector to check the source code of SqlMembershipProvider as well as SqlRoleProvider.

Thanks.


David Qian
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
0
Wencui
5/5/2009 6:21:25 AM
Reply:

Similar Artilces:

Problem implementing a Custom Role Provider.
Hello Everyone,       Im having some trouble trying to implement a custom role provider into my asp.net web application.  I have compiled the library file with the source code provided from the msdn article.. I placed the library file into the bin folder as directed but im getting an error inside the web configuration file.. <roleManager defaultProvider="CustomRoleProvider"         enabled="true">       <providers>       &nb...

custom sql role provider problem
what i'm trying todo:  Using windows authentication for the membershiop provider and a custom sql role provider for the roles.  what is working: - the memberschip provider is working perfectly oput of the box - the role provider works when i'm using coding to check for certain rols: Roles.IsUserInRole(login, "AppEdit")  Whats not working: - everything to allow/deny roles in the web.conf file (<allow roles="foo" />) my web.conf  1 2 <!-- 3 Note: As an alternative to hand editing this file you can use the 4 ...

Problem on using Custom Role Provider
I've already searched the forum regarding this but I can't get an answer in VB code and exact details.. I've already get the idea on how to create the custom membership provider but I can't understand the how to use a custom role provider. I've already put the ff codes on my web.config<roleManager enabled="true" defaultProvider="Class2">        <providers>          <add name="Class2"          connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=C:...

Problem implementing Custom Role Provider
I am using VS2005 and i m Implementing Custom Membership and Role Provider. My Custom Membership provider is working fine but Role provider is not Below is my Web.config file and the error that comes If i dont remove "<allow roles='a'/> in Web.config file. I am retrieveing usertype from "LoginMaster" table and returning it as user role in custom role provider class GetRolesForUser() Method. Web.config---------------------------------------------------------------------------------------<?xml version="1.0"?><!-- Note: As an alternative to ...

Problem with Login control using custom role providers
Hi,         I am using login control in my dafault page which will speak to my custom  membership and role providers for authentication. I Havent write any code in login page and still after i click on login it is hitting my custom membership provider.So far so good Now the problem is i need that to speak to my role provider and depending on the role of the user i want to redirect to different pages .I tried to dynamically set the destination page url its not working. Am i missing something or is the way i am doing that is wrong?. Please help with...

AJAX.NET in a custom module : Some kinda security problem
I have been building a custom module which uses the AJAX.NET dll (available through: http://ajax.schwarz-interactive.de/csharpsample/default.aspx)I have it working very well for ROOT portals, but for some reason it is breaking on CHILD Portals??Here's what I've done to make it work:In web.config I had to add the httpHanlder:<add verb="POST,GET" path="controls/*.ashx" type="Ajax.PageHandlerFactory, Ajax" />I used the path "controls/*.ashx" to get around DNNs URL Rewriting.  Using this path, DNN doesn't try to re-write the URL.  (By the way if you've been having problems gettin...

Problems implementing role security (.Net 1.1)
I'm having a problem implementing role based security.  Here's my code:   Sub Application_AuthenticateRequest(ByVal sender As Object, ByVal e As EventArgs) ' Fires upon attempting to authenticate the use If Not HttpContext.Current.User Is DBNull.Value Then If HttpContext.Current.User.Identity.AuthenticationType = "Forms" Then Dim id As Web.Security.FormsIdentity = CType(HttpContext.Current.User.Identity, Web.Security.FormsIdentity) Dim ticket As Web.Security.FormsAuthenticationTicket = id.Ticket Dim userData As String = ticket.User...

.net 3.5 Custome Role Provider Redirect on Access Denied
I built a cutome role provider for authentication on my companies new web site and it works. the only issue i am having is when it encounters a resource the user does not have access to it gives a generic "page cannot be displayed" page. i tried adding some custome error pages for http error 401 in the web.config but it hasnt had any luck. something i read leads me to believe the role provider is actually denying access well before asp gets that far to even do the redirect. i also havent had much luck researching this so if there is a good article or maybe a tip i would appreciat...

Problem with Connection of Informix .NET Provider with .NET.
Hello All, I am facing problem regarding connection of .NET with IBM Informix .NET Data Provider.I got a help from IBM site of Manual to connect with .NET and accessing informix as a informix .net data provider you need to import IBM.Informix.data as a namespace to access .NET based informix classes as similar to access sql server using namespace system.data.sqlclient.In that manual written as following---- Before you use the IBM Informix .NET Provider, you must execute the script, cdotnet.sql, against the sysmaster database as the user informix. So, my problem is that...

Are there still problems with role provider caching of roles?
Hi I'm about to write some custom membership and role providers but have noticed a number of forums and blogs mentioning a known problem when caching roles using the Roles config setting "cacheRolesInCookie=true". However I've not found anywhere that says what the problem is, just that it doesn't always work! Does anyone know if this was fixed in .Net 2.0 SP1? The recommendation seems to be to write your own caching functionality in the custom role provider. What would you folks recommend - application cache or session state? I'm discounting cookies ...

Loginview and RoleGroup.Roles with multiple custom role providers
What is the RoleGroup.Roles sub element of the loginview control based on in the presence of multiple custom role providers.  I have two custom role providers that I switch back and forth between programatically for authorization purposes.  Each custom role provider returns a different set of roles.  So if I have a loginview control with RoleGroup.Roles set then which of my two custom role providers will be used to determine if the content area appears for the user? Thanks in advance.  lperrin  ...

Custom Role Provider Everthing working except roles???
Hello Everyone, I am trying to use a custom role provider, the main purpose so that I don't have to use a database file. My web.config file is posted below. My problem is that I think I have followed all the steps to create a custom role provider using both articles on MSDN and some written by Scott Gu. After Modifying my web.config file I went to the asp.net configuration to test the connection. Users are created in the remote database but roles are being picked up and created in the App_Data folder. Can anyone give me a hint at what I am doing wrong? thanks in advance. <?xml version="...

using default member/role providers with custom profile providers
Hey guys,   I am in the process of creating my own website and I would like to take advantage of the provider structure that is currently there rather than writing my own.  I have read a ton of tutorials and I would like to use the default membership and role providers, and I have used the aspnet.regsql.exe to generate the tables in my SQL server 2005 DB.  however, I am having some trouble hooking this up with my own existing user table.  I tried to utilize the SqlStoredProcedureProfileProvider that I have downloaded here but i am not sure how to map it correctly w...

Getting sitemap's role to work for a custom role provider
Hi all,  I have derived my own Membership and Role provider using Access, and it works.  However, when i set roles for the web.sitemap and I set the enablesecuritytrimming to true, my menu or my sitemappath is not display the correct breadcrumb according to the roles set in the web.sitemap.  Since i am using a custom membership and role provider, do I need a custom site map provider in order to get the roles to work?  Or regardless of my custom membership and role provider, the sitemap's role will somehow figure its way to work with my custom role provider? Hi, I ha...

Security role problem
I work for Vancouver Port Authority and we are using the portal quite extensively. I have created a portal for our Canada Place Move and I have set up a security role that will allow certain individuals the ability to add files to our site. My problem is that when I enforce this role in a particular module giving it the right to edit/modify it I get a message that says the following: "Edit Access Denied" "Either you are not logged in, or you do not have access to modify the current portal module content" I don't want to set up these individuals with full admin r...

Web resources about - problems with custom providers - membership and roles - asp.net.security

Polish European Union membership referendum, 2003 - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Drivers of Facebook Shuttle Buses Eye Teamsters Membership
Facebook and several other tech companies in Silicon Valley provide shuttle buses to transport their employees, and according to The New York ...

NJ Membership (@NJMembership) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

Membership Has Its Privileges
Right now, crossing one of the magical rep borders happens more or less unnoticed. People just gain the particular powers. Now, of course they ...

Membership Cards - a set on Flickr
... home Sign Up Explore Recent Photos The Commons Getty Collection Galleries World Map App Garden Camera Finder Flickr Blog Upload Sign In Membership ...

Calgary Public Library: New Look. New Library. Free Membership. - YouTube
CREATING THE WORLD’S BEST PUBLIC LIBRARY: NEW LOOK. NEW LIBRARY. FREE MEMBERSHIP. For Immediate Release: In a bold move to become the world’s ...

The benefits of private club membership in the UAE
Lifestyle membership clubs can offer cardholders exclusive leisure discounts across the Emirates. But there can be a big catch - you need to ...

New Brisbane Broncos CEO Paul White Flags Membership Drive
The coal executive taking over at the helm of the Brisbane Broncos has his eyes set on the thousands of fans who regularly turn up to home games ...

Joe Tripodi's ALP membership suspended
NSW ALP has suspended membership of Joe Tripodi amid a corruption inquiry.

Invite-only memberships expand at Canberra's sky-high lounge
... club &ndash; if they have been lucky enough to get an invite The 15th floor lounge billed as Canberra's most exclusive has quadrupled its membership ...

Resources last updated: 1/11/2016 5:19:23 PM