title: C# Unmanaged Export not working
body: <p>I am trying to get the <a href="https://sites.google.com/site/robertgiesecke/Home/uploads/unmanagedexports" rel="noreferrer">Unmanaged Export</a> Basic sample working.</p>
  
  <p>The steps I am following:</p>
  
  <ul>
  <li>Create a new classlibrary project.   </li>
  <li>Add the UnmanagedExports with
  nuget.   </li>
  <li>Change CPU target to x86.    </li>
  <li>Add the code from the tutorial I am following to the .cs file.</li>
  <li>Build</li>
  </ul>
  
  <p>The project is built sucesfully, but when I inspect my dll with <a href="http://www.nirsoft.net/utils/dll_export_viewer.html" rel="noreferrer">DLL Export Viewer</a> I can not see any of my functions.</p>
  
  <p>I am using 32 bits OS and SharpDevelop 4.4 (I also have tried with other SharpDevelop versions and with 64bits OS with the same result).</p>
  
  <p>My sln file:</p>
  
  <pre><code>Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "test", "test\test.csproj", "{AFAA816C-65B2-4B58-9FB2-EB7482AA0F5F}"
      EndProject
      Global
          GlobalSection(SolutionConfigurationPlatforms) = preSolution
              Debug|x86 = Debug|x86
              Release|x86 = Release|x86
          EndGlobalSection
          GlobalSection(ProjectConfigurationPlatforms) = postSolution
              {AFAA816C-65B2-4B58-9FB2-EB7482AA0F5F}.Debug|x86.ActiveCfg = Debug|x86
              {AFAA816C-65B2-4B58-9FB2-EB7482AA0F5F}.Debug|x86.Build.0 = Debug|x86
              {AFAA816C-65B2-4B58-9FB2-EB7482AA0F5F}.Release|x86.ActiveCfg = Release|x86
              {AFAA816C-65B2-4B58-9FB2-EB7482AA0F5F}.Release|x86.Build.0 = Release|x86
          EndGlobalSection
      EndGlobal
  </code></pre>
  
  <p>My csproj file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build"&gt;
    &lt;PropertyGroup&gt;
      &lt;ProjectGuid&gt;{AFAA816C-65B2-4B58-9FB2-EB7482AA0F5F}&lt;/ProjectGuid&gt;
      &lt;ProjectTypeGuids&gt;{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}&lt;/ProjectTypeGuids&gt;
      &lt;Configuration Condition=" '$(Configuration)' == '' "&gt;Debug&lt;/Configuration&gt;
      &lt;Platform Condition=" '$(Platform)' == '' "&gt;x86&lt;/Platform&gt;
      &lt;OutputType&gt;Library&lt;/OutputType&gt;
      &lt;RootNamespace&gt;test&lt;/RootNamespace&gt;
      &lt;AssemblyName&gt;test&lt;/AssemblyName&gt;
      &lt;TargetFrameworkVersion&gt;v2.0&lt;/TargetFrameworkVersion&gt;
      &lt;AppDesignerFolder&gt;Properties&lt;/AppDesignerFolder&gt;
      &lt;TargetFrameworkProfile /&gt;
    &lt;/PropertyGroup&gt;
    &lt;PropertyGroup Condition=" '$(Platform)' == 'x86' "&gt;
      &lt;PlatformTarget&gt;x86&lt;/PlatformTarget&gt;
    &lt;/PropertyGroup&gt;
    &lt;PropertyGroup Condition=" '$(Configuration)' == 'Debug' "&gt;
      &lt;OutputPath&gt;bin\Debug\&lt;/OutputPath&gt;
      &lt;DebugSymbols&gt;True&lt;/DebugSymbols&gt;
      &lt;DebugType&gt;Full&lt;/DebugType&gt;
      &lt;Optimize&gt;False&lt;/Optimize&gt;
      &lt;CheckForOverflowUnderflow&gt;True&lt;/CheckForOverflowUnderflow&gt;
      &lt;DefineConstants&gt;DEBUG;TRACE&lt;/DefineConstants&gt;
    &lt;/PropertyGroup&gt;
    &lt;PropertyGroup Condition=" '$(Configuration)' == 'Release' "&gt;
      &lt;OutputPath&gt;bin\Release\&lt;/OutputPath&gt;
      &lt;DebugSymbols&gt;False&lt;/DebugSymbols&gt;
      &lt;DebugType&gt;None&lt;/DebugType&gt;
      &lt;Optimize&gt;True&lt;/Optimize&gt;
      &lt;CheckForOverflowUnderflow&gt;False&lt;/CheckForOverflowUnderflow&gt;
      &lt;DefineConstants&gt;TRACE&lt;/DefineConstants&gt;
    &lt;/PropertyGroup&gt;
    &lt;ItemGroup&gt;
      &lt;Reference Include="RGiesecke.DllExport.Metadata"&gt;
        &lt;HintPath&gt;..\packages\UnmanagedExports.1.2.7\lib\net\RGiesecke.DllExport.Metadata.dll&lt;/HintPath&gt;
      &lt;/Reference&gt;
      &lt;Reference Include="System" /&gt;
      &lt;Reference Include="System.Xml" /&gt;
    &lt;/ItemGroup&gt;
    &lt;ItemGroup&gt;
      &lt;Compile Include="MyClass.cs" /&gt;
      &lt;Compile Include="Properties\AssemblyInfo.cs" /&gt;
    &lt;/ItemGroup&gt;
    &lt;ItemGroup&gt;
      &lt;None Include="packages.config" /&gt;
    &lt;/ItemGroup&gt;
    &lt;Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /&gt;
  &lt;/Project&gt;
  </code></pre>
  
  <p>My cs file:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Text;
  using RGiesecke.DllExport;
  using System.Runtime.InteropServices;
  
  namespace Testme
  {
      class Test
      {
          [DllExport("Add", CallingConvention = CallingConvention.StdCall)]
          public static int Add(int left, int right)
          {
              return left + right;
          }
  ........
  </code></pre>
  
  <p>Dll Export Viewer of my dll
  <a href="https://i.stack.imgur.com/ycbff.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ycbff.png" alt="DLL export viewer of my dll"></a></p>
  
  <p>Dll Export Viewer of a working dll (downloaded from the tutorial web)
  <a href="https://i.stack.imgur.com/nv1Ta.png" rel="noreferrer"><img src="https://i.stack.imgur.com/nv1Ta.png" alt="Dll Export Viewer of a working dll (downloaded from the tutorial web)"></a></p>
  
  <p>Both dlls (mine and the downloaded) have the same size for my OS but not for the DLL Export Viewer.</p>
  
  <p>What I am missing??</p>