Sayfalar

5 Şubat 2011 Cumartesi

The Framework Version


Older versions of Visual Studio were tightly coupled to specific versions of .NET. You used Visual Studio
.NET to create .NET 1.0 applications, Visual Studio .NET 2003 to create .NET 1.1 applications, and Visual
Studio 2005 to create .NET 2.0 applications.
Visual Studio 2008 removed this restriction with multitargeting, and Visual Studio 2010 continues the
trend. It allows you to create web applications that are designed to work with .NET 2.0, .NET 3.0, .NET 3.5,
or .NET 4. Typically, you’ll choose the latest version that your web server supports. Later versions give you
access to more recent features, and all the samples that are included with this book target .NET 4.

To provide accurate multitargeting, Visual Studio 2010 includes reference assemblies for each version
of .NET. These assemblies include the metadata of every type, but none of the code that’s required to
implement it. That means Visual Studio 2010 can use the reference assembly to tailor its Intellisense and
error checking, ensuring that you aren’t able to use controls, classes, or members that aren’t available in
the version of .NET that you’re targeting. It also uses this metadata to determine what controls should
appear in the toolbox, what members should appear in the Properties window and Object Browser, and
so on, ensuring that the entire IDE is limited to the version you’ve chosen.
You can also change the version of .NET that you’re targeting after you’ve created your website. To
do that, follow these steps:
1. Choose Website ➤ Start Options.
2. In the list on the left, choose the Build category.
3. In the Target Framework list, choose the version of .NET you want to target.
■ Note This process is slightly different in a web project. In a web project, you begin by double-clicking the
Properties node in the Solution Explorer. Then, choose the Application tab, which contains the Target Framework
list in which you can choose the version of .NET you want to target.
When you change the .NET version, Visual Studio modifies your web.config file quite significantly.
For example, the web.config file for a .NET 4 application is short and streamlined, because all of the
plumbing it needs is set up in the computer’s root web.config file. But the web.config file for a .NET 3.5
application needs a good deal of extra boilerplate to explicitly enable support for Ajax and C# 3.5
features.

Hiç yorum yok:

Yorum Gönder

Bing'ı Seviyoruz. :)
Google'ı Seviyoruz. :)