.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

custom role manager, type error in Web.config

Posted By:      Posted Date: September 14, 2010    Points: 0   Category :ASP.Net
Hello everybody.I am developping a role provider for AD.I have copy in the root directory of my project in VS2010 the file MyAdamRoleProvider.vb which is an example of a book.I have declared in my web.config the role provider like this: <connectionStrings> <add name="ADService" connectionString="LDAP://webcubedev/OU=webcube,DC=wcdev,DC=local"/> <add name="ADServiceRole" connectionString="LDAP://webcubedev/OU=webcube,DC=wcdev,DC=local"/> </connectionStrings> <system.web> <roleManager enabled="true" defaultProvider="ActiveDirRP"> <providers> <add name="AspNetActiveDirectoryMembershipProvider" type="MyAdamRoleProvider" connectionStringName="ADService" connectionStringRoleName="ADServiceRole" /> </providers> </roleManager> When I debug, the error is "Impossible de charger le type 'MyAdamRoleProvider'"In english : "can't load 'MyAdamRoleProvider' type"I don't see what is wrong, can you help me?

View Complete Post

More Related Resource Links

Large amount of handles of type token using role manager and authorisation manager (azman)

First you'll need some background on the application.  ASP.net application using .net framework 3.5. Security to the application is controlled with impersonation, using a role manager connecting to an azman store which uses Active Directory groups for security. As demoed in the following msdn link ... http://msdn.microsoft.com/en-us/library/ff649313.aspxAfter 50 or so users access the application throughout the day, eventually the application stops responding or users start to experience images not displaying etc and the application pool has to be recycled (typical symptoms of the server running out of memory).  Looking at the application memory usage and available memory on the server this does not appear to be the issue, investigations so far have lead me to think this is to do with Security Token Handles.  I've used process explorer to monitor the asp.net application and handles for the application steadily increase with every page that is accessed and eventually hit 38,000 this is when the application dies.  I've read various links saying that applications should use between 2,000-10,000 handles and any number near 40,000 makes the application unusable (this is the exact behaviour we are experiencing).  Using process explorer and handle.exe from the windows sysinternals site I

http 400 Error when performing item upload after setting custom edit form on content type



What I am trying to do is create custom edit forms for different content types within the same document library.....so basically I have done the following:

  • I have created two site content types and reconfigured my library to use CT's. 
  • I then connected to my site using SPD. 
  • When examining my library I can see that I have the two CT that I added earlier.  I then created a new editform for one the CTs using the top ribbon menu and in the drop down box associated it to the CT.  I did not select this as the default form for the library.
  • I then updated the library CT (not site CT) with the url to form in the editform properties.

When I create a document and edit the properties it works fine - totally as expected.  However when I upload a document the default EditForm for the library is used and I can select the CT to associate the document to.  When I choose the CT with the custom form the new edit form is not found and I get a page not found error - http 400.

The full url for this library is is http://XXXX/functions/ehs/CSI

So the URL I have used is /functions/ehs/CSI/Forms/EditForm2.aspx (EditForm2.aspx) is my form and this is fine.  I have even used CSI/Forms/EditForm2.aspx and this works...  BUT ne

Config Manager gives error "The specified module could not be found. [0x8007007e]"

I've been using SQL Server 2008 Express Edition on my development pc for several months now.  It has recently started giving me an error when I attempt to run the SQL Server Configuration Manager  (SQLServerManager10.msc).  I have uninstalled completely and reinstalled twice which has not solved the problem.  I can run the Management Studio just fine and everything works, I just can't run the Configuration Manager which is an issue.

Full error message is as follows:

Cannot connect to WMI provider.  You do not have permission or the server is unreachable.  Note that you can only manage SQL Server 2005 and later servers with SQL Server Configuration Manager.
The specified module could not be found. [0x8007007e]

I have tried the workaround listed here: https://connect.microsoft.com/SQLServer/feedback/Workaround.aspx?FeedbackID=443459 however I did not have a sqlmgmproviderxpsp2up.mof file in my local install.  I copied the one from my production installation and ran the mofcomp.exe program successfully but it did not solve the issue.

"Duplicate content type name" error when trying to create a site from a custom site template


I am getting "A duplication content type name 'Approval' was found" error, when I try to create a new site based on a custom template.  These are the steps that result in the error:

  1. Create a new blank site.
  2. Without making any changes, save the blank site as a site template called "test".
  3. Try to create a new site based on the "test" template.
  4. Get the above error.

I did notice that when I tried creating site from the template in a different area of my site collection, the error name changed from "Approval" to "Requestor". 

As it stands I cannot use custom templates in my site collection.  Any advice on how to overcome this error?


