Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Include existing service reference folder to project in visual studio 2010

I have a bunch of service references in my local drive that I want to include in a Visual Studio 2010 project.

But when I select Include in Project command they are included as folders and I cannot find a way to tell Visual Studio that they are Service References.

Is there a way to achieve this? Something like a Include Existing Service Reference?

like image 463
jorgehmv Avatar asked Apr 10 '13 13:04

jorgehmv


1 Answers

I had to manually edit the project xml and add node like the following for each server reference:

<ItemGroup>
 <WCFMetadataStorage Include="Service References\NameOfYourReference\" />
 <WCFMetadataStorage Include="Service References\NameOfYourOtherReference\" />
 //more services
</ItemGroup

I also needed to change the Reference.cs compile node, since it seems that VS2010 automatically generated a Reference1.cs file when I included the folder in the project. So I had to remove the Reference1.cs from the xml and ensure the following XML:

<Compile Include="Service References\NameOfYourReference\Reference.cs">
  <AutoGen>True</AutoGen>
  <DesignTime>True</DesignTime>
  <DependentUpon>Reference.svcmap</DependentUpon>
</Compile>

This seems a lot of manual work, but as I said in my case there were a lot of services so for me this was better than adding again all references through VS dialogs

like image 73
jorgehmv Avatar answered Oct 03 '22 11:10

jorgehmv