C# UnmanagedExport dll不创建导出表

C# UnmanagedExport dll不创建导出表,c#,.net,dll,C#,.net,Dll,我一直在尝试用C风格的API(导出表)创建一个C#dll。我编写了最简单的代码: using System; using System.Runtime.InteropServices; using RGiesecke.DllExport; namespace CS_Post { public class Class1 { [DllExport("ABC", CallingConvention.Cdecl)] public void test()

我一直在尝试用C风格的API(导出表)创建一个C#dll。我编写了最简单的代码:

using System;
using System.Runtime.InteropServices;
using RGiesecke.DllExport;

namespace CS_Post
{
    public class Class1
    {
        [DllExport("ABC", CallingConvention.Cdecl)]
        public void test()
        {
            Console.WriteLine("hehe");
        }
    }
}
当我转储此dll时,我得到:

E:\Projects\CS_Post\bin\Release>dumpbin \exports CS_Post.dll
Microsoft (R) COFF/PE Dumper Version 14.00.24213.1
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file CS_Post.dll

File Type: DLL

  Summary

        2000 .reloc
        2000 .rsrc
        2000 .text
此外,它只在.NET3.5上运行,任何更高版本似乎都找不到
ildasm.exe

Microsoft.Build.Utilities.ToolLocationHelper could not find ildasm.exe
我甚至找不到此UnmanagedExports的任何工作示例。

有人能帮我完成吗?现在我只想导出一个函数/

问题是-您不能在项目构建中设置混合平台。它必须是x64或x86。即使是最新的.NET也可以正常工作。

问题是-您不能在项目构建中设置混合平台。它必须是x64或x86。即使是最新的.NET也可以正常工作