Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

ITypeResolutionService doesn't return types defined in the local project

$
0
0

When implementing a IVsSingleFileGenerator, I would expect the below service call to return all types within scope. However, types declared locally (within the project) are not returned. Am I doing something wrong, is this a bug or something else?

DynamicTypeService typeService = (DynamicTypeService)ServiceProvider.GlobalProvider.GetService(typeof(DynamicTypeService));

IVsSolution vsSolution = (IVsSolution)ServiceProvider.GlobalProvider.GetService(typeof(IVsSolution));

IVsHierarchy hier;

vsSolution.GetProjectOfUniqueName(currentProject.UniqueName, out hier);

ITypeResolutionService trs = (ITypeResolutionService)typeService.GetTypeDiscoveryService(hier);

ITypeDiscoveryService tds = (ITypeDiscoveryService)typeService.GetTypeDiscoveryService(hier);

Type t = trs.GetType("MyNamespace.MyEnum");


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>