Would the following statement work for your? The string below should be in a format like this "FullyQualifiedName, AssembleName"
Type type = Type.GetType("System.IO.Directory, System.IO.FileSystem");
MetadataReference[] references =
{
MetadataReference.CreateFromFile(path:
type.Assembly.Location)
}
The assembly-qualified name of the type to get. See AssemblyQualifiedName. If the type is in the currently executing assembly or in Mscorlib.dll, it is sufficient to supply the type name qualified by its namespace.
Word to the wise, these solutions always require some type of reflection, and while it is a tool as good as any, too much of it can cause performance issues.