views:

165

answers:

1

When adding a second WCF service to an existing WCF project, or adding a first WCF service to a project gives me a dialog box "Specified Cast Is Invalid". WCF files are added to the project except interface file. Web.Config isn't updated neither.

I think the problem started after updating VS.NET 2008 to VS.NET 2008 SP1.

A: 

You can always reinstall SP1 if you are uncertain about the installation. A successfully install SP1 should not cause this problem.

When we have had problems adding WCF references there have generally been on of the following problems:

  • Data contracts incorrectly specified, missing a tag [Datamember], [DataContract]...
  • Is your Interface marked as public?
  • If you are referencing a DLL with types from both the client and the server, is everything serializable and public. Are you using the same version of the dll on both sides?
  • Is your contract very large? You may need to increase the buffer sizes to get the information to build the proxy.
Shiraz Bhaiji