asp.net uses the wrong compiler

asp.net uses the wrong compiler

am 17.04.2008 14:50:22 von AvniDani

i am writing a web project running under IIS on VS 2008. on a standard
exe if i write a line that uses one of the new language features of
VB.NET 2008, the IDE uses the .net 3.5 compiler to compile the code
(although i am targeting .net 2) and all is working well. however, on
an asp.net site the iis and/or the .net worker process uses the .net 2
compiler for a site and the line of code i used does not work. (again
i am targeting .net 2 so the IIS is set to run the site as .net 2)

my question: how can i make the iis compile the site using the .net
3.5 compiler?

for example:
run this on vs 2008 on an exe targeting .net 2 framework
Dim x As New System.Collections.ArrayList() With {.Capacity = 20}

try to use the line above on a web site targetign .net 2 framework and
it will not work
giving only an error when you access the page and not a compiler error
on the IDE

thanks

Re: asp.net uses the wrong compiler

am 17.04.2008 16:39:26 von Nathan Sokalski

I am confused. Do you want to use 2.0 or 3.5? You keep saying you are
"targeting .NET 2.0", but you also say "How can i make the iis compile the
site using the .NET 3.5 compiler?". The first thing I would do is make sure
that VS2008 is using the version you want while you write your code. I am
assuming the runtime for that version is also installed on your IIS. I am
not a server expert, but I believe that you need to specify somewhere in the
site settings on IIS which version you are using. You may also want to try
the newsgroup microsoft.public.inetserver.iis, they may be of some use as
well.
--
Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/

wrote in message
news:b050ecde-1f00-4afa-9d99-4caf7adef34f@26g2000hsk.googleg roups.com...
>i am writing a web project running under IIS on VS 2008. on a standard
> exe if i write a line that uses one of the new language features of
> VB.NET 2008, the IDE uses the .net 3.5 compiler to compile the code
> (although i am targeting .net 2) and all is working well. however, on
> an asp.net site the iis and/or the .net worker process uses the .net 2
> compiler for a site and the line of code i used does not work. (again
> i am targeting .net 2 so the IIS is set to run the site as .net 2)
>
> my question: how can i make the iis compile the site using the .net
> 3.5 compiler?
>
> for example:
> run this on vs 2008 on an exe targeting .net 2 framework
> Dim x As New System.Collections.ArrayList() With {.Capacity = 20}
>
> try to use the line above on a web site targetign .net 2 framework and
> it will not work
> giving only an error when you access the page and not a compiler error
> on the IDE
>
> thanks