Cannot export a function in C# DLL using unmanagedexports

382 Views Asked by At

I am trying to create a DLL using C#. In order to export my function, I am using UnmanagedExports.

My Application has an output type of Class Library, and the Platform target is set to x86. Here is my code:

using RGiesecke.DllExport;
using System;

class Test
{
    [DllExport("add")]
    public static int TestExport(int left, int right)
    { 
        return left + right;
    }
}

I build and get my DLL. When I run dumpbin /exports Test.dll using the visual studio command prompt, I don't see any functions being exported. Is there something I am missing to this?

0

There are 0 best solutions below