views:

169

answers:

3

Hi,

I've recently converted an app from .net 2.0 to 3.5 but I don't see any extension methods... what am I doing wrong? Or what else should I do besides changing the target framework from 2.0 to 3.5 in project settings?

A: 

Extension method, is feature of .net 3.5. extension methods are some thing that you need to create !!!

http://stackoverflow.com/questions/403539/what-are-extension-methods

refer this link

Prashant
actually there are bunch of default extensions ships with 3.5.
dr. evil
dude, I don't know if you know... but there are extension methods ALREADY written in 3.5
argh
Sorry, I misunderstood you question!! my fault :)
Prashant
no problem, nothing serious happened ;)
argh
+2  A: 

Extension methods appear based on the imported namespaces try adding

using System.Linq;

to the top of your files. As Jon says you'll also need add a reference to System.Core.dll assembly.

SillyMonkey
thanks that was what I was looking for!
argh
+1  A: 

You not only need to add the using directive for System.Linq as SillyMonkey suggested, but you also need to have a reference to the System.Core assembly if you want to use LINQ.

Jon Skeet
isn't that added as you change target framework to 3.5?
argh
@argh - I think it is. But it makes for a more complete answer (eg. the reference may get left out depending on how the project is upgraded)
SillyMonkey