I am using Visual Studio 2020 (v143). To test exporting a DLL file from a C++ project and importing it in a C# project, I just made a simple DLL file from this code in C++:
extern "C"
{
__declspec (dllexport)
int Function() { return 0;}
}
Compiled in Debug mode for x64 platform, the output DLL file is created.
In a C# project when I try to Add -> Project References... the DLL file, I got this error in a poped up window.
The reference is invalid or unsupported
C++ compiler uses ISO C++14 Standard and the Target Framework of C# was .NET 6
I remember years back when I had used VS 2015 with C++11 and .NET 4.0, I did not face such an error.
What should I do to address this issue?
Thanks.