Russell Steen
Russell Steen

Reputation: 6612

Changing visual studio compiler version

Visual Studio is compiling Asp.Net to 4.0, but I need it to compile to 3.5. Where do I change this?

According to this (right click project, property pages, build) it is targeting 3.5, but I'm fairly certain based on the errors I'm getting with install that it's requiring 4.0 components.

enter image description here

Upvotes: 1

Views: 1697

Answers (3)

Simon Halsey
Simon Halsey

Reputation: 5480

Don't forget, it doesn't matter what you version you compile too, if the web server is configured to run your app under a particular version, it will do. Some ways will work, ie compiled to 3.5 will work in 4.0 app pool. other way round won't.

On IIS7 the version is defined in the app pool associated with your app. IIS6 it's in the ASP.Net tab.

Upvotes: 1

sellmeadog
sellmeadog

Reputation: 7517

Have you checked the <compilation> section of the Web.config file? If it still reads targetFramework="4.0" try removing/changing this value. This has worked for me in the past.

Upvotes: 1

magallanes
magallanes

Reputation: 6854

manually in the web.config file

And Automatically in visual studio, in the solution explorer, right click (in the web icon not in the solution icon) -> property pages -> build -> target framework -> change value.

You can check it, viewing the web.config.

name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral,

it indicate that the web is using net framework 3.5

Upvotes: 0

Related Questions