2

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?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Evgeniy Kozlov
  • 119
  • 2
  • 10
  • I have edited your title. Please see, "[Should questions include “tags” in their titles?](http://meta.stackexchange.com/questions/19190/)", where the consensus is "no, they should not". – John Saunders May 29 '15 at 16:48

0 Answers0