Silverlight 3 and WCF woes with Visual Studio 2010 B2 - Cannot create a service reference with namespace X because the name is already in use by an existing service reference, folder or file

By dsandor at November 11, 2009 20:46
Filed Under:

I am wrapping up a Silverlight 3 LOB application and decided to change my WCF Bindings from basicHTTP to Custom/Binary because I was receiving network issues.  After doing this and changing my client bindings all hell broke loose. 

I started getting the error:

Cannot create a service reference with namespace X because the name is already in use by an existing service reference, folder or file

Followed the directions here and got close.  I even tried to create the service references again with a different name and got the following:

Custom tool warning: cannot import wsdl:portType

My solution was this:

(Under your Silverlight application project folder.)

  • Delete everything from obj and bin.
  • Remove the service references from ServiceReferences.ClientConfig
    (You should just have <configuration />.)
  • Delete the service references in your project.
  • Delete from your project folder/Properties/DataSources all the data sources created for your service references.  If you did not create any datasources manually then all of these can go.

This did fix my problem.  I hope this helps you also.

Comments are closed