340 likes | 456 Views
Was ist neu in .NET 4.5?. Ken Casada Technical Evangelist, Microsoft Switzerland kcasada@microsoft.com. Quick Reminder – What is .NET?. Entity Frame-work. ASP. NET. WCF. WPF. Win Forms. Work Flow. And more!. The CLR. Base Class Libraries. Profiling& Debugging APIs. JIT & NGEN.
E N D
Was ist neu in .NET 4.5? Ken Casada Technical Evangelist, Microsoft Switzerland kcasada@microsoft.com
Quick Reminder – What is .NET? Entity Frame-work ASP. NET WCF WPF Win Forms Work Flow And more! The CLR Base Class Libraries Profiling& Debugging APIs JIT & NGEN Garbage Collector Security Model Exception Handling Loader & Binder
.NET Versions .NET Framework 4.5 is an in-place update You get it automatically with Windows 8 and Windows Server 2012 3.5 4.5 3.0 .NET 1.0 .NET 1.1 .NET 2.0 .NET 4.0 -12 2002 2003 2005 2010 -08 CLR 1.0 CLR 1.1 CLR 2.0 CLR 4.0
Migrating to .NET 4.5 Steps: • Migrate your existing apps to .NET 4.0 • If everything OK Migrate to .NET 4.5 • Refer to .NET 4.5 Migration Guidance (http://msdn.microsoft.com/en-us/library/ff657133.aspx)
Language Improvements Chapter 1/6
C# and VB evolution C# 5.0 + VB 11.0 Windows 8 Runtime + Asynchrony C# 4.0 + VB 10.0 Dynamic + (Language Parity) C# 3.0 + VB 9.0 Language Integrated Query C# 2.0 + VB 8.0 Generics C# 1.0 + VB 7.0 Managed Code
Asynchronous programming is becoming the norm in modern, connected applications
DEMO Async
DEMO Summary What is async? • A new easier way to write connected apps • Two new keywords: Await and Async in VB and C# • A new Task based design pattern for APIs • A new set of .NET Framework APIs
Entity Framework Chapter 2/6
Entity Framework Evolution EF 1 • Shipped with .NET 3.5 SP1 • Features: Basic ORM support Database First Workflow EF 4 • Shipped with .NET 4.0 and Visual Studio 2010 • Features: Model First Workflow POCO, FKs, Lazy Loading, T4 Code Generation, …
Developer Workflows Designer Centric New Database • Model First • Create .edmx model in designer • Generate database from .edmx • Classes auto-generated from .edmx Existing Database • Database First • Reverse engineer .edmx model • Classes auto-generated from .edmx
Developer Workflows Designer Centric Code Centric New Database • Model First • Create .edmx model in designer • Generate database from .edmx • Classes auto-generated from .edmx • Code First • Define classes & mapping in code • Database auto-created at runtime Existing Database • Database First • Reverse engineer .edmx model • Classes auto-generated from .edmx • Code First • Define classes & mapping in code(Reverse engineer tools available)
DEMO Code First
Entity Framework Migrations • Product • Id: int • Name: 128 • UnitPrice: decimal • Product • Id: int • Name: max • UnitPrice: decimal ChangeColumn( “Products", "Name", ca => ca.String( maxLength:128)); code change update-database add-migration
DEMO Migrations
Entity Framework 5 Features only with .NET 4.5 apps • Enums • Spatial Types • Table-Valued Functions • Sprocs with multiple result sets • Automatic compiled LINQ To Entities queries (by just upgrading to .NET 4.5, 6x faster) with both .NET 4.0 and .NET 4.5 apps • CodeFirst and Migrations • Query optimization improvements • Multiple Diagram Support (Visual Studio 2012 feature)
Entity Framework 4.5 Resources Learning Resources Main MSDN Page http://msdn.com/ef ASP.NET + EF Tutorials http://www.asp.net/entity-framework/tutorials Blogs ADO.NET Team Blog http://blogs.msdn.com/adonet/ EF Design Blog http://blogs.msdn.com/efdesign/ Releases EF Power Tools Beta 2 (VS2012 Tools menu Extensions and updates) http://blogs.msdn.com/b/adonet/archive/2012/04/09/ef-power-tools-beta-2-available.aspx EF 6.0 Alpha 1 http://blogs.msdn.com/b/adonet/archive/2012/10/30/ef6-alpha-1-available-on-nuget.aspx
ASP.NET Chapter 3/6
ASP.NET Core Runtime and Framework Performance • Performance Improvements for ASP.NET Web Hosting • Faster ASP.NET Startup (multi-core JIT compilation sharing common assemblies) • Reduced memory footprint • Up to 35% performance in combination with Windows Server 2012(prefetching feature) More Info: http://www.asp.net/vnext/overview/whitepapers/whats-new#_Toc_perf
ASP.NET Bundling and Minification Today AfterapplyingBundling and Minification More Info: http://weblogs.asp.net/scottgu/archive/2011/11/27/new-bundling-and-minification-support-asp-net-4-5-series.aspx
ASP.NET Web Form Main Improvements • HTML 5 Updates • Ex: TextModeproperty of the TextBox control supportsnew HTML 5 input types like email, datetime • ValidatorControlsnowsupport Unobstrusive JavaScript for client-side validation logic • HTML Encoded Data-BindingExpressions • Strongly Type Data Controls • Model Binding
DEMO ASP.NET Web Form Strongly Type Data Controls Model Binding
ASP.NET MVC 4 Main Improvements • Fresh HTML 5 default projecttemplates • Built-in support for mobile sites • New Mobile projecttemplate • Based on Jquery Mobile (for touch-optimized UI) More Info: http://www.asp.net/whitepapers/mvc4-release-notes
DEMO ASP.NET MVC 4
WPF Chapter 4/6
WPF Main Improvements • Ribbon control • Improved performance whendisplaying large amount of data • MVVM Improvements • Designer improvements: VS2012 has the same design engine as Expression Blend More Info: http://msdn.microsoft.com/en-us/library/bb613588(v=vs.110).aspx
WCF Chapter 5/6
WCF Configuration improvements • Tooltip, Intellisense and compile-time validation in config files (VS 2012) • Generated client config files cleaned: only non-default binding configuration will be generated WebSocket support for WCF based Services • Just with W8 • New Binding: NetHttpBinding and NetHttpsBinding New UDP Binding (fire and forget) • Tip: no out-of-the-box support in .NET 4.0 (sample for that)
WCF Typical WSDL file generated from a WCF service Inside WSDL definition additional files are being referenced (import directives)
WCF New in WCF 4.5: support for flat WSDL file …all info are available in 1 single file (good for interoperability)
WF Chapter 6/6
Workflow • Versioning • Contract First Services • C# Expressions • State machines (*) • Runtime Performance • Designer Improvements • Performance • Usability • Better Integration with VS (*) part of Update 4.0.3 for Microsoft .NET Framework 4: Runtime update (http://support.microsoft.com/kb/2600214) More Info: http://msdn.microsoft.com/en-us/library/hh305677(v=vs.110).aspx