By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,949 Members | 921 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,949 IT Pros & Developers. It's quick & easy.

Can C# 3.0 not be used in websites?

P: n/a
Hello,

In my (Visual Studio 2008) solution, I am not able to use C# 3.0
features (like the var keyword) in all of my projects. Does anyone
know what could be the reason?

I am working in a solution with an ASP.NET website and several class
library projects. In the class libraries I can use var, however, in
the website I cannot.
Both the website and the class libraries are targeted for the .NET 3.5
platform. I thought that was the problem, but it seems it is something
else..

Other 'oddity' is that we are not including the LINQ dll's. But this
is the same for the website as for the class libraries, so that
shouldn't be the problem.

Any ideas? Thanks in advance!

Kind regards,
Rick
Nov 19 '08 #1
Share this Question
Share on Google+
9 Replies


P: n/a
MC

"Rick van der Arend" <rv**********@gmail.comwrote in message news:4d**********************************@r36g2000 prf.googlegroups.com...
Hello,

In my (Visual Studio 2008) solution, I am not able to use C# 3.0
features (like the var keyword) in all of my projects. Does anyone
know what could be the reason?

I am working in a solution with an ASP.NET website and several class
library projects. In the class libraries I can use var, however, in
the website I cannot.
Both the website and the class libraries are targeted for the .NET 3.5
platform. I thought that was the problem, but it seems it is something
else..
What does the error message say?
Nov 19 '08 #2

P: n/a

"Rick van der Arend" <rv**********@gmail.comwrote in message news:4d**********************************@r36g2000 prf.googlegroups.com...
Hello,

In my (Visual Studio 2008) solution, I am not able to use C# 3.0
features (like the var keyword) in all of my projects. Does anyone
know what could be the reason?

I am working in a solution with an ASP.NET website and several class
library projects. In the class libraries I can use var, however, in
the website I cannot.
Both the website and the class libraries are targeted for the .NET 3.5
platform. I thought that was the problem, but it seems it is something
else..

MC wrote:
What does the error message say?
Well, to be honest I do not get any specific error message. Just a
compiler error you would expect with these language features non-
existant.
Nov 19 '08 #3

P: n/a
On Nov 19, 10:20*pm, Rick van der Arend <rvanderar...@gmail.com>
wrote:
"Rick van der Arend" <rvanderar...@gmail.comwrote in messagenews:4d**********************************@r 36g2000prf.googlegroups.com...
Hello,
In my (Visual Studio 2008) solution, I am not able to use C# 3.0
features (like the var keyword) in all of my projects. Does anyone
know what could be the reason?
I am working in a solution with an ASP.NET website and several class
library projects. In the class libraries I can use var, however, in
the website I cannot.
Both the website and the class libraries are targeted for the .NET 3.5
platform. I thought that was the problem, but it seems it is something
else..
MC wrote:
What does the error message say?

Well, to be honest I do not get any specific error message. Just a
compiler error you would expect with these language features non-
existant.- Hide quoted text -
I've run it again on my dev station at work, just to get the exact
message:
"The type or namespace name 'var' could not be found (are you missing
a using directive or an assembly reference?)"

As you can see, this just is a message that you would expect when
'var' is completely unrecognized..
Nov 20 '08 #4

P: n/a
"Rick van der Arend" <rv**********@gmail.comwrote in message
news:d8**********************************@f20g2000 yqg.googlegroups.com...
I've run it again on my dev station at work, just to get the exact
message:
"The type or namespace name 'var' could not be found (are you missing
a using directive or an assembly reference?)"

As you can see, this just is a message that you would expect when
'var' is completely unrecognized..

It really sounds like the only thing to explain this would be that the
server does not have .Net 3.5 installed correctly.

Have you tried precompiling the site before deploying to your server?

Nov 20 '08 #5

P: n/a
"Rick van der Arend" <rv**********@gmail.comwrote in message
news:d8**********************************@f20g2000 yqg.googlegroups.com...
"The type or namespace name 'var' could not be found (are you missing
a using directive or an assembly reference?)"

As you can see, this just is a message that you would expect when
'var' is completely unrecognized..


It really sounds like the only thing to explain this would be that the
server does not have .Net 3.5 installed correctly.

Have you tried precompiling the site before deploying to your server?
I am talking about a website that I am currently developing, so this
already happens on my workstation, in the development web server. And
I think .NET 3.5 not being installed cannot explain the problem, as my
other assemblies (code libraries) can be written in C#3.0 just the
same.

If I am not mistaken, C#3.0 language features are something the c#
compiler supports. I am not sure if the .NET 3.5 framework libraries
are even necessary for them to be used. But anyhow, .NET 3.5 is
installed and both the website and the code library projects target
the .NET 3.5 Platform. Thanks for the suggestion, though!
Nov 21 '08 #6

P: n/a
On 2008-11-21, Rick van der Arend <rv**********@gmail.comwrote:
>"Rick van der Arend" <rv**********@gmail.comwrote in message
news:d8**********************************@f20g200 0yqg.googlegroups.com...
"The type or namespace name 'var' could not be found (are you missing
a using directive or an assembly reference?)"

