4

I added the service reference in my project and it has created all required wsdl files. But when I looked at the reference.cs file, I found it blank.

-Anil

Anil Purswani
  • 1,857
  • 6
  • 35
  • 63
  • 2
    [Please see this][1] [1]: http://stackoverflow.com/questions/1408509/sometimes-adding-a-wcf-service-reference-generates-an-empty-reference-cs/1409065 – ebattulga Jul 16 '11 at 09:10

2 Answers2

10

you can rightclick in the service reference created and click the Configure service reference... option. in the DataType section UnCheck Reuse types in referenced assemblies

Marcelo Lujan
  • 2,142
  • 1
  • 17
  • 12
  • Or uncheck the specific referenced assembly containing an ambiguous type. For instance, if you have ProjectA that references Service1. Then you referenced ProjectA from ProjectB, and now you're trying to add a reference to Project B to Service1, it will try to reuse the proxy types defined in ProjectA (assuming they are accessible). So you could select "Reuse types in specified referenced assemblies" and check everything but ProjectA. Of course, in that scenario, you would be creating redundant service proxies and should probably rethink your architecture. – xr280xr Sep 30 '14 at 20:02
1

This happens if the add service references fails.

We have seen this fail with very large contracts where the size of the response is greater than the configured size in WCF.

Shiraz Bhaiji
  • 64,065
  • 34
  • 143
  • 252
  • add service references didnt failed....also size of response and configured size comes into the picture at runtime when we are trying to get the response which is greater in size....but here I am talking about design time error. As after adding reference it is not failing and creating all necessary wsdl but ending with blank reference.cs – Anil Purswani May 13 '11 at 07:07