docs icon indicating copy to clipboard operation
docs copied to clipboard

MetadataFileReference is internal

Open provegard opened this issue 10 years ago • 4 comments

I'm trying to follow csharp-semantic.pdf under docs/samples. When I add this code:

var compilation = CSharpCompilation.Create("HelloWorld")
 .AddReferences(
   new MetadataFileReference(typeof(object).Assembly.Location))
 .AddSyntaxTrees(tree);

I get a compilation error because MetadataFileReference is an internal type.

provegard avatar Feb 27 '15 13:02 provegard

Got it to work using MetadataReference.CreateFromAssembly(typeof (object).Assembly), so I suppose the sample doc should be updated.

provegard avatar Feb 27 '15 13:02 provegard

Yes, this is deliberately exposed through the factory methods now. There are (unfortunately) a lot of things that need to be updated in that document.

Pilchie avatar Feb 27 '15 15:02 Pilchie

Reopening as the docs are still wrong.

gafter avatar Mar 09 '15 22:03 gafter

Moving to docs team to decide future of doc'ing roslyn.

CyrusNajmabadi avatar Oct 28 '22 17:10 CyrusNajmabadi