Reputation: 572
I created windows service hosted WCF as it described here: http://msdn.microsoft.com/en-us/library/ff649818.aspx
Interface used as ServiceContract looks as follows:
[ServiceContract]
public interface IUIService
{
[OperationContract]
void MoveToPosition(double dblNum1, double dblNum2, double dblNum3);
[OperationContract]
void AutoFocus();
[OperationContract]
double GetStatus();
[OperationContract]
string ScanRegion(Point startPoint, Size size);
[OperationContract]
ImageData GetImage(string processId);
}
Now the problem is that when I call method from Service, let's say ScanRegion from a solution which has a service reference on hosting win service, it requires not System.Drawing.Point and System.Drawing.Size, but UIServiceReference.Point and UIServiceReference.Size. And when I go to reference class, I see that there are fully implemented objects of the corresponding types. What's the matter? And how to fix it?
Upvotes: 0
Views: 135
Reputation: 127543
When you go to add the service refrence in the client program you must have System.Drawing
referenced by the project for the client before you create the reference to the service. If that refrence is not there it will "create its own" because your project did not know System.Drawing
existed so it had to re-create its own types.
If System.Drawing
was already part of the project and it still is making its own type check the advanced screen for the service and be sure that either "Reuse types in all referenced assemblies" is selected or if specified assemblies is selected that the box for System.Drawing
is checked.
Upvotes: 2