HI ,
I have an Item template project. In which I have a function for called GetProjectTypeGuids.
public string GetProjectTypeGuids(EnvDTE.Project proj) { string projectTypeGuids = string.Empty; try { if (proj != null) { object service = null; Microsoft.VisualStudio.Shell.Interop.IVsSolution solution = null; Microsoft.VisualStudio.Shell.Interop.IVsHierarchy hierarchy = null; Microsoft.VisualStudio.Shell.Interop.IVsAggregatableProject aggregatableProject = null; int result = 0; service = GetService(proj.DTE, typeof(Microsoft.VisualStudio.Shell.Interop.IVsSolution)); solution = (Microsoft.VisualStudio.Shell.Interop.IVsSolution)service; result = solution.GetProjectOfUniqueName(proj.UniqueName, out hierarchy); if (result == 0) { aggregatableProject = (Microsoft.VisualStudio.Shell.Interop.IVsAggregatableProject)hierarchy; result = aggregatableProject.GetAggregateProjectTypeGuids(out projectTypeGuids); } } } catch (Exception ex) { WriteErrorLog(ex); } return projectTypeGuids; }
i am facing issue with the below line with ASPNET5 alone
aggregatableProject = (Microsoft.VisualStudio.Shell.Interop.IVsAggregatableProject)hierarchy;
Exception details:
Unable to cast object of type 'Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.ProjectNode' to type 'Microsoft.VisualStudio.Shell.Interop.IVsAggregatableProject'.
Please any one help me to resolve this type cast issue.how do i need to cast for ASPNET5 project
Kani