Client
iGame Channel = new ChannelFactory ( new BasicHttpBinding ( BasicHttpSecurityMode . None ) , new EndpointAddress ( new Uri ( \"http://loc
In my case just add using System;
solve the issue.
I had this issue in one of my projects, where I found that I had set my project's .Net Framework version to 4.0 and async tasks are only supported in .Net Framework 4.5 onwards.
I simply changed my project settings to use .Net Framework 4.5 or above and it worked.
You have to install Microsoft.Bcl.Async NuGet package to be able to use async/await
constructs in pre-.NET 4.5 versions (such as Silverlight 4.0+)
Just for clarity - this package used to be called Microsoft.CompilerServices.AsyncTargetingPack
and some old tutorials still refer to it.
Take a look here for info from Immo Landwerth.
Make sure your .NET version 4.5 or greater
I had this problem because I was calling a method
await myClass.myStaticMethod(myString);
but I was setting myString with
var myString = String.Format({some dynamic-type values})
which resulted in a dynamic
type, not a string
, thus when I tried to await on myClass.myStaticMethod(myString)
, the compiler thought I meant to call myClass.myStaticMethod(dynamic myString)
. This compiled fine because, again, in a dynamic context, it's all good until it blows up at run-time, which is what happened because there is no implementation of the dynamic version of myStaticMethod
, and this error message didn't help whatsoever, and the fact that Intellisense would take me to the correct definition didn't help either.
Tricky!
However, by forcing the result type to string, like:
var myString = String.Format({some dynamic-type values})
to
string myString = String.Format({some dynamic-type values})
my call to myStaticMethod
routed properly