title: C# - Get all 'usings' of an assembly
body: <p>i wrote a Plugin system and the Plugin Host need to know which 'usings' each module has.</p>
  
  <p>The main idea is limit what the plugin can use in the code, to evaluate it's security level.
  Exemple: the plugins can't manipulate Disk or Networking, then i'm thinking in limit by 'usings' or loaded dlls.</p>
  
  <p>I seached how to get the 'Loaded Modules' of plugin, but i don't found the reference of System.IO or any dll that could help.</p>
  
  <p>Then i look into assembly.Get***() (modules/fields/...)</p>
  
  <p>maybe an axemple could help: Plugin 'A'
  EntryPoint.cs</p>
  
  <pre><code>using System.Collections.Generic; &lt;--- is allowed
  using System.IO;  &lt;--- it is not allowed
  using System.Net;  &lt;--- it is not allowed
  .... Declare a namsespace, classes and other... AND i used a streamwriter
  </code></pre>
  
  <p>i need to know if the plugin is using System.Net, or other prohibited reference.</p>
  
  <p>Thanks (a lot for ALL possibilities)</p>
  
  <p>Edit: 
  1) Assembly.GetReferencedAssemblies don't work, some DLLs has Allowed and Prohibeted references</p>
  
  <p>2) The Disk/Network access could be done using some 'help libraries' that manages this access.</p>
  
  <p>3) for Sandbox solution: i saw this, but the major question is that i have something like a virtual disk, and when user ask to list a directory, this operation will ask a server 'what files this user has in this folder?' then this server will collect all files in a database and return this list. When a file must be readed/writed this modifications need to sync. with all other computers that can read this file. A Network operation is a specific to a range of 'virtual parteners' but without a complete VPN solution.</p>