Generating code for service proxies

Posted by Hadi Eskandari on Stack Overflow See other posts from Stack Overflow or by Hadi Eskandari
Published on 2010-05-05T11:52:19Z Indexed on 2010/05/05 12:08 UTC
Read the original article Hit count: 283

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.

© Stack Overflow or respective owner

Related posts about T4

Related posts about code-generation