Silverlight WCF Error - Custom tool warning: The type 'System.Collections.ObjectModel.ObservableCollection`1' could not be found

While developing a Silverlight applicatio, I ran into the following error when I tried to add service reference to one of my WCF services.

Custom tool warning: The type 'System.Collections.ObjectModel.ObservableCollection`1' could not be found

This was really strange because I had the reference to this WCF earlier and I was not running into any issues. I made some service contract interface changes so I had to update the reference in my silverlight application as well. For a moment I thought that the new DataContract and DataMember that I added into the service contract may have something to do with it. I had added a new property to my DataContract which was an enumeration. So I removed that from the contract. I still kept getting the same error.

After fighting with it for an hour or so, I decided to use the ultimate solution that I happen to use for most Microsoft products. I closed the solution and shut down instance of Visual Studio. And then restarted Visual Studio and loaded my projects. Now I added Service Reference to same WCF service and no errors. It seems that there is some bug or something in Visual Studio's reference generation tool that triggers when there is significant change in your service's contracts.

Bottom line is that if you run into similar errors with WCF Service Reference tool, first try this wonderful solution of restarting Visual Studio and reloading your project.

Search

Social

Weather

17.1 °C / 62.9 °F

weather conditions Clear

Monthly Posts

Blog Tags