I can't seem to get the following extension method to be found in another class in the same namespace (MyProject.Util
).
using System.Collections.Specialized;
namespace MyProject.Util
{
public static class Extensions
{
public static string Get(
this NameValueCollection me,
string key,
string def
)
{
return me[key] ?? def;
}
}
}
As you can see it's basically another version of foo[bar] ?? baz
, but I still don't understand why VS2008 fails to compile telling me that no version of Get
takes two arguments.
Any ideas?