SSRS -Web.config - Custom error page


There is a requirement to show error page whenever there was an error either while selecting filters or report processing, user would be accessing the reports directly from reportmanager url.


As we know, SSRS is also a asp.net web site with web.config file and customError tag is used to redirect user to a custom error on any error. Following is snippet of code taken out from web.config of asp.net project.


web.config of asp.net project.

      <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">

            <error statusCode="403" redirect="NoAccess.htm" />

Type or namespace error.


A couple of days ago I started getting an unusual behavior when compiling Website projects. I have referenced class libraries added to my bin folder that are also correctely referenced in using statements in my aspx.cs code behind. When I compile, I get the 

Error 4 The type or namespace name 'CommonClassLibrary' could not be found (are you missing a using directive or an assembly reference?) C:\Dev\Fiscal_Portal\Implementation\FMS Portal Site_new\App_Code\BLL\DataTables.cs 1 7 C:\...\FMS Portal Site_new\

The type or namespace name 'CommonClassLibrary' could not be found (are you missing a using directive or an assembly reference?)

error message that would typically be received when the dll has not been added as a reference or added in a using statement.

I can eliminate the error by adding an


Activation error occured while trying to get instance of type Database, key "DBName"


Im using Enterprise library 5.0
I have a scenario, where I have to access two different databases in my application.

Basically this application is a webservice,delployed on my local for testing purpose.
I'm trying to access this web method from diffent windows application, default connection works fine but the other database throw's exception.

Problem is only my defaultDatabase is works fine, if I change defaultDatabase="MYCON1" with "MYCON2" it works fine, if I try to access the other database which is not default, throws exception.

<dataConfiguration defaultDatabase="MYCON1" />
<add name="MYCON1" connectionString="Data Source=server1;Initial Catalog=dbName1;User Id=Username1;Password=password1;"

" />
<add name="MYCON2" connectionString="Data Source=Server2;Initial Catalog=dbName2;User Id=Username2;Password=password2;"
providerName="System.Data.SqlClient" />

Database myDB=EnterpriseLibraryContainer.Current.GetInstance<Database>(); --> works fine for the default database (MYCON1)

Database myDB=EnterpriseLibraryCo

Custom Control Design-Time SiteMap Provider Error


Greetings - I was referred here by MSDN forums hope this is the right place -  

I have a custom control (:WebControl) that renders web.sitemap in a specific way. While it runs error free and produces the expected result, at Design-Time it complains

Error Creating Control - MyControl  The provider 'AspNetXmlSiteMapProvider' specified for the defaultProvider does not exist in the providers collection.

I have discovered that the error is cause by this line of code:

string div = string.Format("<div class='{0}' id='{1}'>{2}</div>", this.CssClass, this.ID.ToString(), EnumerateNodesRecursive(SiteMap.RootNode, level));

or more specifically, by the reference to SiteMap.RootNode - I am not clear what is missing thoough because I have configured the SiteMapProvider in web.config as this:

        <add name="AspNetXmlSiteMapProvider" 
             type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 

"Type ASP.x is not defined" error for dynamic user control when publishing updateable


