Reputation: 146
Unhandled Exception: System.InvalidOperationException: The operation 'GetCountAsync' could not be loaded because it has a parameter or return type of type System.ServiceModel.Channels.Message or a type that has MessageContractAttribute and other parameters of different types. When using System.ServiceModel.Channels.Message or types with MessageContractAttribute, the method must not use any other types of parameters.
Hi, I am getting above exception while trying to Call webservice (which I don't have any control on).
I've checked various blogs but they all say that we can't have DataContract of a type and return primitive type in webservice. but in my case service works fine in various scenarios but fails in some.
Any pointers to solve this issue is appreciated.
Thanks, Abhinav
Upvotes: 1
Views: 584
Reputation: 73
Building the solution with .NET Framework 4.0 and running it with 4.0 works. Building with 4.5 and running on 4.0 gives this error.
Upvotes: 0
Reputation: 146
The Issue was with Framework version. Application built on framework 4.5 was working fine in first environment but breaking in the second as it had Framework 4.0. :)
Upvotes: 1