Magnus Karlsson
Magnus Karlsson

Reputation: 3579

Can't reference WCF service from Asp.Net web application

I have deployed a WCF service to my cloud service web role and successfully tested it with my WCF Test Client. I can reference it as a service reference and it shows up the way i think it suppose to but I cant use it. Any ideas of how to work through this issue? I have tried to update the service reference, remove it and add it again.

(And yes, I have searched for a solution and read more than 30 results but nothing that actually has this problem).

The setup is a .net 4.5 cloud service web role with a WCF project template. Calling GetBooks method returns a string of Book objects. Then there is a WebAppConsumer web application based on the MVC .NET 4.5 Template.

enter image description here

Upvotes: 1

Views: 841

Answers (1)

Black0ut
Black0ut

Reputation: 1737

If don't need to reuse types between the service and client, go to "Configure/Add Service Reference" Dialog, click the "Advanced" button and uncheck "Reuse types in referenced assemblies".

If you need to reuse types between the service and client, check the "Reuse types in referenced assemblies", choose the "Reuse types in specified referenced assemblies" and choose only assemblies that contain the types that you want to reuse, if it doesn't solve the problem, take a look at the "Error list" tab, it will contain more info that will lead to the type/s that cause SvcUtil to fail.

Upvotes: 1

Related Questions