在 C# 中创建导出函数并使用 csc.exe 进行编译

问题描述

我有一个用 C# 编写的简单 hello world。

plotSex(getSex(GRset,cutoff = -2))

我可以使用:

using System;

public class Program
{
    public static void test()
    {
        Console.WriteLine("Hello from Atomic Red Team! \n Press Enter To Close.");
        Console.ReadLine();
    }
}

我想让 test() 函数成为一个导出函数,以便我可以使用 rundll32.exe。 例如:

Csc.exe /target:library /out:test.dll test.cs

我会尝试添加 [DllExport(ExportAs = "test")] 但它不会编译.. 唯一的要求是我可以用 csc.exe 编译它

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)