I\'m currently trying to iterate over all of my projects (sharepoint) to get all feature guids into an file. there i want to prefix them with the projects name. My problem i
Try the Solution.Projects property:
<#@ template language="C#" debug="true" hostspecific="true" #>
<#@ assembly name="Microsoft.VisualStudio.Shell.Interop.8.0" #>
<#@ assembly name="EnvDTE" #>
<#@ assembly name="EnvDTE80" #>
<#@ assembly name="VSLangProj" #>
<#@ import namespace="Microsoft.VisualStudio.Shell.Interop" #>
<#@ import namespace="EnvDTE" #>
<#@ import namespace="EnvDTE80" #>
<#@ import namespace="Microsoft.VisualStudio.TextTemplating" #>
<#@ output extension=".txt" #>
<#
var hostServiceProvider = (IServiceProvider)this.Host;
var dte = (DTE)hostServiceProvider.GetService(typeof(DTE));
foreach (Project project in dte.Solution)
{
#>
<#= project.Name #>
<#
}
#>
Try this
var item = dte.Solution.Projects.GetEnumerator();
while (item.MoveNext())
{
var project = item.Current as EnvDTE.Project;
if (project == null)
{
continue;
}
...
}