asp.net uses the wrong compiler

A

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
 
N

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top