asp.net: Change .NET version in Web.config

M

meo

Can I select version of .NET compiler to run my ASP.NET web application?

I thought I can select version of compiler by config in Web.config when I
need to change between 1.0 or 1.1

But in ASP.NET 2.0, Can I choose?

I see the way to change only in IIS but in Web.config, I cannot see at this
moment.

Anybody find the way to set, pls let me know.
 
E

Eliyahu Goldin

I don't think it can be done outside of IIS. Web.config is processed by
asp.net, not by IIS. But IIS needs to know what asp.net to invoke to process
the request. Therefore the decision on the asp.net version has to be made
before looking at web.config.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
 
M

meo

But in ASP.NET 1.0 and ASP.NET 1.1 can do, I can select version of framework
by setting in Web.config.

It's so pity if this feature has been removed when using ASP.NET 2.0.

In some situtation, we may require to select version of framework by myself
in the config, not IIS. i.e. publish the website to web hosting rental, If I
can select version of framework, that's good and no need to tell admin to
change.

Eliyahu Goldin said:
I don't think it can be done outside of IIS. Web.config is processed by
asp.net, not by IIS. But IIS needs to know what asp.net to invoke to
process the request. Therefore the decision on the asp.net version has to
be made before looking at web.config.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


meo said:
Can I select version of .NET compiler to run my ASP.NET web application?

I thought I can select version of compiler by config in Web.config when I
need to change between 1.0 or 1.1

But in ASP.NET 2.0, Can I choose?

I see the way to change only in IIS but in Web.config, I cannot see at
this moment.

Anybody find the way to set, pls let me know.
 
M

Mark Rae

I don't think it can be done outside of IIS. Web.config is processed by
asp.net, not by IIS. But IIS needs to know what asp.net to invoke to
process the request. Therefore the decision on the asp.net version has to
be made before looking at web.config.

Isn't this what <supportedRuntime version="......." /> is for...?
 
M

Mark Rae

I don't think so, because as Eliyahu pointed out, it's all controlled by an
IIS setting.

OK, so does that configuration option apply only to WinForms apps...?
 
J

Juan T. Llibre

re:
it's all controlled by an IIS setting

....which is set with aspnet_regiis.exe

The <supportedRuntime version="......." /> setting
is ignored by ASP.NET applications.

It's only valid in console and WinForms applications,
and must be placed in the application configuration file's <startup> element.

The application configuration file must have
the same name as the application, with a .config extension.

For an application named myExecutable.exe,
the application configuration file must be named myExecutable.exe.config.

http://msdn.microsoft.com/library/d...de/html/cpcontargetingnetframeworkversion.asp
 
J

Juan T. Llibre

re:
does that configuration option apply only to WinForms apps...?

Exactly, as pointed out in my two just-sent posts
( which hadn't arrived yet when I wrote this reply...).
 
J

Juan T. Llibre

It can't be done. Not in the next version, not ever.

It's just the way things work.
See my other posts in this thread for the technical explanation.
 
M

Mark Rae

re:

Exactly, as pointed out in my two just-sent posts
( which hadn't arrived yet when I wrote this reply...).

Thanks for the clarification - I had a feeling that would be the case...
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top