1. What is new in .NET 4.5
Robert MacLean
10th May 2012
2. Agenda
Focus on the framework
Not tooling - mostly
Visual Studio, TFS, Unit Testing
Nothing language specific
C# async
Nothing for Windows 8 development - mostly
.NET APIs for Metro Style Apps
3. Requirements
Client OS
Windows 7 and 8
Vista & XP NOT SUPPORTED!
Server OS
Windows Server 2008 SP 1 onwards
Windows Server 2008 SP 2 required for core profile support
Itanium not supported
5. Portable Class Libraries
Was out of band in 4.0
Allows single assembly to be used for
.NET 4.0 (WinForms, WPF, ASP.NET)
.NET 4.5 (WinForms, WPF, ASP.NET)
Silverlight 4
Silverlight 5
Windows Phone 7
Windows Phone 7.1
.NET for Metro Style Apps
Xbox 360
6. Portable Class Libraries Support
Feature Assemblies .NET Framework Metro style Silverligh Windows Xbox 360
t Phone
mscorlib.dll, System.dll, System.Core.dll,
Core System.Xml.dll, System.Xml.Serialization.dll
System.ComponentModel.Composition.dll
Managed Extensibility
Framework (MEF)
System.Net.dll
Network Class Library
(NCL)
System.Runtime.Serialization.dll
Serialization
System.ServiceModel.dll,
Windows Communication System.ServiceModel.Web.dll
Foundation (WCF)
System.Windows.dll
Model-View-View Model
(MVVM)
System.ComponentModel.DataAnnotations.
Data annotations dll
System.Xml.Linq.dll
LINQ to XML
Fully Some Not
Supported restrictions Supported
7. The Performance List
Arrays can be larger than 2Gb
Opt-in config setting & 64bit only
http://bit.ly/JaQXn8
GAC on servers is faster
ZIP is smaller
System.IO.Compression
ProfileOptimization
Improve JIT on n runs based on recorded data
n>1
8. Async
TPL massively improved
Up to 400% with a recompile
PLINQ gets more support for parallel
Example: OrderBy -> Take
Concurrent classes improve
~ 15% with recompiles
Parallel.Foreach can disable buffering
ThreadLocal<T>.Values
Timer based cancellations
TPL Dataflow
9. Improvements
Regex.MatchTimeout
Global (app domain) Culture settings
Consoles support UTF-16
String compare on Windows 8 uses the OS
compare
Sort versioning
.NET contains internal tables to do sorting, updated each release
.NET 2.0 SP 1 to .NET 4: Unicode 5
.NET 4.5 on Win7: Unicode 5
.NET 4.5 on Win8: Unicode 6
10. International Internet & Networking
Support for International Domain Names
Rules different depends on OS
Windows 8: RFC 5891
Windows 7: RFC 3490
Support for Email Address Internationalisation
Support for Dual-Stack Socket
Single socket that works for IPv4 or IPv6
Websockets
System.Net.Websockets
As William
14. WCF
Generate service & data contracts from WSDL
Support for Portable Class Libraries
Better configs (especially for clients)
Streaming changes
Async support
On IIS, buffering is removed – also means maxRequestLength is ignored
Default values updated
Most pushed to max
Visual Studio can validate config files
Binary encoding now can be compressed
UDP support
Multiple authentication support
Paste XML as classes
15. Workflow
VERSIONING
Minor improvements to activities
NoPersist
Flow chart display & unconnected validattion
Minor improvements to designer
Search
Automatic containers
Multi-select
Outline view
Annotations
Build time validation of workflow
C# Support
16. ASP.NET
Core
Unvalidated fields
Scenario: Input of HTML
Bundling & Minification of client scripts
JavaScript & CSS
Anti-XSS built in
Web Forms
Binding
Fallback support for CDNs
HTML 5 types