As you can see, this just is a message that you would expect when
'var' is completely unrecognized..


It really sounds like the only thing to explain this would be that the
server does not have .Net 3.5 installed correctly.

Have you tried precompiling the site before deploying to your server?

I am talking about a website that I am currently developing, so this
already happens on my workstation, in the development web server. And
I think .NET 3.5 not being installed cannot explain the problem, as my
other assemblies (code libraries) can be written in C#3.0 just the
same.

If I am not mistaken, C#3.0 language features are something the c#
compiler supports. I am not sure if the .NET 3.5 framework libraries
are even necessary for them to be used. But anyhow, .NET 3.5 is
installed and both the website and the code library projects target
the .NET 3.5 Platform. Thanks for the suggestion, though!
Hmmm... it sounds to me like the code is being compiled with an older version
of the compiler. var is not a runtime or library thing, it's a C# 3.0
compiler thing.

Not sure how to fix it, but have you checked the version of .NET the website
is using?

--
Tom Shelton
Nov 21 '08 #7

P: n/a
I am talking about a website that I am currently developing, so this
already happens on my workstation, in the development web server. And
I think .NET 3.5 not being installed cannot explain the problem, as my
other assemblies (code libraries) can be written in C#3.0 just the
same.
If I am not mistaken, C#3.0 language features are something the c#
compiler supports. I am not sure if the .NET 3.5 framework libraries
are even necessary for them to be used. But anyhow, .NET 3.5 is
installed and both the website and the code library projects target
the .NET 3.5 Platform. Thanks for the suggestion, though!

Hmmm... it sounds to me like the code is being compiled with an older version
of the compiler. *var is not a runtime or library thing, it's a C# 3.0
compiler thing.

Not sure how to fix it, but have you checked the version of .NET the website
is using?
If you are talking about the .NET pratform that it is targeting,
that's 3.5
If you are talking about something else, I didn't understand your
question. Is there some place/menu/option/dialog where I can find the
information you are talking about?

--
Rick
Nov 21 '08 #8

P: n/a
On 21 nov, 14:55, Rick van der Arend <rvanderar...@gmail.comwrote:
I am talking about a website that I am currently developing, so this
already happens on my workstation, in the development web server. And
I think .NET 3.5 not being installed cannot explain the problem, as my
other assemblies (code libraries) can be written in C#3.0 just the
same.
If I am not mistaken, C#3.0 language features are something the c#
compiler supports. I am not sure if the .NET 3.5 framework libraries
are even necessary for them to be used. But anyhow, .NET 3.5 is
installed and both the website and the code library projects target
the .NET 3.5 Platform. Thanks for the suggestion, though!
Hmmm... it sounds to me like the code is being compiled with an older version
of the compiler. *var is not a runtime or library thing, it's a C# 3.0
compiler thing.
Not sure how to fix it, but have you checked the version of .NET the website
is using?

If you are talking about the .NET pratform that it is targeting,
that's 3.5
If you are talking about something else, I didn't understand your
question. Is there some place/menu/option/dialog where I can find the
information you are talking about?
Extra info: on the same dev machine, visual studio, dev web server, I
made a new website, also targeting .NET 3.5 - this one works with C#
3.0 syntax
So it seems to be some setting in the website.
Nov 21 '08 #9

P: n/a
On 2008-11-21, Rick van der Arend <rv**********@gmail.comwrote:
On 21 nov, 14:55, Rick van der Arend <rvanderar...@gmail.comwrote:
I am talking about a website that I am currently developing, so this
already happens on my workstation, in the development web server. And
I think .NET 3.5 not being installed cannot explain the problem, as my
other assemblies (code libraries) can be written in C#3.0 just the
same.
If I am not mistaken, C#3.0 language features are something the c#
compiler supports. I am not sure if the .NET 3.5 framework libraries
are even necessary for them to be used. But anyhow, .NET 3.5 is
installed and both the website and the code library projects target
the .NET 3.5 Platform. Thanks for the suggestion, though!
Hmmm... it sounds to me like the code is being compiled with an older version
of the compiler. *var is not a runtime or library thing, it's a C# 3.0
compiler thing.
Not sure how to fix it, but have you checked the version of .NET the website
is using?

If you are talking about the .NET pratform that it is targeting,
that's 3.5
If you are talking about something else, I didn't understand your
question. Is there some place/menu/option/dialog where I can find the
information you are talking about?

Extra info: on the same dev machine, visual studio, dev web server, I
made a new website, also targeting .NET 3.5 - this one works with C#
3.0 syntax
So it seems to be some setting in the website.
Yes... That's what I was getting at. If you look in the settings for the
website, check the asp.net tab and compare them to the asp.net settings of the
working website.

--
Tom Shelton
Nov 21 '08 #10

This discussion thread is closed

Replies have been disabled for this discussion.