title: How to add built-in assembly from .Net Core to a C# project in VS Code
body: <p>How to add .Net Core built-in assembly, say, System.Windows.Forms, to a C# project in VS Code?</p>
  
  <p>This can easily be done in Visual Studio by using the Reference Manager. However, I got stuck with VS Code. There is tutorial on how to add assembly from NuGet Package but I couldn't find one about adding .Net Core assembly.</p>
  
  <p>Updated:
  I tried what Nsevens said to have the following reference.</p>
  
  <pre><code>&lt;ItemGroup&gt;
       &lt;Reference Include="System.Windows.Forms"&gt;
        &lt;HintPath&gt;thePath\System.Windows.Forms.dll&lt;/HintPath&gt;
       &lt;/Reference&gt;
  &lt;/ItemGroup&gt;
  </code></pre>
  
  <p>There was no problem found in editor and it could be compiled successfully.</p>
  
  <p>But, In debug mode the program vanishes immediately after starting debugging. Debug console says</p>
  
  <p>The program '[(some number)] MyProgram.dll' has exited with code 0 (0x0).</p>
  
  <p>If the exe is run directly, it fails and the console says</p>
  
  <p>Could not load file or assembly 'System.Windows.Forms, Version=4.0.0.0'. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (0x80131058)</p>
  
  <p>Unhandled exception. System.BadImageFormatException: Could not load file or assembly 'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Reference assemblies should not be loaded for execution.  They can only be loaded in the Reflection-only loader context. (0x80131058)
  File name: 'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' ---> System.BadImageFormatException: Cannot load a reference assembly for execution.
     at MyProgram.Program.Main(String[] args)</p>