I have a WCF service with the code:
var ctx = new PrincipalContext(IsLocalMachine(strDomain) ? ContextType.Machine : ContextType.Domain);
Principal principal = Principal.FindByIdentity(ctx, name)
I have 3 different test environments:
1: IIS 8.5 .NET v4.5 application pool, Win 8.1, strDomain = "testdomen1"
name = "testdomen1\testuser"
- the environment does not have errors.
2: IIS 7.5 .NET v4.5 application pool, Win Server 2008 r2, strDomain = "testdomen1", name = "testdomen1\testuser"
- - the environment does not have errors.
3: IIS 8.5 .NET v4.5 application pool, Win 8, strDomain = "testdomen2"
name = "testdomen2\testuser2"
- the environment has errors.
on the line
Principal principal = Principal.FindByIdentity(ctx, name)
argument exception
Value was invalid.
Parameter name: sddlForm
StackTrace
at System.Security.Principal.SecurityIdentifier..ctor(String sddlForm)
If I use Debug>BreakPoint for this line and "Add Watch" or "Quick Watch", I get a result. But after pressing F10, I got the error.
What could be the reason?