Im trying to add ASP .NET membership security to my Silverlight + WCF application but i keep getting the following exception intermittently:
at System.Security.Permissions.PrincipalPermission.ThrowSecurityException() at System.Security.Permissions.PrincipalPermission.Demand() at System.Security.PermissionSet.DemandNonCAS() at Hp.Esf.Service.EsfService.GetAllUsers() in C:\HP\Trunk with failing Authentication\trunk\Hp.Esf.Service\EsfService.cs:line 227 at SyncInvokeGetAllUsers(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
If I use [InstanceContextMode = InstanceContextMode.PerCall)] everything works as expected but if I change it to InstanceContextMode = InstanceContextMode.Single)] that exception keeps appearing intermittently (Or at least I havent found a pattern of why this is happening)
Does anybody has any idea of why this could be happening?