title: Basic C# GUI crashes in main
body: <p>I have a very basic unmanaged C++ project, C++/CLI wrapper and C# GUI. I've built all 3 projects as x64. I try and run the C# project and I get the following exception:</p>
  
  <blockquote>
    <p>First-chance exception at 0x000007fefd84cacd in TestAppGUI.exe:
    Microsoft C++ exception: EEFileLoadException * __ptr64 at memory
    location 0x0057b498.</p>
  </blockquote>
  
  <p>Does anyone know what could be causing the issue?</p>
  
  <p>These are my classes:</p>
  
  <p>Test.h (unmanaged code)</p>
  
  <pre><code>#define DllExport   __declspec( dllexport )
  
  #include &lt;iostream&gt;
  
  namespace Test
  {
      class DllExport BasicTest
      {
      public:
          BasicTest();
          ~BasicTest();
      };
  }
  </code></pre>
  
  <p>Test.cpp</p>
  
  <pre><code>#include "Test.h"
  
  Test::BasicTest::BasicTest()
  {
  
  }
  
  Test::BasicTest::~BasicTest()
  {
  
  }
  </code></pre>
  
  <p>TestCLR.h (wrapper)</p>
  
  <pre><code>// TestCLR.h
  
  #pragma once
  
  #include "../TestApp/Test.h"
  
  using namespace System;
  using namespace Test;
  
  namespace TestCLR {
  
      public ref class Class1
      {
          // TODO: Add your methods for this class here.
      public:
          Class1();
  
      private:
          BasicTest *bsTest;
      };
  }
  </code></pre>
  
  <p>TestCLR.cpp</p>
  
  <pre><code>// This is the main DLL file.
  
  #include "stdafx.h"
  
  #include "TestCLR.h"
  
  TestCLR::Class1::Class1()
  {
      bsTest = new BasicTest();
  }
  </code></pre>
  
  <p>TestAppGUI Form1.cs</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Windows.Forms;
  using TestCLR;
  
  namespace TestAppGUI
  {
      public partial class Form1 : Form
      {
          Class1 obj = new Class1();
  
          public Form1()
          {
              InitializeComponent();
          }
      }
  }
  </code></pre>