I've been having the following problem:
I have a WCF project, MyService, which references another project, MyProject. This other project has a Class called MyClass and I am passing it as a parameter to a WCF Method.
Now when I test my WCF service in a simple Console app I need to pass an Object of the type MyService.MyClass, but this Class is non-existant! It should be MyProject.MyClass.
I have checked that everything in MyClass is Serializable, so that should not be the problem.
So far the only thing I do is pass MyClass to a Method and nothing else. It does not call other Methods in MyClass whatsoever.
And actually, in my Console app I can instantiate all kinds of stuff from MyService that are actually defined in MyProject.
Why does my WCF service/Console app think that all those Classes belong to MyService instead of MyProject?
Edit:
I have the MyProject referenced in both service and client side.
What's more, this worked a few days ago. I made some changes to MyProject (not MyClass or any Class it uses though) and now it doesn't work anymore.
My ServiceContract looks as follows:
<ServiceContract()>
Public Interface IMyService
<OperationContract()>
Function DoSomething(mc As MyProject.MyClass) As Integer
End Interface
Here is the Service.
Public Class MyService
Implements IMyService
Public Function DoSomething(mc As MyProject.MyClass) As Integer Implements IMyService.DoSomething
Return SomethingCompletelyDifferent.DoMoreStuff(mc.DoStuff)
End Function
End Class
MyClass is defined as follows:
<Serializable()>
Public Class MyClass
Public Function DoStuff As AnotherClass
End Function
End Class
SomethingCompletelyDifferent and AnotherClass stay within the Service and do not communicate to the client app. So I do not expect those to be the problem. My client app has a reference to MyProject and simply does the following.
Dim service As ServiceReference.MyService
Dim mc As New MyProject.MyClass
service.DoSomething(mc)
Now where did it get MyService.MyClass from?