Click here to Skip to main content
15,903,362 members
Home / Discussions / C#
   

C#

 
AnswerRe: Source file with repetitive data Pin
Richard MacCutchan2-Nov-12 6:29
mveRichard MacCutchan2-Nov-12 6:29 
GeneralRe: Source file with repetitive data Pin
C-P-User-35-Nov-12 8:00
C-P-User-35-Nov-12 8:00 
GeneralRe: Source file with repetitive data Pin
Richard MacCutchan5-Nov-12 22:02
mveRichard MacCutchan5-Nov-12 22:02 
GeneralRe: Source file with repetitive data Pin
C-P-User-36-Nov-12 6:02
C-P-User-36-Nov-12 6:02 
GeneralRe: Source file with repetitive data Pin
Richard MacCutchan6-Nov-12 6:32
mveRichard MacCutchan6-Nov-12 6:32 
GeneralRe: Source file with repetitive data Pin
C-P-User-36-Nov-12 10:00
C-P-User-36-Nov-12 10:00 
SuggestionRe: Source file with repetitive data Pin
dybs4-Nov-12 17:13
dybs4-Nov-12 17:13 
GeneralRe: Source file with repetitive data Pin
C-P-User-35-Nov-12 4:50
C-P-User-35-Nov-12 4:50 
QuestionHow to get current background color info from a form Pin
MichCl2-Nov-12 5:02
MichCl2-Nov-12 5:02 
AnswerRe: How to get current background color info from a form Pin
Eddy Vluggen2-Nov-12 5:32
professionalEddy Vluggen2-Nov-12 5:32 
GeneralRe: How to get current background color info from a form Pin
MichCl2-Nov-12 7:53
MichCl2-Nov-12 7:53 
GeneralRe: How to get current background color info from a form Pin
Eddy Vluggen2-Nov-12 8:00
professionalEddy Vluggen2-Nov-12 8:00 
GeneralRe: How to get current background color info from a form Pin
MichCl2-Nov-12 8:06
MichCl2-Nov-12 8:06 
QuestionRe: How to get current background color info from a form Pin
Eddy Vluggen2-Nov-12 9:09
professionalEddy Vluggen2-Nov-12 9:09 
GeneralRe: How to get current background color info from a form Pin
Alan N2-Nov-12 10:00
Alan N2-Nov-12 10:00 
AnswerRe: How to get current background color info from a form Pin
Ravi Bhavnani2-Nov-12 9:34
professionalRavi Bhavnani2-Nov-12 9:34 
QuestionActive Directory UserPrincipal Extension not working Pin
rcgneo1-Nov-12 22:44
rcgneo1-Nov-12 22:44 
AnswerRe: Active Directory UserPrincipal Extension not working Pin
Eddy Vluggen2-Nov-12 0:50
professionalEddy Vluggen2-Nov-12 0:50 
GeneralRe: Active Directory UserPrincipal Extension not working Pin
rcgneo2-Nov-12 5:48
rcgneo2-Nov-12 5:48 
It seems that it complains about the Extension class not having the right constructor. But I do have it. Please see the original post and you will see the constructor that the exception is saying I don't have.

Here is the entire trace:

2012-11-02 10:24:41,921 [10] DEBUG App.Classes.Utils.MyHelper - DoesUserExist: Exception: System.NotSupportedException: Extension class must define a constructor that accepts a PrincipalContext argument.
at System.DirectoryServices.AccountManagement.Principal.MakePrincipal(PrincipalContext ctx, Type principalType)
at System.DirectoryServices.AccountManagement.SDSUtils.SearchResultToPrincipal(SearchResult sr, PrincipalContext owningContext, Type principalType)
at System.DirectoryServices.AccountManagement.ADStoreCtx.GetAsPrincipal(Object storeObject, Object discriminant)
at System.DirectoryServices.AccountManagement.ADStoreCtx.FindPrincipalByIdentRefHelper(Type principalType, String urnScheme, String urnValue, DateTime referenceDate, Boolean useSidHistory)
at System.DirectoryServices.AccountManagement.ADStoreCtx.FindPrincipalByIdentRef(Type principalType, String urnScheme, String urnValue, DateTime referenceDate)
at System.DirectoryServices.AccountManagement.Principal.FindByIdentityWithTypeHelper(PrincipalContext context, Type principalType, Nullable`1 identityType, String identityValue, DateTime refDate)
at System.DirectoryServices.AccountManagement.Principal.FindByIdentityWithType(PrincipalContext context, Type principalType, String identityValue)
at App.Classes.Utils.UserPrincipalExtension.FindByIdentity(PrincipalContext context, String identityValue) in C:\visual studio 2010\Projects\App\Classes\Utils\UserPrincipalExtension.cs:line 61
at App.Classes.Utils.MyHelper.DoesUserExist(String usr) in C:\visual studio 2010\Projects\App\Classes\Utils\MyHelper.cs:line 70

Code where exception happened(Line 61 in the Extention class):

C#
// Implement the overloaded search method FindByIdentity
public static new UserPrincipalExtension FindByIdentity(PrincipalContext context,
                                               string identityValue)
{
    return (UserPrincipalExtension)FindByIdentityWithType(context,
                                                 typeof(UserPrincipalExtension),
                                                 identityValue);
}


Problem happens in the return line of that code.
GeneralRe: Active Directory UserPrincipal Extension not working Pin
Eddy Vluggen2-Nov-12 6:56
professionalEddy Vluggen2-Nov-12 6:56 
GeneralRe: Active Directory UserPrincipal Extension not working Pin
rcgneo2-Nov-12 9:35
rcgneo2-Nov-12 9:35 
GeneralRe: Active Directory UserPrincipal Extension not working Pin
Eddy Vluggen2-Nov-12 9:57
professionalEddy Vluggen2-Nov-12 9:57 
QuestionProtected Interface Members Pin
Ambika Jadhav1-Nov-12 20:22
Ambika Jadhav1-Nov-12 20:22 
AnswerRe: Protected Interface Members Pin
Richard MacCutchan2-Nov-12 0:46
mveRichard MacCutchan2-Nov-12 0:46 
AnswerRe: Protected Interface Members Pin
Abhinav S2-Nov-12 0:49
Abhinav S2-Nov-12 0:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.