I'm trying to compile a class from text at runtime. My problem is that my class uses a valueTupe in a function (AllLines), and I receive an error "C:\xxxx.cs(19,28): error CS0570: 'BaseClass.AllLines' is not supported by the language" when using this code
CodeDomProvider objCodeCompiler = new Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider();
CompilerParameters objCompilerParameters = new CompilerParameters();
objCompilerParameters.ReferencedAssemblies.Add("mscorlib.dll");
objCompilerParameters.ReferencedAssemblies.Add("System.IO.dll");
objCompilerParameters.ReferencedAssemblies.Add("System.Linq.dll");
CompilerResults objCompileResults = objCodeCompiler.CompileAssemblyFromFile(objCompilerParameters, filename);
EDIT:
The Textfile looks as follows :
using System;
using System.Collections.Generic;
using System.Linq;
namespace MyNamespace
{
public abstract class BaseClass
{
public List<(int LineNumber, string Value)> AllLines
{
...
}
}
}
I'm using Microsoft.CodeDom.Providers.DotNetCompilerPlatform v2.0.0.0, Microsoft (R) Visual C# Compiler version 1.0.0.50618
Unsure if that is the actual version of roslyn.