views:

481

answers:

1

Is it possible to tell Visual Studio 2010 to use an older version of aspnet_compiler to build and debug a web application project? I have a web app targeted for .Net 3.5 that complains and mentions something about using version 2.0 of the aspnet_compiler command. I know where on the disk this magical version of aspnet_compiler is located, but I can not for the life of me figure out how to tell the IDE where it is.

full text of the error here:

This version of the aspnet_compiler command is used to compile Web applications that target version 4.0 or later of the .NET Framework. The element in the Web.config file for this Web application does not contain the required 'targetFrameworkMoniker' attribute (for example, ''). To compile this Web application for earlier versions of the .NET Framework, use version 2.0 of the aspnet_compiler command, or use the current version of Visual Studio. To compile this Web application for version 4.0 or later of the .NET Framework, update the element in the Web.config file to include the 'targetFrameworkMoniker' attribute and the correct version number.

A: 

ASP.NET 4.0 and Visual Studio 2010 Web Development Beta 2 Overview

SUMMARY: You can create an application that targets a specific version of the .NET Framework. In ASP.NET 4, a new attribute in the compilation element of the Web.config file lets you target the .NET Framework 4 and later. If you explicitly target the .NET Framework 4, and if you include optional elements in the Web.config file such as the entries for system.codedom, these elements must be correct for the .NET Framework 4. (If you do not explicitly target the .NET Framework 4, the target framework is inferred from the lack of an entry in the Web.config file.)

The following example shows the use of the targetFramework attribute in the compilation element of the Web.config file.

 <compilation targetFramework="4.0"/>
adatapost
from what I can tell 'targetFrameworkMoniker' is only used on version 4 and up. although if anyone knows the incantation used to make VS actually target the 3.5 asp.net framework, I'm all ears.
Ariel
also what about this part of that article you linked?"If you are using the aspnet_compiler command to precompile your application (such as in a build environment), you must use the correct version of the aspnet_compiler command for the target framework. Use the compiler shipped in the .NET Framework 2.0 (%WINDIR%\Microsoft.NET\Framework\v2.0.50727) to compile for the .NET Framework 3.5 and earlier versions. Use the compiler shipped in the .NET Framework 4 to compile applications created with that framework or later versions."
Ariel