Xamarin Android runtime C# compilation
问题 I am trying to compile a simple code in C# using Microsoft.CodeAnalysis.CSharp . The problem is in trying to add the reference to mscorlib.dll . As the CreateFromAssembly method of the MetadataReference class is deprecated I am trying to use the CreateFromFile method (as suggested): var mscorlibAssembly = Assembly.Load(new AssemblyName("mscorlib.dll")).ManifestModule.Assembly; var mscorlibref = MetadataReference.CreateFromFile(mscorlibAssembly.Location); result.Add(mscorlibref); The Location