I have a C# library I am exporting as an extension for a C++ program. I am using the unmanagedexports package to export the functions.
Question Update:
So initially I thought I needed a .def file to accompany my C# dll when it was being imported by the C++ application however after Martheen's comment it seems my dll has no exported functions at all. I am assuming this after the tools MakeDef and DLL Export Viewer both showed the dll as having no exports.
Code I am using is below:
using System;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using RGiesecke.DllExport;
namespace TestExtension
{
public class TestClass
{
public static AppDomain TestDomain;
[DllExport("TestFunc")]
public static void TestFunc(ExtensionClient client, [MarshalAs(UnmanagedType.LPStr)] string args)
{
client.Print("TestOutput");
}
}
}
The rest of the original question:
The program I am loading them into says it needs a .def file in the documentation. I understand this file is created by C++ programs and documents the exported functionality of a dll. My C# project creates a .pdb file which I understand does a similar thing however it's not in a human readable format and just changing the extension to .def didn't seem to work.
So my question is can I create a .def file for my C# dll or is there another suitable workaround/solution to this problem?