I have a user control (ContainerCtrl) which programmatically instantiates another user control (SimpleCtrl) in OnLoad. It builds and runs fine, but when I publish it I get the error "error BC30002: Type 'ASP.SimpleCtrl' is not defined." (If I publish without the "updateable" option there's no error, but I need the site to be updateable.)

I assume this has to do with the particulars of how the assembly(ies) are built for the different compiler options. My question is, how can I get it to work properly for "updateable" publishing?

VS 2008 / .NET 3.5 sp1

The code follows (web.config is the default from Visual Studio).

Many thanks, Dave


<%@ Control Language="VB" ClassName="SimpleCtrl" CodeFile="SimpleCtrl.ascx.vb" Inherits="_SimpleCtrl" %>

    Simple control


Partial Class _SimpleCtrl
    Inherits UserControl

    'Nothing to see here.

End Class


<%@ Control Language="VB" CodeFile="ContainerCtrl.ascx.vb" Inherits="_ContainerCtrl"

Custom Control Design view error



I have created a custom control from scratch and it works fine as in you can build the project that uses it and it works fine at runtime. Problem is when you go to design view the control shows an error in the place of where the control should be rendered.

Error: '<SomeValue>' Could not be set to '<SomeProperty>'

This shows up on all my custom set properties. These properties are created as basic as possible. I can give the properties values in Source view and run the app just fine. I can even add a Onclick event. If I don't set any custom properties the control will render fine in Design view. It's only when I set a value to a custom property.

Property Code Example:

public string Text
                string ret = "";
                object obj = ViewState["Text"];
                if (obj != null)
                    ret = obj.ToString();
                return ret;
                ViewState["Text"] = value;

I've even removed the Category and Description tags with no difference.

I don't know if what I said makes sens, but I hope it

Error Handling: Throwing Custom Exception Types from a Managed COM+ Server Application


Exception handling semantics in .NET are based on type, so you can create custom exceptions that have their own properties and methods. In .NET, exceptions are first-class citizens, and since they're the built-in error handling mechanism, all .NET-compliant languages must support exceptions. In addition, COM+ services are available to .NET code as Enterprise Services, so you can leverage exceptions in your Enterprise Services design.In this article the author describes custom exceptions, throwing exceptions across COM interop boundaries, and working with Enterprise Services.

Bob DeRemer

MSDN Magazine March 2004

Authorize It: Use Role-Based Security in Your Middle Tier .NET Apps with Authorization Manager


Authorization Manager in Windows Server 2003 represents a significant improvement in the administration of role-based security, making it more scalable, flexible, and easier to implement. Using Authorization Manager, you can define roles and the tasks those roles can perform. You can nest roles to inherit characteristics from other roles, and you can define application groups. In addition, Authorization Manager lets you use scripts to modify permissions dynamically, and it allows you to wrap your security logic in a security policy that can be stored in Active Directory. Authorization Manager also includes an easy-to-use API for running access checks. The author discusses all of these topics and demonstrates them with a working sample.

Keith Brown

MSDN Magazine November 2003

Parser Error Message: Could not load type MasterPage File



Server Error in '/' Application.

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load type 'wamsilverlight.Web.Wam'.

Source Error:

Line 1:  <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Wam.master.cs" Inherits="wamsilverlight.Web.Wam" %>
Line 2:  
Line 3:  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Source File: /Wam.Master    Line: 1

Version Information: Microsoft .NET Framework Version:2.0.50727.4952; ASP.NET Version:2.0.50727.4927


All of the following have been tried over and over again:

1.) Delete all existing .dlls

2.) Delete MasterPage File and recreate it.

3.) Delete MasterPage perform a c

override error message (The value 'test' is not valid for Age) when input incorrect data type for in


Hello everyone,

I've tried to override error message when input incorrect data type in input field on HTML form. For example I have the model like this.

public class Person
public string FirstName {get;set;}
public int Age {get;set;}


For view, I put text input for Age to get it value.

When type some string in Age text box like 'test' and press submit button. I got this error message

The value 'xxx' is not valid for Age

However, I want to change this message and try many way. There 's nothing effect this message value.

Please could you help me to solve this problem.

All my server-controls became unrecognized!!! like there's compilation error or web.config missing!



please help - the problem is in post subject.

I have lots of warnings with following text:

"Warning 10 Element 'HyperLink' is not a known element. This can occur if there is a compilation error in the Web site, or the web.config file is missing. C:\Users\Pavel\Documents\Visual Studio 2010\WebSites\BioWebSite\ToScientist.aspx 26 18 C:\...\BioWebSite\" 

But web.confg is there! And there's no compilation error!

Site builds just fine. And If I upload it to my hoster - it works!


But with all these errors I cant add controls to pages - VS2010 adds hyperlink without ID, and intelisens stoped to work.

Strange, but in my other project (web-application) I have no such difficuty.

Error converting data type varchar to numeric.


I create a form to record data using ASP.NET and SQL database...
when i run the project show error "Error converting data type varchar to numeric"

what's the problem actually.i try to change in datatype in database..
but still showing error...


Custom tool error: Failed to generate code for the service reference 'CompanyService'. Please che


A little background because I feel I have an out of the ordinary architecture in place and don't know if this is contributing to the problem. 

We have an existing ASP.net application that is undergoing expansion.  The new functionality is all written in Silverlight 4.  As part of that expansion I gutted all the old Linq to SQL and put Entity Framework 4 into place.  To do this I created a standard .net Class Library and added my edmx files there.  Naturally, the business entities created by this cannot be used in Silverlight.  So I created a Silverlight Class Library and added all the business entities to that Silverlight Class Library as linked files.  I changed the name space to be the same.

So I have the following assembly / namespaces

Company.Project.Dal.csproj / Company.Project.Entities (.net 4 class library)

Company.Project.Entities.csproj / Company.Project.Entities (SL4 class library)

With this architecture I was able to share my business entities with my SL enabled web services, my asp.net projects, my silverlight projects.  Really it's a beautiful thing.

Once this was done I added "message" classes to Company.Project.Dal and again shared them with the other entites using linked files.  These messages are things like MyObjectRequest; they are class

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend