title: Targeting UWP with csc.exe
body: <p>I'm trying to get IKVM working for Windows 10 UWP targets. I'm running into problems with the code I'm compiling with csc.exe.  If I target .Net 4.0 or higher, then I get runtime errors like:</p>
  
  <p><code>Method not found: 'Boolean System.Reflection.Assembly.op_Equality(System.Reflection.Assembly, System.Reflection.Assembly)'.</code></p>
  
  <p>Because the '==' operator overload was supported in 4.0 or higher, but apparently some of the assemblies in UWP don't support this. </p>
  
  <p>If I, instead, target .Net &lt; 4.0 (e.g. 2.0 or 3.5), I get errors like:</p>
  
  <p><code>Attempt by method 'IKVM.Internal.AssemblyClassLoader+AssemblyLoader..ctor(System.Reflection.Assembly)' to access method 'System.Reflection.Assembly.GetModules(Boolean)'</code></p>
  
  <p>I think that this is to do with .net security not allowing me to access reflection from "secure" assemblies from my "insecure" assemblies.... and my assemblies are deemed "insecure" because they are compiled for 2.0/3.5 which predates the security model in play here.</p>
  
  <p><strong>Question:</strong></p>
  
  <p>How do I compile my C# files to target exactly the version of .Net that is used in UWP apps?  (The build is taking place through a Nant build file via the <code>&lt;csc&gt;</code> tag).</p>
  
  <p>Thanks for any pointers.</p>
  
  <p><strong>UPDATE</strong>:</p>
  
  <p>I have found one way to target UWP's .Net libraries, and that is to make Visual Studio projects for each of the IKVM runtime projects - and build using that instead of Nant.  I would still like to find a way to use the existing Nant build files, but so far it doesn't look like Nant supports building for UWP.</p>