I am trying to convert an enum to a string. I use C# keyword nameof.
CODE:
Please log in to see this code.
This is working for me in Visual Studio, but not in Wealth-Lab where I get:
Compiler Error CS0103 The name 'nameof' does not exist in the current context
I can't see what I might be doing wrong. Is nameof supported by the compiler? Perhaps there is a reference I need to add?
Thanks
Phil
Size:
Color:
It appears that the Wealth-Lab 6.9 Strategy Editor targets .NET 4.5 and does not support C# 6.0 features such as nameof, auto-property initializers etc. As far as I understand, the Roslyn C# compiler requires .NET 4.6. Perhaps you could arrive at a similar functionality with System.Reflection.
Size:
Color:
Thanks Eugene. I used Enum.GetName(typeof.....
Size:
Color: