6

I've got an ITypeSymbol for a nested type (MyNamespace.MyOuter.Nested) and am trying to get the type's full name using:

typeSymbol.ToDisplayString(new SymbolDisplayFormat(
    SymbolDisplayGlobalNamespaceStyle.Omitted,
    SymbolDisplayTypeQualificationStyle.NameAndContainingTypesAndNamespaces,
    SymbolDisplayGenericsOptions.IncludeTypeParameters,
    miscellaneousOptions: SymbolDisplayMiscellaneousOptions.ExpandNullable
));

Reflection returns the full name as MyNamespace.MyOuter+Nested - how to obtain the very same string from Roslyn? The display format above returns MyNamespace.MyOuter.Nested :-(

D.R.
  • 20,268
  • 21
  • 102
  • 205
  • 2
    `MyNamespace.MyOuter+Nested` is the **.NET/CIL** name, `MyNamespace.MyOuter.Nested` is the **C#** full name. – Paulo Morgado Mar 18 '15 at 11:12
  • Is there a way to generate the .NET/CIL name with Roslyn? – D.R. Mar 18 '15 at 14:18
  • Unfortunately no. But you can generate it yourself with the extension method shown here: http://stackoverflow.com/questions/27105909/get-fully-qualified-metadata-name-in-roslyn – JoshVarty Mar 18 '15 at 15:39

0 Answers0