I have a const int that is computed at compile time in my Managed C++ DLL. I need to use this value in an attribute within the C# program that calls it. Initially I had created a static method that returns the const int value but C# doesn't see this as a compile time const. I also tried declaring it as a const int within the DLL namespace
// C++
namespace MyNameSpace {
const int AttributeConstValue = 15 + sizeof(int);
. . .
}
Attempts to access MyNameSpace.AttributeConstValue from C# returns "does not exist in namespace MyNameSpace"
Is there a way to pass a const to C# and have it see it as a const expression?