I encounter a problem to assign access rights to "Everyone" on a directory folder "wwwroot" on windows from my little programm in C#. Here's how I do it.
//I also try with 'S-1-1-0'/'Everyone' but it's the same result
string userPermission = "Everyone" ;
DirectoryInfo myDirRoot = new DirectoryInfo(myArmsUpdate.InstallationPath);
DirectorySecurity myDirectorySecurity = myDirRoot.GetAccessControl();
FileSystemAccessRule myPermission = new FileSystemAccessRule(userPermission , FileSystemRights.ReadAndExecute, InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit, PropagationFlags.InheritOnly, AccessControlType.Allow);
myDirectorySecurity.AddAccessRule(myPermission);
myDirRoot.SetAccessControl(myDirectorySecurity);
However I still get the same error:
System.Security.Principal.IdentityNotMappedException