Make aspnet_compiler use 3.5 framework

Posted on 2011-02-25
Last Modified: 2012-05-11

I have an app that uses the MSBuild task, which calls aspnet_compiler which then spawns csc.exe. On my local machine, which is WinXP SP3 with .NET 2.0 & 3.5 & MS Visual Studio 2008, aspnet_compiler correctly spawns csc.exe from the 3.5 framework. However, on the production server, which is Win 2008 with both .NET 2.0 & 3.5 installed, it spawns csc.exe v 2.0, which gives a lot of compile errors. Note that I'm just running the aspnet_compiler from an NANT script to compile & merge the app to a DLL to be deployed later, not deploying it to the IIS. Is there anything I can do for using the 3.5 framework? Also, I looked into IIS config and the 3.5 framework is not listed there at all as an option to use. There's just 2.0 or no managed code.
Question by:bovlk
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3

Expert Comment

ID: 34984662
In the VS IDE go to the Website menu and select "Start Options" in the new dialog click on the 'Build' to the left and then you will see drop downs that let you choose the framework.

Expert Comment

ID: 34984667
See here:

 Build Options

Expert Comment

ID: 34984674
Oh, I missed something key in your post. The reason 3.5 is not visible in IIS on the server is that the .Net Framework 3.5 runtimes are not installed on the web server.
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.


Author Comment

ID: 34984696
No no, the 3.5 SP1 framework is installed at the server, as the appropriate control panel says. The files are present in the appropriate subdir of c:\windows. The option you talk about is set in my project and the project compiles just fine on my local XP. But it does not compile on the server. Forgot to mention that there's no VS on the server.

Accepted Solution

bovlk earned 0 total points
ID: 34984848
Well, this was a really hard and stupid problem. The copy at the server had missing web.config. A long history why it happened. The compiler version to use is set up in this file. So if it was missing, the default (2.0) was used.

Author Closing Comment

ID: 35015596
It was the actual reason for this problem

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
A phishing scam that claims a recipient’s credit card details have been “suspended” is the latest trend in spoof emails.
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question