This project is read-only.

FuncEval strangeness in optimized code


I suspect that this bug simply happens whenever you try to inspect Reflection objects in optimized code.

Precise repro:
  1. Start VS2015 (I hit F5 in extension project)
  2. Attach the VS2015 debugger (without legacy funceval) to it
  3. Set a breakpoint at Microsoft.VisualStudio.Composition.ExportProvider.CreateExport
  4. Open a project so that the breakpoint will be hit
  5. Observe strangeness in the Locals window
  • Inspecting the state of an object in the debuggee of type System.Reflection.Module is not supported in this context.
  • This occurs for any Type value (the composition container is a good place to look for types)
  • I found one at ((System.Collections.Immutable.ImmutableDictionary<Microsoft.VisualStudio.Composition.Reflection.TypeRef, Microsoft.VisualStudio.Composition.RuntimeComposition.RuntimeExport>)((Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider)this).composition.MetadataViewsAndProviders).root.value.FirstValue.Key
  • I found a few more inside disposableNonSharedParts and disposableInstantiatedSharedParts in the base class.
  • Expanding the debugger proxy, or the IEnumerable Results View, for large immutable collections (again, look in the composition container) will hang for a while, then show no results.
  • This works fine for small collections in exportMetadata
I have a 1GB memory dump on OneDrive available upon request.


panelsonms wrote Nov 17, 2014 at 9:47 PM

I took a quick look at this and I agree that the error messages could use certainly use improvement. This is more of a bug in the Visual Studio than a bug in Roslyn. Can you please open a bug through send a smile/frown in the Visual Studio IDE (smiley face in the upper right of the screen)?
-Patrick Nelson
Visual Studio Debugger Team