Wednesday, June 17, 2009

Metadata contains a reference that cannot be resolved net.tcp



Error "Metadata contains a reference that cannot be resolved: 'service reference'.
If the service is defined in the current solution, try building the solution and adding the service reference again." could be caused by specifying specific contract rather than IMetadataExchange in Contract section of service endpoint configuration.

4 comments:

Anonymous said...

I got this error since some of the internal types used by the exposed object on the contract were not serializable. After applying the Serializable attribute, the proxy generated correctly.

Anonymous said...

Got the same error, after applying data contract attribute to some of the classes (oops), it worked.

Unknown said...

I didn't need to apply Serializable attribute, neither Data contract attribute...

In my case, I had this error with a specific class (which wasn´t in a web service), but it was returned by one...

Class needed a constructor without parameters..

Inciph said...

My issue was a class that extended System.Exception. The class was marked with the [DataContract] attribute. After removing the [DateMember] attributes and changing [DataContract] to [Serializable] i was able to add the reference.