CS0246: The type or namespace name 'var' could not be found (are you missing a using directive or an assembly reference?)

I get the following error on

var courier = "12345";

target framework = 3.5 ( in property pages)
I remember i need to add a particular reference?

Who is Participating?
RDWaibelConnect With a Mentor Commented:
Also, you might want to check the web.config file...

great article about the changes:
What type of variable do you need?
int courier = 12345
string courier = "12345"
object courier = "12345"
frosty1Author Commented:
sorry to clarify i want to use the var keyword that is possible to asp.net 3.5.

My website is set to 3.5 but i don't understand why i can't use the var keyword on my site. I can use if i create a class library and import the dll into my site. I think i just need a reference. But can't remember which one.
You may need to check the property pages for the web site and go to the "Build" section.
From there, ensure that the target framework is set to 3.5.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.