Roslyn - compiling simple class: “The type or namespace name 'string' could not be found…”
问题 I'm using the Roslyn API to generate and compile a class. The generated class looks like this: namespace MyCompany.Product { public class TestClass { public void Configure(string id) { } } } However, when i come to compile it, the Emit(ted) result gives: error CS0246: The type or namespace name 'string' could not be found (are you missing a using directive or an assembly reference?) Here is the method which performs the compile: private static readonly IEnumerable<string> DefaultNamespaces =