Hi -
I'm trying to implement a custom RoleProvider based on the SqlRoleProvider .
I keep receiving a an error that it can't load type
'MyRoleTest.MyR oleProvider' when trying to load my RoleProvider. However
this only occurs after deployment. On my local machine it works fine. So I
created the most basic role provider project I could think of. It is below:
Imports System.Web.Secu rity
Imports System.Web.Conf iguration
Imports System.Configur ation.Provider
Imports System.Collecti ons.Specialized
Imports System
Imports System.Data
Imports System.Data.Sql Client
Imports System.Configur ation
Imports System.Diagnost ics
Imports System.Web
Imports System.Globaliz ation
Imports System.Text
Imports Microsoft.Visua lBasic
Public Class MyRoleProvider
Inherits SqlRoleProvider
Public Overrides Sub Initialize(ByVa l name As String, ByVal config As
System.Collecti ons.Specialized .NameValueColle ction)
MyBase.Initiali ze(name, config)
End Sub
End Class
Here is how I reference it in the web.config :
<roleManager enabled="true" defaultProvider ="TheRoleProvid er">
<providers>
<clear/>
<add name="TheRolePr ovider" type="MyRoleTes t.MyRoleProvide r"
connectionStrin gName="dbConn" applicationName ="TestApp"/>
</providers>
</roleManager>
Locally it runs fine, but once deployed on the server it errors out on the
<add...line. I'm using the fully qualified type name and the DLL for the
project containing the provider is in the Bin folder.
The odd thing is that I did the exact same thing for the MembershipProvi der,
inheriting from SqlMembershipPr ovider and referencing it the same way in the
web.config and it works without a hitch. I would apprecieate any ideas. I
did try adding the MyRoleProvider class to the Web App Project itself in the
App_Code folder but that gave the same error. 5 8274
Good morning,
Assuming class definition should stay withing web app project, move
MyRoleProvider class file to app_code folder (do not define custom namespace
name in the class file), remove 'MyRoleTest' from webconfig
<add name="TheRolePr ovider" type="MyRolePro vider"
connectionStrin gName="dbConn" applicationName ="TestApp"/>
Otherwise, if provider resides in separate control library, reference
library and add fully qualified class name:
<add name="TheRolePr ovider" type="FullyQuil ifiedClassNameW ithNamespace"
connectionStrin gName="dbConn" applicationName ="TestApp"/>
hope it helps
--
Milosz
"Alias" wrote:
Hi -
I'm trying to implement a custom RoleProvider based on the SqlRoleProvider .
I keep receiving a an error that it can't load type
'MyRoleTest.MyR oleProvider' when trying to load my RoleProvider. However
this only occurs after deployment. On my local machine it works fine. So I
created the most basic role provider project I could think of. It is below:
Imports System.Web.Secu rity
Imports System.Web.Conf iguration
Imports System.Configur ation.Provider
Imports System.Collecti ons.Specialized
Imports System
Imports System.Data
Imports System.Data.Sql Client
Imports System.Configur ation
Imports System.Diagnost ics
Imports System.Web
Imports System.Globaliz ation
Imports System.Text
Imports Microsoft.Visua lBasic
Public Class MyRoleProvider
Inherits SqlRoleProvider
Public Overrides Sub Initialize(ByVa l name As String, ByVal config As
System.Collecti ons.Specialized .NameValueColle ction)
MyBase.Initiali ze(name, config)
End Sub
End Class
Here is how I reference it in the web.config :
<roleManager enabled="true" defaultProvider ="TheRoleProvid er">
<providers>
<clear/>
<add name="TheRolePr ovider" type="MyRoleTes t.MyRoleProvide r"
connectionStrin gName="dbConn" applicationName ="TestApp"/>
</providers>
</roleManager>
Locally it runs fine, but once deployed on the server it errors out on the
<add...line. I'm using the fully qualified type name and the DLL for the
project containing the provider is in the Bin folder.
The odd thing is that I did the exact same thing for the MembershipProvi der,
inheriting from SqlMembershipPr ovider and referencing it the same way in the
web.config and it works without a hitch. I would apprecieate any ideas. I
did try adding the MyRoleProvider class to the Web App Project itself in the
App_Code folder but that gave the same error.
Hi Milosz -
Thanks for responding. Is there anything else I can be looking for? What
you wrote is exactly what I wrote, that is why I can't figure this out. I'm
wondering if I'm missing a reference or something. I've tried it both ways
and I didn't use a namespace when I had it included in my web project. The
class is scaled down to the bare minimum and it works perfect locally but
not when it is deployed. Is there something I must override when inheriting
from SqlRoleProvider ? I'm starting to wonder if their is a native .Net DLL
that isn't being deployed. Thanks!
"Milosz Skalecki [MCAD]" <mi*****@DONTLI KESPAMwp.plwrot e in message
news:32******** *************** ***********@mic rosoft.com...
Good morning,
Assuming class definition should stay withing web app project, move
MyRoleProvider class file to app_code folder (do not define custom
namespace
name in the class file), remove 'MyRoleTest' from webconfig
<add name="TheRolePr ovider" type="MyRolePro vider"
connectionStrin gName="dbConn" applicationName ="TestApp"/>
Otherwise, if provider resides in separate control library, reference
library and add fully qualified class name:
<add name="TheRolePr ovider" type="FullyQuil ifiedClassNameW ithNamespace"
connectionStrin gName="dbConn" applicationName ="TestApp"/>
hope it helps
--
Milosz
"Alias" wrote:
>Hi -
I'm trying to implement a custom RoleProvider based on the SqlRoleProvide r. I keep receiving a an error that it can't load type 'MyRoleTest.My RoleProvider' when trying to load my RoleProvider. However this only occurs after deployment. On my local machine it works fine. So I created the most basic role provider project I could think of. It is below:
Imports System.Web.Secu rity Imports System.Web.Conf iguration Imports System.Configur ation.Provider Imports System.Collecti ons.Specialized Imports System Imports System.Data Imports System.Data.Sql Client Imports System.Configur ation Imports System.Diagnost ics Imports System.Web Imports System.Globaliz ation Imports System.Text Imports Microsoft.Visua lBasic
Public Class MyRoleProvider Inherits SqlRoleProvider Public Overrides Sub Initialize(ByVa l name As String, ByVal config As System.Collect ions.Specialize d.NameValueColl ection) MyBase.Initiali ze(name, config) End Sub End Class
Here is how I reference it in the web.config :
<roleManager enabled="true" defaultProvider ="TheRoleProvid er"> <providers> <clear/> <add name="TheRolePr ovider" type="MyRoleTes t.MyRoleProvide r" connectionStri ngName="dbConn" applicationName ="TestApp"/> </providers> </roleManager>
Locally it runs fine, but once deployed on the server it errors out on the <add...line. I'm using the fully qualified type name and the DLL for the project containing the provider is in the Bin folder.
The odd thing is that I did the exact same thing for the MembershipProv ider, inheriting from SqlMembershipPr ovider and referencing it the same way in the web.config and it works without a hitch. I would apprecieate any ideas. I did try adding the MyRoleProvider class to the Web App Project itself in the App_Code folder but that gave the same error.
No no, read my reply again :) I pointed you were using
"MyRoleTest.MyR oleProvider" instead of just "MyRoleProvider " in web.config. I
reckon this is the only reason for this exception (the message clearly
indicates certain type cannot be loaded). All references are there, i they
weren't, you would get exception like 'cannot load assembly blablalaa'. Move
the class to app_code directory (make sure it's public), then update
web.config with
<add name="TheRolePr ovider" type="MyRolePro vider"
connectionStrin gName="dbConn" applicationName ="TestApp"/>
Should work.
--
Milosz
"Alias" wrote:
Hi Milosz -
Thanks for responding. Is there anything else I can be looking for? What
you wrote is exactly what I wrote, that is why I can't figure this out. I'm
wondering if I'm missing a reference or something. I've tried it both ways
and I didn't use a namespace when I had it included in my web project. The
class is scaled down to the bare minimum and it works perfect locally but
not when it is deployed. Is there something I must override when inheriting
from SqlRoleProvider ? I'm starting to wonder if their is a native .Net DLL
that isn't being deployed. Thanks!
"Milosz Skalecki [MCAD]" <mi*****@DONTLI KESPAMwp.plwrot e in message
news:32******** *************** ***********@mic rosoft.com...
Good morning,
Assuming class definition should stay withing web app project, move
MyRoleProvider class file to app_code folder (do not define custom
namespace
name in the class file), remove 'MyRoleTest' from webconfig
<add name="TheRolePr ovider" type="MyRolePro vider"
connectionStrin gName="dbConn" applicationName ="TestApp"/>
Otherwise, if provider resides in separate control library, reference
library and add fully qualified class name:
<add name="TheRolePr ovider" type="FullyQuil ifiedClassNameW ithNamespace"
connectionStrin gName="dbConn" applicationName ="TestApp"/>
hope it helps
--
Milosz
"Alias" wrote:
Hi -
I'm trying to implement a custom RoleProvider based on the
SqlRoleProvider .
I keep receiving a an error that it can't load type
'MyRoleTest.MyR oleProvider' when trying to load my RoleProvider. However
this only occurs after deployment. On my local machine it works fine.
So I
created the most basic role provider project I could think of. It is
below:
Imports System.Web.Secu rity
Imports System.Web.Conf iguration
Imports System.Configur ation.Provider
Imports System.Collecti ons.Specialized
Imports System
Imports System.Data
Imports System.Data.Sql Client
Imports System.Configur ation
Imports System.Diagnost ics
Imports System.Web
Imports System.Globaliz ation
Imports System.Text
Imports Microsoft.Visua lBasic
Public Class MyRoleProvider
Inherits SqlRoleProvider
Public Overrides Sub Initialize(ByVa l name As String, ByVal config As
System.Collecti ons.Specialized .NameValueColle ction)
MyBase.Initiali ze(name, config)
End Sub
End Class
Here is how I reference it in the web.config :
<roleManager enabled="true" defaultProvider ="TheRoleProvid er">
<providers>
<clear/>
<add name="TheRolePr ovider" type="MyRoleTes t.MyRoleProvide r"
connectionStrin gName="dbConn" applicationName ="TestApp"/>
</providers>
</roleManager>
Locally it runs fine, but once deployed on the server it errors out on
the
<add...line. I'm using the fully qualified type name and the DLL for
the
project containing the provider is in the Bin folder.
The odd thing is that I did the exact same thing for the
MembershipProvi der,
inheriting from SqlMembershipPr ovider and referencing it the same way in
the
web.config and it works without a hitch. I would apprecieate any ideas.
I
did try adding the MyRoleProvider class to the Web App Project itself in
the
App_Code folder but that gave the same error.
Hi Milosz -
I was using MyRoleTest.MyRo leProvider for the type because my class was in a
seperate project.
At the bottom of my post I said that I tried adding the class directly to
the App_Code folder, when I did that I was using only the class name for
MyRoleProvider for the type. Which is why I can find no reason for this not
to work.
It works perfect for my custom MembershipProvi der class however the exact
same thing doesn't work for my custom RoleProvider class when deployed.
Thanks for taking the time to respond. I appreciate that.
"Milosz Skalecki [MCAD]" <mi*****@DONTLI KESPAMwp.plwrot e in message
news:69******** *************** ***********@mic rosoft.com...
No no, read my reply again :) I pointed you were using
"MyRoleTest.MyR oleProvider" instead of just "MyRoleProvider " in
web.config. I
reckon this is the only reason for this exception (the message clearly
indicates certain type cannot be loaded). All references are there, i they
weren't, you would get exception like 'cannot load assembly blablalaa'.
Move
the class to app_code directory (make sure it's public), then update
web.config with
<add name="TheRolePr ovider" type="MyRolePro vider"
connectionStrin gName="dbConn" applicationName ="TestApp"/>
Should work.
--
Milosz
"Alias" wrote:
>Hi Milosz -
Thanks for responding. Is there anything else I can be looking for? What you wrote is exactly what I wrote, that is why I can't figure this out. I'm wondering if I'm missing a reference or something. I've tried it both ways and I didn't use a namespace when I had it included in my web project. The class is scaled down to the bare minimum and it works perfect locally but not when it is deployed. Is there something I must override when inheriting from SqlRoleProvider ? I'm starting to wonder if their is a native .Net DLL that isn't being deployed. Thanks!
"Milosz Skalecki [MCAD]" <mi*****@DONTLI KESPAMwp.plwrot e in message news:32******* *************** ************@mi crosoft.com...
Good morning,
Assuming class definition should stay withing web app project, move
MyRoleProvider class file to app_code folder (do not define custom
namespace
name in the class file), remove 'MyRoleTest' from webconfig
<add name="TheRolePr ovider" type="MyRolePro vider"
connectionStrin gName="dbConn" applicationName ="TestApp"/>
Otherwise, if provider resides in separate control library, reference
library and add fully qualified class name:
<add name="TheRolePr ovider" type="FullyQuil ifiedClassNameW ithNamespace"
connectionStrin gName="dbConn" applicationName ="TestApp"/>
hope it helps
--
Milosz
"Alias" wrote:
Hi -
I'm trying to implement a custom RoleProvider based on the SqlRoleProvide r. I keep receiving a an error that it can't load type 'MyRoleTest.My RoleProvider' when trying to load my RoleProvider. However this only occurs after deployment. On my local machine it works fine. So I created the most basic role provider project I could think of. It is below:
Imports System.Web.Secu rity Imports System.Web.Conf iguration Imports System.Configur ation.Provider Imports System.Collecti ons.Specialized Imports System Imports System.Data Imports System.Data.Sql Client Imports System.Configur ation Imports System.Diagnost ics Imports System.Web Imports System.Globaliz ation Imports System.Text Imports Microsoft.Visua lBasic
Public Class MyRoleProvider Inherits SqlRoleProvider Public Overrides Sub Initialize(ByVa l name As String, ByVal config As System.Collect ions.Specialize d.NameValueColl ection) MyBase.Initiali ze(name, config) End Sub End Class
Here is how I reference it in the web.config :
<roleManager enabled="true" defaultProvider ="TheRoleProvid er"> <providers> <clear/> <add name="TheRolePr ovider" type="MyRoleTes t.MyRoleProvide r" connectionStri ngName="dbConn" applicationName ="TestApp"/> </providers> </roleManager>
Locally it runs fine, but once deployed on the server it errors out on the <add...line. I'm using the fully qualified type name and the DLL for the project containing the provider is in the Bin folder.
The odd thing is that I did the exact same thing for the MembershipProv ider, inheriting from SqlMembershipPr ovider and referencing it the same way in the web.config and it works without a hitch. I would apprecieate any ideas. I did try adding the MyRoleProvider class to the Web App Project itself in the App_Code folder but that gave the same error.
Howdy,
Sorry for misunderstandin g. Try another resolution -create a control library
with the custom provider, then reference it in web site project, (don't
forget about with fully quilified name in web application's web.config file.
--
Milosz
"Alias" wrote:
Hi Milosz -
I was using MyRoleTest.MyRo leProvider for the type because my class was in a
seperate project.
At the bottom of my post I said that I tried adding the class directly to
the App_Code folder, when I did that I was using only the class name for
MyRoleProvider for the type. Which is why I can find no reason for this not
to work.
It works perfect for my custom MembershipProvi der class however the exact
same thing doesn't work for my custom RoleProvider class when deployed.
Thanks for taking the time to respond. I appreciate that.
"Milosz Skalecki [MCAD]" <mi*****@DONTLI KESPAMwp.plwrot e in message
news:69******** *************** ***********@mic rosoft.com...
No no, read my reply again :) I pointed you were using
"MyRoleTest.MyR oleProvider" instead of just "MyRoleProvider " in
web.config. I
reckon this is the only reason for this exception (the message clearly
indicates certain type cannot be loaded). All references are there, i they
weren't, you would get exception like 'cannot load assembly blablalaa'.
Move
the class to app_code directory (make sure it's public), then update
web.config with
<add name="TheRolePr ovider" type="MyRolePro vider"
connectionStrin gName="dbConn" applicationName ="TestApp"/>
Should work.
--
Milosz
"Alias" wrote:
Hi Milosz -
Thanks for responding. Is there anything else I can be looking for?
What
you wrote is exactly what I wrote, that is why I can't figure this out.
I'm
wondering if I'm missing a reference or something. I've tried it both
ways
and I didn't use a namespace when I had it included in my web project.
The
class is scaled down to the bare minimum and it works perfect locally but
not when it is deployed. Is there something I must override when
inheriting
from SqlRoleProvider ? I'm starting to wonder if their is a native .Net
DLL
that isn't being deployed. Thanks!
"Milosz Skalecki [MCAD]" <mi*****@DONTLI KESPAMwp.plwrot e in message
news:32******** *************** ***********@mic rosoft.com...
Good morning,
Assuming class definition should stay withing web app project, move
MyRoleProvider class file to app_code folder (do not define custom
namespace
name in the class file), remove 'MyRoleTest' from webconfig
<add name="TheRolePr ovider" type="MyRolePro vider"
connectionStrin gName="dbConn" applicationName ="TestApp"/>
Otherwise, if provider resides in separate control library, reference
library and add fully qualified class name:
<add name="TheRolePr ovider" type="FullyQuil ifiedClassNameW ithNamespace"
connectionStrin gName="dbConn" applicationName ="TestApp"/>
hope it helps
--
Milosz
"Alias" wrote:
Hi -
I'm trying to implement a custom RoleProvider based on the
SqlRoleProvider .
I keep receiving a an error that it can't load type
'MyRoleTest.MyR oleProvider' when trying to load my RoleProvider.
However
this only occurs after deployment. On my local machine it works fine.
So I
created the most basic role provider project I could think of. It is
below:
Imports System.Web.Secu rity
Imports System.Web.Conf iguration
Imports System.Configur ation.Provider
Imports System.Collecti ons.Specialized
Imports System
Imports System.Data
Imports System.Data.Sql Client
Imports System.Configur ation
Imports System.Diagnost ics
Imports System.Web
Imports System.Globaliz ation
Imports System.Text
Imports Microsoft.Visua lBasic
Public Class MyRoleProvider
Inherits SqlRoleProvider
Public Overrides Sub Initialize(ByVa l name As String, ByVal config
As
System.Collecti ons.Specialized .NameValueColle ction)
MyBase.Initiali ze(name, config)
End Sub
End Class
Here is how I reference it in the web.config :
<roleManager enabled="true" defaultProvider ="TheRoleProvid er">
<providers>
<clear/>
<add name="TheRolePr ovider" type="MyRoleTes t.MyRoleProvide r"
connectionStrin gName="dbConn" applicationName ="TestApp"/>
</providers>
</roleManager>
Locally it runs fine, but once deployed on the server it errors out on
the
<add...line. I'm using the fully qualified type name and the DLL
for
the
project containing the provider is in the Bin folder.
The odd thing is that I did the exact same thing for the
MembershipProvi der,
inheriting from SqlMembershipPr ovider and referencing it the same way
in
the
web.config and it works without a hitch. I would apprecieate any
ideas.
I
did try adding the MyRoleProvider class to the Web App Project itself
in
the
App_Code folder but that gave the same error.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Kevin |
last post by:
Help,
I am running a pass through query to oracle from SQL server 2000 as
follows;
select * from openquery(nbsp, 'select * from FND_FLEX_VALUES')
I have run this query through both DTS and the query analyzer and get
the foloowing error;
|
by: jff |
last post by:
I defined a simple enumeration called "LandProjections" in one of my C# class
library assemblies. I have another class library assembly that has a static
method which references the enumeration. When I execute the static method via
a test-driver windows form, I get the "System.TypeLoadException: Could not
load type...
|
by: Kris |
last post by:
Hey everyone,
I am trying to make a multi-project web application in
visual studio that uses the server.transfer method in C#
to get to the different aspx pages.
However, when I call out to the page it gives me the
Could not load type "MainConsole.Default". The code was
working before when i had it all in one project. I want
to seperate...
|
by: xz |
last post by:
I just installed Visual web dev. 2005 beta 1. I've never used the lite
SQL server 2005 database, so I decided to try it out. From the Visual
web dev. I selected 'create new sql server database' from data
connections (on the rt hand side). I tried both using windows NT
integrated security, & also specifying a userid & password... nothing...
|
by: .Net Sports |
last post by:
I'm trying to build a datagrid project in vs.net, and getting an error
that doesnt make sense:
\\\\\\\\\\\\\\
Could not load type 'SportsMProject.btresults2a'.
Source Error:
Line 1: <%@ Import Namespace="System.Data.SqlClient"%>
Line 2: <%@ Import Namespace="System.Data"%>
| |
by: Dominique Vandensteen |
last post by:
I want to dynamicly load a type (typename is defined in the database).
This type is located in the exe itself or one of the dll's in the directory
with the exe file.
When creating an instance directly it works, when using reflection none of
the dll's is "scanned".
I used following code to work around this problem.
Now I just want to know if...
|
by: hamstak |
last post by:
While attempting to perform a build on an .aspx page from within VS
2005 I receive the "Could not load type" error pertaining to the class
representing the page. The class is derived from a custom base class
(which itself is derived from System.Web.UI.Page). This custom base
class has been used in other projects successfully. The Inherits...
|
by: epatrick |
last post by:
I have a series of custom controls developed under ASP.NET 1.1, and
I've successfully migrated to ASP.NET 2.0. I have also developed a
custom class dervied from System.Web.UI.Page, called qbo.Web.Page.
All of these controls compile and run correctly under ASP.NET 2.0.
However, several of these controls throw an error in the design mode
of...
|
by: freeflytim |
last post by:
I'm trying to implement a custom MembershipProvider (and RoleProvider)
together with a custom MembershipUser class in C#, Asp.Net 2.0, MS
Visual Studio 2005.
Everything has worked fine so far, all compiles, then I try to run the
Website administration tool (WAT). I can bring up the main web page of
the tool, but as soon as I click on...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |