Sie sind auf Seite 1von 6

Visual Studio.

NET Best Articles

What's New in the .NET Framework Version 2.0?


The Microsoft .NET Framework version 2.0 extends the .NET Framework version 1.1 with new features, improvements to existing features, and enhancements to the documentation. This section provides information a out some ke! additions and modifications. !"Bit #lat$orm Su%%ort The new generation of "#$ it computers ena %es the creation of app%ications that can run faster and take advantage of more memor! than is avai%a %e to &2$ it app%ications. New support for "#$ it app%ications ena %es users to "#$ it computers. Access &ontrol 'ist Su%%ort 'n access contro% %ist (')*+ is used to grant or revoke permission to access a resource on a computer. New c%asses have een added to the .NET Framework that a%%ow managed code to create and modif! an ')*. New mem ers that use an ')* have een added to the ,-., registr!, and threading c%asses. A().NET New features in '/..NET inc%ude support for user$defined t!pes (0/T+, as!nchronous data ase operations, 1M* data t!pes, %arge va%ue t!pes, snapshot iso%ation, and new attri utes that a%%ow app%ications to support mu%tip%e active resu%t sets (M'23+ with 34* 3erver 2005. AS#.NET The Microsoft .NET Framework 2.0 inc%udes significant enhancements to a%% areas of '36.NET. For 7e page deve%opment, new contro%s make it easier to add common%! used functiona%it! to d!namic 7e pages. New data contro%s make it possi %e to disp%a! and edit data on an '36.NET 7e page without ui%d cache writing code. 'n improved code$ ehind mode% makes deve%oping '36.NET pages easier and more ro ust. )aching features provide severa% new wa!s to cache pages, inc%uding the a i%it! to dependenc! on ta %es in a 34* 3erver data ase. 8ou can now customi9e 7e sites and pages in a variet! of wa!s. 6rofi%e properties ena %e '36.NET to track propert! va%ues for individua% users automatica%%!. 0sing 7e 6arts, !ou can create pages that users can customi9e in the rowser. 8ou can add navigation menus using simp%e contro%s. ,mprovements to 7e site features a%%ow !ou to create professiona% 7e sites faster and more easi%!. ui%d managed code %i raries or easi%! use unmanaged code %i raries on

Master pages a%%ow !ou to create a consistent %a!out for a%% the pages in a site, and themes a%%ow !ou to define a consistent %ook for contro%s and static text. To he%p protect !our sites, !ou can precompi%e a 7e site to produce executa %e code from source fi%es ( oth code fi%es and the markup in .aspx site pages+. 8ou can then dep%o! the resu%ting output, which does not inc%ude an! source information, to a production server. Enhancements to '36.NET a%so inc%ude new too%s and c%asses to make 7e management easier for 7e site deve%opers, server administrators, and hosters. '36.NET accommodates a wide variet! of rowsers and devices. :! defau%t, contro%s render output

that is compati %e with 1;TM* 1.1 standards. 8ou can use device fi%tering to specif! different propert! va%ues on the same contro% for different rowsers.

Ravi Varma Thumati

Page 1

11/19/2013

Visual Studio.NET Best Articles Authenticated Streams 'pp%ications can use the new Negotiate3tream and 3s%3tream c%asses for authentication and to he%p secure information transmitted etween a c%ient and a server. These authenticated stream c%asses support mutua% authentication, data encr!ption, and data signing. The Negotiate3tream c%ass uses the Negotiate securit! protoco% for authentication. The 3s%3tream c%ass uses the 3ecure 3ocket *a!er (33*+ securit! protoco% for authentication. &)* +ntero% Ser,ices Enhancements Four ma<or enhancements have ).M= een made to the c%asses and too%s that support interopera i%it! with

The operating s!stem maintains a %imited num er of hand%es, which are used to reference critica% operating s!stem resources. The new 3afe;and%e and )ritica%;and%e c%asses, and their specia%i9ed derived c%asses, provide safe and re%ia %e means of manipu%ating operating s!stem hand%es.

Marsha%ing improvements make interoperating with native code easier. Two enhancements to the interop marsha%er satisf! the two most common user re>uests= the a i%it! to wrap native function pointers into de%egates and the a i%it! to marsha% fixed$si9e arra!s of structures inside structures.

The performance of ca%%s

etween app%ications in different app%ication domains has

een made

much faster for common ca%% t!pes.

New switches on the T!pe *i rar! ,mporter (T% imp.exe+ and T!pe *i rar! Exporter (T% exp.exe+ e%iminate dependenc! on the registr! to reso%ve t!pe %i rar! references. This enhancement is important for creating ro ust ui%d environments.

&onsole &lass Additions New mem ers of the )onso%e c%ass ena %e app%ications to manipu%ate the dimensions of the conso%e window and screen uffer? to move a rectangu%ar area of the screen uffer, which is usefu% for performing smooth, simp%e animation? and to wait whi%e reading conso%e input unti% a ke! is pressed. .ther new c%ass mem ers contro% the foreground and ackground co%ors of text, the visi i%it! and si9e of the cursor, and the fre>uenc! and duration of the conso%e eep. (ata #rotection A#+ The new /ata 6rotection '6, (/6'6,+ inc%udes four methods that a%%ow app%ications to encr!pt passwords, ke!s, connections strings, and so on, without ca%%ing p%atform invoke. 8ou can a%so encr!pt %ocks of memor! on computers running 7indows 3erver 200& or %ater operating s!stems. (e-u..er (is%la/ Attri-utes 8ou can now contro% how @isua% 3tudio disp%a!s a c%ass or mem er when an app%ication is information to disp%a! in the de ugger. eing

de ugged. The de uggerAs /isp%a! 'ttri utes feature ena %es !ou to identif! the most usefu%

Ravi Varma Thumati

Page 2

11/19/2013

Visual Studio.NET Best Articles (e-u..er Edit and &ontinue Su%%ort The .NET Framework 2.0 reintroduces the Edit and )ontinue feature that ena %es a user who is de ugging an app%ication in @isua% 3tudio to make changes to source code whi%e executing in :reak mode. 'fter source code edits are app%ied, the user can resume code execution and o serve the effect. Furthermore, the Edit and )ontinue feature is avai%a %e in an! programming %anguage supported ! @isua% 3tudio. (etectin. &han.es in Network &onnecti,it/ The Network)hange c%ass a%%ows app%ications to receive notification when the ,nternet 6rotoco% (,6+ address of a network interface, a%so known as a network card or adapter, changes. 'n interface address can change for a variet! of reasons, such as a disconnected network ca %e, moving out of range of a wire%ess %oca% area network, or hardware fai%ure. The Network)hange c%ass provides address change notification ! raising events when a change is detected. (istri-uted &om%utin. ,n the 3!stem.Net namespace, support has namespace now inc%udes a 7e een added for FT6 c%ient re>uests, caching of ;TT6

resources, automatic prox! discover!, and o taining network traffic and statistica% information. The server c%ass (;ttp*istener+ that !ou can use to create a simp%e 7e server for responding to ;TT6 re>uests. )%asses that generate network traffic have een instrumented to output trace information for app%ication de ugging and diagnostics. 3ecurit! and performance enhancements have een added to the S/stem.Net.Sockets.Socket and S/stem.0ri c%asses. ,n the S/stem.We-.Ser,ices namespaces, support for 3.'6 1.2 and nu%%a %e e%ements has added. ,n the S/stem.1untime.1emotin..&hannels namespaces, channe% securit! features have to etter support %oad a%ancing. E,ent'o. Enhancements 8ou can now use custom /**s for Event*og messages, parameters, and categories. E2%anded &erti$icate *ana.ement The .NET Framework now supports 1.50B certificate stores, chains, and extensions. ,n addition, !ou can sign and verif! 1M* using 1.50B certificates without using p%atform invoke. There is a%so support for 6C)3D signature and encr!ption, and )M3 (a superset of the 6C)3D standard avai%a %e on Microsoft 7indows 2000 and %ater operating s!stems+. 6C)3D is the under%!ing format used in 3ecure-Mu%tipurpose ,nternet Mai% Extensions (3-M,ME+ for signing and encr!pting data. For more information, see the 150B)ertificate2 c%ass topic. FT# Su%%ort 'pp%ications can now access Fi%e Transfer 6rotoco% resources using the 7e 2e>uest, 7e 2esponse, and 7e )%ient c%asses. een een

added. The T)6 channe% now supports authentication and encr!ption, as we%% as severa% new features

Ravi Varma Thumati

Page 3

11/19/2013

Visual Studio.NET Best Articles 3enerics and 3eneric &ollections The .NET Framework 2.0 introduces generics to a%%ow !ou to create f%exi %e, reusa %e code. *anguage features co%%ective%! known as generics act as temp%ates that a%%ow c%asses, structures, interfaces, methods, and de%egates to e dec%ared and defined with unspecified, or generic t!pe parameters instead of specific t!pes. 'ctua% t!pes are specified %ater when the generic is used. 3evera% namespaces, such as 3!stem Namespace and 3!stem.)o%%ections.Eeneric, provide generic c%asses and methods. The new S/stem.&ollections.3eneric namespace provides support for strong%! t!ped co%%ections. Eenerics are supported in three %anguages= @isua% :asic, )F, and )GG. 2ef%ection has inc%uding een extended to a%%ow runtime examination and manipu%ation of generic t!pes and een added to S/stem.T/%e and S/stem.1e$lection.*ethod+n$o, identif! generic t!pes (for examp%e, c%ass EenHT,0I J...K+, to

methods. New mem ers have ,sEenericT!pe

EetEeneric'rguments to o tain t!pe parameter %ists, and MakeEenericT!pe to create specific t!pes (for examp%e, new EenHint, %ongI(++. 3lo-ali4ation Five new g%o a%i9ation features provide greater support for deve%oping app%ications intended for different %anguages and cu%tures.

3upport for custom cu%tures ena %es !ou to define and dep%o! cu%ture$re%ated information as needed. This feature is usefu% for creating minor customi9ations of existing cu%ture definitions, and creating cu%ture definitions that do not !et exist in the .NET Framework. For more information, see the )u%ture'nd2egion,nfo:ui%der c%ass.

Encoding and decoding operations map a 0nicode character to or from a stream of can operation cannot e comp%eted, !ou can compensate

!tes that

e transferred to a ph!sica% medium such as a disk or a communication %ine. ,f a mapping ! using the new encoding and decoding

fa%% ack feature supported ! severa% c%asses in the 3!stem.Text namespace.

Mem ers in the 0TFLEncoding c%ass, which imp%ements 0TF$L encoding, are now severa% times faster than in previous re%eases. 0TF$L is the most common encoding used to transform 0nicode characters into !tes on computers.

The .NET Framework now supports the %atest norma%i9ation standard defined standard form so the representations can e compared for e>uiva%ence.

! the 0nicode

)onsortium. The norma%i9ation process converts character representations of text to a

The Eet)u%ture,nfo method over%oad provides a cached version of a read$on%! )u%ture,nfo o <ect. 0se the cached version when creating a new )u%ture,nfo o <ect to improve s!stem performance and reduce memor! usage.

+5) Enhancements ,mprovements have een made to the usa i%it! and functiona%it! of various ,-. c%asses. ,t is now

easier for users to read and write text fi%es and o tain information a out a drive.

Ravi Varma Thumati

Page 4

11/19/2013

Visual Studio.NET Best Articles 8ou can now use the c%asses in the 3!stem.,..)ompression namespace to read and write data with the EM,6 compression and decompression standard, descri ed in the ,ETF 2F) 1B51 and 2F) 1B52 specifications, which are avai%a %e at the ,ETF 2e>uest for )omments (2F)+ search page. Note= search is %imited to 2F) num ers. *ani$est"Based Acti,ation This feature provides new support for %oading and activating app%ications through the use of a manifest. Manifest$ ased activation is essentia% for supporting )%ick.nce app%ications. Traditiona%%!, app%ications are activated through a reference to an assem %! that contains the app%icationAs entr! point. For examp%e, c%icking an app%icationAs .exe fi%e from within the 7indows she%% causes the she%% to %oad the common %anguage runtime ()*2+ and ca%% a we%%$known entr! point within that .exe fi%eAs assem %!. The manifest$ ased activation mode% uses an app%ication manifest for activation rather than an assem %!. ' manifest fu%%! descri es the app%ication, its dependencies, securit! re>uirements, and so forth. The manifest mode% has severa% advantages over the assem %!$ ased activation mode%, especia%%! for 7e app%ications. For examp%e, the manifest contains the securit! re>uirements of the efore app%ication, which ena %es the user to decide whether to a%%ow the app%ication to execute

down%oading the code. The manifest a%so contains information a out the app%ication dependencies. Manifest$ ased activation is provided app%ications and add$ins descri ed and extensions to existing c%asses. This activation mode% a%so invokes an entit! ca%%ed a Trust Manager that performs the fo%%owing tasks= 1. /etermines whether an app%ication is a%%owed to prompting the user, >uer!ing po%ic!, or Trust Manager. 2. 3ets up the securit! context to run an app%ication in. Most common%!, this step invo%ves setting up a code access securit! ()'3+ po%ic! tree on the app%ication domain in which the app%ication wi%% run. . NET Framework 1emotin. . NET Framework remoting now supports ,6v" addresses and the exchange of generic t!pes. The c%asses in the 3!stem.2untime.2emoting.)hanne%s.Tcp namespace support authentication and encr!ption using the 3ecurit! 3upport 6rovider ,nterface (336,+. )%asses in the new 3!stem.2untime.2emoting.)hanne%s.,pc namespace a%%ow app%ications on the same computer to communicate >uick%! without using the network. Fina%%!, !ou can now configure the connection cache time$out and the num er of method retries, which can improve the performance of network %oad$ a%anced remote c%usters. )-tainin. +n$ormation A-out 'ocal &om%uter Network &on$i.uration and 0sa.e 0sing c%asses in the 3!stem.Net.Network,nformation namespace, app%ications can access ,6, ,6v#, ,6v", T)6, and 0/6 network traffic statistics. 'pp%ications can a%so view address and configuration e activated. This decision can e made ! ! a set of '6,s that a%%ow managed hosts to activate oth new c%asses

! a manifest. These '6,s contain a mixture of

! an! other means deemed appropriate for a given

Ravi Varma Thumati

Page 5

11/19/2013

Visual Studio.NET Best Articles information for the %oca% computerNs network adapters. This information is simi%ar to the information returned ! the ,pconfig.exe command$%ine too%. #in. The 6ing c%ass a%%ows an app%ication to determine whether a remote computer is accessi %e over the network. This c%ass provides functiona%it! simi%ar to the 6ing.exe command$%ine too%, and supports s!nchronous and as!nchronous ca%%s. #rocessin. 6TT# 1e7uests $rom Within A%%lications 8ou can use the ;ttp*istener c%ass to create a simp%e 7e server that responds to ;TT6 re>uests. The 7e server is active for the %ifetime of the ;ttp*istener o <ect and runs within !our app%ication, with !our app%icationAs permissions. This c%ass is avai%a %e on%! on computers running the 7indows 16 3ervice 6ack 2 or 7indows 3erver 200& operating s!stems. #ro.rammatic &ontrol o$ &achin. 0sing the c%asses in the 3!stem.Net.)ache namespace, app%ications can contro% the caching of resources o tained using the 7e 2e>uest, 7e 2esponse, and 7e )%ient c%asses. 8ou can use the predefined cache po%icies provided specif! a cache po%ic!. #ro.rammin. 'an.ua.es Four Microsoft programming %anguages exp%icit%! target the .NET Framework= @isua% )F, Microsoft )-)GG, @isua% OF, and @isua% :asic. ! the .NET Framework or specif! a custom cache po%ic!. 8ou can specif! a cache po%ic! for each re>uest and define a defau%t cache po%ic! for re>uests that do not

Ravi Varma Thumati

Page 6

11/19/2013

Das könnte Ihnen auch gefallen