Extension Methods not Recognized
What is necessary to have an extension method honored when it exists in an imported assembly? I built one in a class library project but it is not recognized in my web project which references the library. All the other classes and methods in the library are honored and visible but this extension method is not. The extension method is visible when used within the library.
Referencing an assembly containing a class with extension methods is not enough. You need to import the namespace containing the class in each of your source file where you want to use the extension methods.
For example, to use LINQ-to-objects, you need to reference the System.Core assembly and import the System.Linq namespace (which contains the Enumerable class with the LINQ extension methods):
using System.Linq;
If the Extension method is callable when not using the Extension syntax, use the Format:
this.MyExtensionMethod()
That cleared up my problem of not finding the Extension method of a class in VS2010.
Are you sure the extension method is made public?