Reputation: 433
I recently updated my project to Roslyn 1.0, and can't find MetadataFileReference class anywhere.
references: new[] { new MetadataFileReference(typeof(object).Assembly.Location) }
Error CS0122 'MetadataFileReference' is inaccessible due to its protection level
What can I use instead?
Upvotes: 9
Views: 2265
Reputation: 3252
MetadataReference.CreateFromAssembly is obsolete
You should use CreateFromFile instead
references: new[] { MetadataReference.CreateFromFile(typeof(object).Assembly.Location) }
Upvotes: 9
Reputation: 433
Sorry, found the answer in the source code:
references: new[] { MetadataReference.CreateFromAssembly(typeof(object).Assembly) }
Upvotes: 12