views:

12

answers:

1

I'm trying to generate some additional code base on the auto-generated webservice proxies in my VS2010 solution, I'm using a T4 template to do so.

The problem is, automatically generated proxies are added in "Service Reference" folder but ProjectItems (files) are hidden by default and the following code does not find them in the project structure:


var sr = GetProjectItem(project, "Service References");
if(sr != null)
{
   foreach(ProjectItem item in sr.ProjectItems)
   {
      foreach(var file in item.ProjectItems)
      {
         //Services.Add(new ServiceInfo { Name = file.Name });
      }
   }
}

The above code runs and although service reference is found, and there are ProjectItems under that node (named by the webservice reference name), under object under that node is of type System.__ComObject and I'm not sure how to progress.

Any help is appreciated.

A: 

It turns out I figured out how to fix this right after posting it here!

The problem was I was using the "var" keyword in second loop, and casting the "file" variable to "ProjectItem" work just like first loop.

Hadi Eskandari