Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 7

ASP.

NET MVC 2 RTM Release Notes


Installation Notes......................................................................................................................... 2 Documentation............................................................................................................................ 2 Support........................................................................................................................................ 2 Upgrading an ASP.NET MVC 1. Pro!ect to ASP.NET MVC 2....................................................2 Ne" #eatures in $TM..................................................................................................................% Templated &elpers Allo" 'ou to Speci() E*tra Vie" Data.......................................................% +t,er Impro-ements ................................................................................................................% .ug #i*es..................................................................................................................................... % .rea/ing C,anges....................................................................................................................... % C,anges in ASP.NET MVC 2 $TM..........................................................................................% C,anges in ASP.NET MVC 2 $elease Candidate 2.................................................................% C,anges in ASP.NET MVC 2 $elease Candidate 1.................................................................0 C,anges in ASP.NET MVC 2 .eta...........................................................................................0 C,anges in ASP.NET MVC 2 Pre-ie" 2..................................................................................0 C,anges in ASP.NET MVC 2 Pre-ie" 1..................................................................................1 2no"n Issues.............................................................................................................................. 1 Disclaimer.................................................................................................................................... 3

ASP.NET MVC 2 $TM $elease Notes Cop)rig,t 4 2 1 Microso(t Corporation

Page 1

T,is document descri5es t,e release o( ASP.NET MVC 2 (or Visual Studio 2 6 SP1. #or a complete list o( ",at ,as c,anged since ASP.NET MVC 1. 7 see t,e document 8,at9s Ne" in ASP.NET MVC 2.

Installation Notes
T,e ASP.NET MVC 2 $TM (or Visual Studio 2 page: ,ttp:;;go.microso(t.com;("lin/;<=in/ID>113 30 ASP.NET MVC 2 can 5e installed and can run side?5)?side "it, ASP.NET MVC 1. . Note .ecause Visual Studio 2 6 and Visual Studio 2 1 $C s,are a component o( ASP.NET MVC 27 installing t,e ASP.NET MVC 2 $TM release on a computer ",ere Visual Studio 2 1 $C is also installed is not supported. 6 SP1 can 5e do"nloaded (rom t,e (ollo"ing

Documentation
Documentation (or ASP.NET MVC 27 ",ic, includes tutorials7 tec,nolog) o-er-ie"s7 code samples7 and API re(erence7 is a-aila5le on t,e MSDN 8e5 site. A good starting point is t,e topic ASP.NET Model Vie" Controller @MVCA @,ttp:;;go.microso(t.com;("lin/;<=in/Id>11B316A. Tutorials and ot,er in(ormation a5out ASP.NET MVC are also a-aila5le on t,e ASP.NET 8e5 site @,ttp:;;""".asp.net;m-c;A.

Support
#eel (ree to post Cuestions a5out "or/ing "it, t,is release to t,e ASP.NET MVC (orum7 ",ere mem5ers o( t,e ASP.NET communit) are (reCuentl) a5le to pro-ide in(ormal support.

Upgrading an ASP.NET MVC 1.0 Pro ect to ASP.NET MVC !


ASP.NET MVC 2 can 5e installed side 5) side "it, ASP.NET MVC 1. on t,e same ser-er7 ",ic, gi-es application de-elopers (le*i5ilit) in c,oosing ",en to upgrade an ASP.NET MVC 1. application to ASP.NET MVC 2. To upgrade an e*isting ASP.NET MVC 1. application7 see t,e document Upgrading an ASP.NET MVC 1. Application to ASP.NET MVC 2.

ASP.NET MVC 2 $TM $elease Notes Cop)rig,t 4 2 1 Microso(t Corporation

Page 2

Ne" #eatures in $TM


T,e (ollo"ing (eatures are ne" since t,e $C release o( ASP.NET MVC 2.

Templated %elpers Allo" &ou to Speci'( E)tra Vie" Data


ASP.NET MVC 2 no" includes ne" o-erloads o( t,e EditorFor and DisplayFor met,ods. T,ese o-erloads contain a parameter t,at accepts an anon)mous o5!ect t,at can 5e used to pro-ide e*tra -ie" data. T,e -ie" data pro-ided in t,is parameter is merged "it, an) e*isting -ie" data t,at is passed to t,e template.

*t+er Impro,ements
T,e (ollo"ing c,anges ,a-e 5een made to e*isting t)pes and mem5ers (or t,e ASP.NET MVC 2 $TM release. T,e UrlParmater.Optional propert) can 5e used to "or/ around pro5lems ",en 5inding to a model t,at contains an ID propert) ",en t,e propert) is a5sent in a (orm post. #or more detail7 see t,e entr) ASP.NET MVC 2 +ptional U$= Parameters on P,il &aac/9s 5log.

-ug #i)es
T,e (ollo"ing 5ugs ,a-e 5een (i*ed in t,e ASP.NET MVC 2 $TM release. #i*ed a 5ug t,at caused Internet E*plorer -ersions D7 37 and 6 @in compati5ilit) modeA to ,ang ",en client -alidation is used in certain scenarios.

-rea.ing C+anges
T,e (ollo"ing c,anges mig,t cause errors in e*isting ASP.NET MVC 1. applications.

C+anges in ASP.NET MVC ! $TM


No ne" 5rea/ing c,anges "ere introduced 5) t,e ASP.NET MVC 2 $TM release.

C+anges in ASP.NET MVC ! $elease Candidate !


E-er) propert) (or model o5!ects t,at use IDataErrorInfo to per(orm -alidation is -alidated7 regardless o( ",et,er a ne" -alue "as set. In ASP.NET MVC 1. 7 onl) properties t,at ,ad ne" -alues set "ould 5e -alidated. In ASP.NET MVC 27 t,e Error propert) o( IDataErrorInfo is called onl) i( all t,e propert) -alidators "ere success(ul.

ASP.NET MVC 2 $TM $elease Notes Cop)rig,t 4 2 1 Microso(t Corporation

Page %

C+anges in ASP.NET MVC ! $elease Candidate 1


IIS script mapping script is no longer a,aila/le in t+e installer

T,e IIS script mapping script is a command?line script t,at is used to con(igure script maps (or IIS D and (or IIS 3 in Classic mode. T,e script?mapping script is not needed i( )ou use t,e Visual Studio De-elopment Ser-er or i( )ou use IIS 3 in Integrated mode. T,e scripts are a-aila5le as a separate unsupported do"nload on t,e ASP.NET CodePle* site.
T+e %tml.Su/stitute +elper met+od in MVC #utures is no longer a,aila/le

Due to c,anges in t,e rendering 5e,a-ior o( MVC -ie" engines7 t,e Html.Substitute ,elper met,od does not "or/ and ,as 5een remo-ed.

C+anges in ASP.NET MVC ! -eta


T+e IValuePro,ider inter'ace replaces all uses o' IDictionar(0string1 ValuePro,ider$esult2

E-er) propert) or met,od argument t,at accepted IDictionary<string, aluePro!ider"esult# no" accepts I aluePro!ider. T,is c,ange a((ects onl) applications t,at include custom -alue pro-iders or custom model 5inders. E*amples o( properties and met,ods t,at are a((ected 5) t,is c,ange include t,e (ollo"ing: T,e aluePro!ider propert) o( t,e $ontroller%ase and &odel%inding$onte't classes. T,e (ryUpdate&odel met,ods o( t,e $ontroller class.

Ne" CSS classes "ere added in t+e Site.css 'ile t+at are used to st(le ,alidation messages.

T,e Site.css (ile in t,e ASP.NET MVC pro!ect templates ,as 5een updated to include ne" st)les used 5) t,e -alidation (unctionalit) and 5) t,e templated ,elpers.

C+anges in ASP.NET MVC ! Pre,ie" !


%elpers no" return an M,c%tmlString o/ ect

In order to ta/e ad-antage o( t,e ne" &TM=?encoding e*pression s)nta* in ASP.NET 07 t,e return t)pe (or &TM= ,elpers is no" &!cHtmlString instead o( a string. I( )ou use ASP.NET MVC 2 and t,e ne" ,elpers "it, ASP.NET %.17 )ou "ill not 5e a5le to ta/e ad-antage o( t,e &TM=?encoding s)nta*E t,e ne" s)nta* is a-aila5le onl) ",en )ou run ASP.NET MVC 2 on ASP.NET 0.
3son$esult no" responds onl( to %TTP P*ST re4uests

In order to mitigate FS+N ,i!ac/ing attac/s t,at ,a-e t,e potential (or in(ormation disclosure7 5) de(ault7 t,e )son"esult class no" responds onl) to &TTP P+ST reCuests. A!a* GET calls to

ASP.NET MVC 2 $TM $elease Notes Cop)rig,t 4 2 1 Microso(t Corporation

Page 0

action met,ods t,at return a )son"esult o5!ect s,ould 5e c,anged to use P+ST instead. I( necessar)7 )ou can o-erride t,is 5e,a-ior 5) setting t,e ne" )son"e*uest%e+a!ior propert) o( )son"esult. #or more in(ormation a5out t,e potential e*ploit7 see t,e 5log post FS+N &i!ac/ing on P,il &aac/9s 5log.
Model and ModelT(pe propert( setters on Model-indingConte)t are o/solete

A ne" setta5le &odel&etadata propert) ,as 5een added to t,e &odel%inding$onte't class. T,e ne" propert) encapsulates 5ot, t,e &odel and t,e &odel(ype properties. Alt,oug, t,e &odel and &odel(ype properties are o5solete7 (or 5ac/"ard compati5ilit) t,e propert) getters still "or/E t,e) delegate to t,e &odel&etadata propert) to retrie-e t,e -alue.

C+anges in ASP.NET MVC ! Pre,ie" 1


C+anges to t+e DefaultControllerFactory class /rea. custom controller 'actories t+at deri,e 'rom it

T,e Default$ontrollerFactory class "as (i*ed 5) remo-ing t,e "e*uest$onte't propert). In place o( t,is propert)7 t,e reCuest conte*t instance is passed to t,e protected -irtual ,et$ontrollerInstance and ,et$ontroller(ype met,ods. T,is c,ange a((ects custom controller (actories t,at deri-e (rom Default$ontrollerFactory. Custom controller (actories are o(ten used to pro-ide dependenc) in!ection (or ASP.NET MVC applications. To update t,e custom controller (actories to support ASP.NET MVC 27 c,ange t,e met,od signature or signatures to matc, t,e ne" signatures7 and use t,e reCuest conte*t parameter instead o( t,e propert).
5Area6 is a no" a reser,ed route7,alue .e(

T,e string HareaI in "oute -alues no" ,as special meaning in ASP.NET MVC7 in t,e same "a) t,at HcontrollerI and HactionI do. +ne implication is t,at i( &TM= ,elpers are supplied "it, a route?-alue dictionar) containing HareaI7 t,e ,elpers "ill no longer append HareaI in t,e Cuer) string. I( )ou are using t,e Areas (eature7 ma/e sure to not use -area. as part o( )our route U$=.

8no"n Issues
Visual Studio 2008 Installation: A(ter a success(ul install7 some temporar) (iles are le(t 5e,ind on )our computer in a (older named C:JTempJe*tNNNN7 ",ere NNNN is a random num5er. It is sa(e to delete t,is (older and its contents a(ter installation is complete. Visual Web Developer 2008 Express Installation: I( t,e de(ault installation location o( Visual 8e5 De-eloper 2 6 E*press "as c,anged during setup7 )ou mig,t ,a-e di((icult) installing t,e tooling component o( MVC ",en )ou use t,e .e*e installer. 'ou can "or/

ASP.NET MVC 2 $TM $elease Notes Cop)rig,t 4 2 1 Microso(t Corporation

Page 1

around t,is 5) e*tracting and running t,e .msi (ile (rom t,e .e*e (ile t,at installs t,e Visual 8e5 De-eloper components o( MVC. Unit test project does not contain reference to S!"NE# $V% 2 project: I( t,e Solution Explorer "indo" is ,idden in Visual Studio7 ",en )ou create a ne" ASP.NET MVC 2 8e5 application pro!ect and )ou select t,e option &es' create a unit test project in t,e %reate Unit #est !roject dialog 5o*7 t,e unit test pro!ect is created 5ut does not ,a-e a re(erence to t,e associated ASP.NET MVC 2 pro!ect. 8,en )ou 5uild t,e solution7 Visual Studio "ill displa) compilation errors and t,e unit tests "ill not run. T,ere are t"o "or/arounds. T,e (irst "or/around is to ma/e sure t,at t,e Solution Explorer is displa)ed ",en )ou create a ne" ASP.NET MVC 2 8e5 application pro!ect. I( )ou pre(er to /eep Solution Explorer ,idden7 t,e second "or/around is to manuall) add a pro!ect re(erence (rom t,e unit test pro!ect to t,e ASP.NET MVC 2 pro!ect.

ASP.NET MVC 2 $TM $elease Notes Cop)rig,t 4 2 1 Microso(t Corporation

Page D

Disclaimer
T,is is a preliminar) document and ma) 5e c,anged su5stantiall) prior to (inal commercial release o( t,e so(t"are descri5ed ,erein. T,e in(ormation contained in t,is document represents t,e current -ie" o( Microso(t Corporation on t,e issues discussed as o( t,e date o( pu5lication. .ecause Microso(t must respond to c,anging mar/et conditions7 it s,ould not 5e interpreted to 5e a commitment on t,e part o( Microso(t7 and Microso(t cannot guarantee t,e accurac) o( an) in(ormation presented a(ter t,e date o( pu5lication. T,is 8,ite Paper is (or in(ormational purposes onl). MIC$+S+#T MA2ES N+ 8A$$ANTIES7 EKP$ESS7 IMP=IED +$ STATUT+$'7 AS T+ T&E IN#+$MATI+N IN T&IS D+CUMENT. Compl)ing "it, all applica5le cop)rig,t la"s is t,e responsi5ilit) o( t,e user. 8it,out limiting t,e rig,ts under cop)rig,t7 no part o( t,is document ma) 5e reproduced7 stored in or introduced into a retrie-al s)stem7 or transmitted in an) (orm or 5) an) means @electronic7 mec,anical7 p,otocop)ing7 recording7 or ot,er"iseA7 or (or an) purpose7 "it,out t,e e*press "ritten permission o( Microso(t Corporation. Microso(t ma) ,a-e patents7 patent applications7 trademar/s7 cop)rig,ts7 or ot,er intellectual propert) rig,ts co-ering su5!ect matter in t,is document. E*cept as e*pressl) pro-ided in an) "ritten license agreement (rom Microso(t7 t,e (urnis,ing o( t,is document does not gi-e )ou an) license to t,ese patents7 trademar/s7 cop)rig,ts7 or ot,er intellectual propert). Unless ot,er"ise noted7 t,e e*ample companies7 organiLations7 products7 domain names7 e? mail addresses7 logos7 people7 places and e-ents depicted ,erein are (ictitious7 and no association "it, an) real compan)7 organiLation7 product7 domain name7 email address7 logo7 person7 place or e-ent is intended or s,ould 5e in(erred. 4 2 1 Microso(t Corporation. All rig,ts reser-ed. Microso(t and 8indo"s are eit,er registered trademar/s or trademar/s o( Microso(t Corporation in t,e United States and;or ot,er countries. T,e names o( actual companies and products mentioned ,erein ma) 5e t,e trademar/s o( t,eir respecti-e o"ners.

ASP.NET MVC 2 $TM $elease Notes Cop)rig,t 4 2 1 Microso(t Corporation

Page 3

You might also like