title: Set write permissions for all users for my program folder
body: <p>I have build a program in Visual Studio. The program creates a logfile and writes into it while the program is running. Therefore I constructed an installer (setup-project), that should set write permissions for my program-folder regardless which user works with the program.
  currently it looks like this:</p>
  
  <pre><code>// ...
  }
    InitializeComponent();
  
    string folder = Directory.GetCurrentDirectory();
  
    DirectorySecurity ds = Directory.GetAccessControl(folder);
    ds.AddAccessRule(new FileSystemAccessRule("Everyone",   //Everyone is important
                                                    //because rights for all users!
     FileSystemRights.Read | FileSystemRights.Write, AccessControlType.Allow));
  }
  // ...
  </code></pre>
  
  <p>In the last two rows I get a <code>System.SystemException</code>: “Die Vertrauensstellung zwischen der primären Domäne und der vertrauenswürdigen Domäne konnte nicht hergestellt werden.“</p>
  
  <p>[Translation: "The trust relationship between the primary domain and the trusted domain could not be established."]</p>
  
  <p>The stacktrace reads like this:</p>
  
  <pre><code>bei System.Security.Principal.NTAccount.TranslateToSids(IdentityReferenceCollection sourceAccounts, Boolean&amp; someFailed)
  bei System.Security.Principal.NTAccount.Translate(IdentityReferenceCollection sourceAccounts, Type targetType, Boolean&amp; someFailed)
  bei System.Security.Principal.NTAccount.Translate(IdentityReferenceCollection sourceAccounts, Type targetType, Boolean forceSuccess)
  bei System.Security.Principal.NTAccount.Translate(Type targetType)
  bei System.Security.AccessControl.CommonObjectSecurity.ModifyAccess(AccessControlModification modification, AccessRule rule, Boolean&amp; modified)
  bei System.Security.AccessControl.CommonObjectSecurity.AddAccessRule(AccessRule rule)
  bei System.Security.AccessControl.FileSystemSecurity.AddAccessRule(FileSystemAccessRule rule)
  </code></pre>
  
  <p>Have you an idea what I can do?
  thanks</p>