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:
Any help will be greatly appreciated.
Regards
Kate
![]() |
0 |
![]() |
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=31bf3856ad364e35It 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 |
![]() |
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 |
![]() |
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 |
![]() |