I have a simple code that I am trying to compile on the fly:
namespace A
{
class Test
{
public static void Test()
{
int.TryParse("12", out int result);
}
}
}
I usually use CSharpCodeProvideror CodeDomProvider. Unfortunately, when switching to C # 6 / C # 7, the following error occurs:
bug CS1644: the expression expression function cannot be used because it is not part of the C # 6.0 language specification
Of course, all of the code contains C # 7 functions, and they compile just fine using msbuild / xbuild.
I understand the error, but I do not know if there is another way to compile this code?
An important note - I run it in Mono, but I have no way to try .Net right now. This may be a problem with mono, but it seems to be common.