Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I develop for .NET Framework 4 in Visual Studio 2008?

My ASP.NET application runs in IIS on my web server and uses Microsoft .NET Framework 4 Beta 2. (Its Application Pool is set to .NET Framework version .NET Framework v4.0.21006.)

It gives this new error:

A potentially dangerous Request.Form value was detected from the client...

This is due to a breaking change in .NET 4.

To revert to the behavior of the ASP.NET 2.0 request validation feature, I added the following setting in the Web.config file:

<httpRuntime requestValidationMode="2.0" /> 

Now Visual Studio 2008 throws a compile-time error:

The 'requestValidationMode' attribute is not declared.

And I can no longer debug on my development machine using the ASP.NET Development Server that comes with Visual Studio.

I need Visual Studio and its ASP.NET Development Server to recognize the new .NET Framework 4 requestValidationMode attribute.

How can I debug my application in .NET 4? Must I switch from Visual Studio 2008 to Visual Studio 2010 Beta 2?

like image 423
Zack Peterson Avatar asked Dec 02 '09 22:12

Zack Peterson


People also ask

What is the .NET Framework for Visual Studio 2008?

NET 3.5 SP1 and VS 2008 SP1 contain a bunch of feature improvements targeted at web application development. . NET 3.5 SP1 adds support for a rich ASP.NET data "scaffolding" framework that enables you to quickly build functional data-driven web application.

How do I enable .NET Framework 4?

Select Start > Control Panel > Programs > Programs and Features. Select Turn Windows features on or off. If not already installed, select Microsoft . NET Framework and click OK.

Is .NET 4 still supported?

As previously announced, starting January 12, 2016 Microsoft will no longer provide security updates, technical support or hotfixes for . NET 4, 4.5, and 4.5.

Does Visual Studio use .NET Framework?

Software developers use . NET Framework to build many different types of applications—websites, services, desktop apps, and more with Visual Studio.


2 Answers

You cannot use Visual Studio 2008 to develop 4.0 applications in a supported manner. Currently only Visual Studio 2010 can be used to develop 4.0 apps. Starting with 2008 you can use it to develop for earlier versions of the framework but not later ones.

like image 55
JaredPar Avatar answered Oct 22 '22 10:10

JaredPar


From ScottGu's blog:

There isn't any way to target .NET 4 from VS08 and use new features. Having said that, .NET4 is upwards comaptible with .NET 3.5 - so applications you build targeting .NET 3.5 with VS08 should work fine on top of .NET 4.

like image 35
Chris Fulstow Avatar answered Oct 22 '22 10:10

Chris Fulstow