Equivalent of _declspec(dllexport) for a variable in .NET Core?

0

My C# .NET Core 3.0 application needs to export a variable/symbol that will be read by a 3rd-party device driver. (I do not have any ability to modify the driver in question to use a different method of communication.)

In C/C++ I would be able to do this trivially with the following:

extern "C" {
    _declspec(dllexport) DWORD MyVariableName = 0x00000001;
}

How do I do this in .NET Core? I am aware of UnmanagedExports, but it only works when exporting functions, not variables.

c#
.net
.net-core
dllexport
unmanagedexports
asked on Stack Overflow Oct 30, 2019 by Walt D

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0