title: Build C++ plugin for Unity
body: <p>Trying to create my first plugin.
  The cpp code is:</p>
  
  <p>header:</p>
  
  <pre><code>#pragma once
  #ifndef __MY_DLL_H
  #define __MY_DLL_H
  
  extern "C" int add_1(int number);
  
  #endif
  </code></pre>
  
  <p>source:</p>
  
  <pre><code>//FirstDLL.cpp
  #include "FirstDLL.h"
  
  extern "C" int add_1(int number) {
      return number + 1;
  }
  </code></pre>
  
  <p>Then I compile and put the DLL in <code>Assets/Plugins</code> folder, the dll file is <code>FirstDLL.dll</code>. From the unity side I have a simple C# script for a component:</p>
  
  <pre><code>using UnityEngine;
  
  public class MyBehaviour : MonoBehaviour {
  
      // Use this for initialization
      [Header("Nuts!")]
      public int my_curr_val;
      void Start () {
  
      }
  
      // Update is called once per frame
      void Update () {
          print(add_1(my_curr_val));
      }
  
      [DllImport("FirstDLL")]
      public static extern int add_1(int number);
  }
  </code></pre>
  
  <p>But when I try to run the script I get the following error:</p>
  
  <blockquote>
    <p>Plugins: Failed to load 'Assets/Plugins/FirstDLL.dll' with error
    'This operation is only valid in the context of an app container.
        '.
        Plugins: Failed to load 'Assets/Plugins/FirstDLL.dll' with error 'This operation is only valid in the context of an app container.
        '.
        DllNotFoundException: FirstDLL
        MyBehaviour.Update () (at Assets/MyBehaviour.cs:17)</p>
  </blockquote>
  
  <p>The documentation seems to be quite poor, any suggestions?
  There's <a href="https://answers.unity.com/questions/1193242/loading-windows-10-dll-this-operation-is-only-vali.html" rel="noreferrer">this answer</a>, but not sure what I'm doing wrong. I've tried to create several solution (windows universal platform, windows 8.1, etc) still doesn't work.</p>