some or all identity references could not be translated
C#
1
Posts
1
Posters
0
Views
1
Watching
-
I want to add directory security to certain folders on my system, the code is NTAccount identity = new NTAccount(Account); SecurityIdentifier sid = (SecurityIdentifier)identity.Translate(typeof(SecurityIdentifier)); DirectoryInfo dInfo = new DirectoryInfo(Dir); DirectorySecurity dSecurity = dInfo.GetAccessControl(AccessControlSections.Access); dSecurity.AddAccessRule(new FileSystemAccessRule(sid , Rights, ControlType)); dInfo.SetAccessControl(dSecurity); but i keep getting this error: some or all identity references could not be translated