Visual Studio 2015 Update 3, .Net 4.7.1. Referencing: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.1\Microsoft.CSharp.dll
CompilerParameters looks like:
_parameters.GenerateInMemory = true;
_parameters.GenerateExecutable = false;
_parameters.CompilerOptions = "/optimize";
_parameters.ReferencedAssemblies.Add("System.dll");
_parameters.ReferencedAssemblies.Add("System.ServiceModel.dll");
Trying to compile a snippet that looks like this:
SomeMethod(someClass.Exception.ToString());
This works fine.
However, when I try to compile:
SomeMethod(someClass.Exception?.ToString());
With the question mark added, I get compiler errors saying invalid expression term '.'. Is the ?. not supported? Or do I need to set some other option somewhere?