VS 2010 Error “Object reference not set to an instance of an object” when adding Service Reference f

Posted by Andy on Stack Overflow See other posts from Stack Overflow or by Andy
Published on 2010-04-22T16:02:32Z Indexed on 2010/04/23 14:03 UTC
Read the original article Hit count: 197

I have a VS2010 (RTM) solution which contains:

WCF Service project
Console WCF client project
Class project for DataContracts and members
Class project for some simple classes

I successfully added a service reference in the console client project and ran the client. I then did a long dev cycle repeatedly modifying the service then updating console service reference. I then changed the namespace and assembly names for the projects as well as the .cs using references and app.config. I of course missed some things as it would not build so I eventually removed the project references and the service reference, cleaned and built successfully.

I then attempted to add the service reference again, it discovered it but threw the “Object reference not set to an instance of an object” when OK'ing. Fix in answer below...

© Stack Overflow or respective owner

Related posts about visual-studio-2010

Related posts about wcfservice