The following always fails in my Visual Studio (2008 SP1) unit tests:[TestClass]public static class TestInfo{ [AssemblyInitialize] public static void InitializeTesting( TestContext testContext ) { AppDomain.CurrentDomain.SetPrincipalPolicy( System.Security.Principal.PrincipalPolicy.WindowsPrincipal ); Assert.IsInstanceOfType( System.Threading.Thread.CurrentPrincipal, typeof( System.Security.Principal.WindowsPrincipal ) ); }}According to the documentation at http://msdn.microsoft.com/en-us/library/system.appdomain.setprincipalpolicy.aspx:----------------------------Setting this value will only be effective if you set it before using the Thread.CurrentPrincipal property. For example, if you set Thread.CurrentPrincipal to a given principal (for example, a generic principal) and then use the SetPrincipalPolicy method to set the PrincipalPolicy to WindowsPrincipal, the current principal will remain the generic principal.----------------------------So it sounds like somewhere the test manager environment is accessing the Thread.CurrentPrincipal and thus preventing unit tests from modifying the Principal.
Version