Question: I am developing a rails api to work with angularjs FE app and with several other mobile application. Since I have developed separately, do I need to host separately ? If so then how to manage domains?

Answer: 
Some files are system files (such as the ones in User folder as in your case like AppData etc). you can either request permission or ignore them

```
        FileIOPermission f = new FileIOPermission(PermissionState.Unrestricted);
        f.AllLocalFiles = FileIOPermissionAccess.Read;
        try
        {
            f.Demand();
            //your code for processing files
        }
        catch (SecurityException s)
        {
            //cannot get permissions for files.got exception
            Console.WriteLine(s.Message);
        }

```

i suggest you to take a look at Code Access Security 
<https://msdn.microsoft.com/en-us/library/930b76w0(v=vs.85).aspx>

<https://msdn.microsoft.com/en-us/library/0d005ted(v=vs.90).aspx>
You should be using the enum [Environment.SpecialFolder](https://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx).  

 use `Environment.GetFolderPath(Environment.SpecialFolder.MyMusic )` for music folder or `Environment.GetFolderPath(Environment.SpecialFolder.UserProfile ) + @"\Downloads";` etc specifically.This is because ideally you won't get access to all folders and sub folders in the Windows explorer itself in the user folders. That is where it throws the exception.  

so your code would be something like this 

```
        string[] directories;
        string[] Files;
        string folder = Environment.GetFolderPath(Environment.SpecialFolder.MyMusic ) ;
        directories = Directory.GetDirectories(folder);

```