SlideShare a Scribd company logo
1 of 28
Visual Studio 2010, .NET 4, ASP.NET 4 & more… 13th April 2011
Agenda
Few things to note…. ,[object Object]
If you would like to share in our events, please write to us at prakuma@microsoft.com
Our team blog www.innovativesingapore.com,[object Object]
Agenda General Framework Updates  Base Class Library Updates C# - Language Innovations NO PIA – Inside look WPF Improvements Parallel Extensions Dynamic Language Runtime Not covering MEF Code Contracts …….
Journey so far… SP1 You’re here! 3.5 3.0 .NET 1.0 .NET 1.1 .NET 2.0 .NET 4 2002 2003 2008 CTP 2005-08 CLR 1.0 CLR 1.1 CLR 2.0 CLR 4
General Framework updates New client profile Smaller footprint Removes unnecessary libraries from client apps Default target framework for many project templates Side by side execution of .NET framework versions Out of Process – New Roll Forward Settings In Process - Important for hosting scenarios e.g. add-in frameworks
Runtime side-by-side(SxS) Out-of-process side-by-side(SxS) story Allows for good application compatibility Layered cake model Same story for .NET 4 Application can roll-forward to CLR v4.0 ,[object Object]
You must add a configuration file with a specific switch to get 3.5 apps to run on 4.0,[object Object]
CLR 4 - In-Process Side-By-Side ,[object Object]
Past : Only one CLR version in a process
Now: side-by-side CLR versions in a process2.0 add-in 3.0 add-in 3.5 add-in 4.0 add-in 3.5 .NET 4.0 3.0 .NET 2.0 Host Process (i.e. Outlook)
Base class library updates New classes and interfaces SortedSet Lazy<T>, IObservable<T>, Iobserver<T> Tuple, BigInteger, Complex System.IO.MemoryMappedFiles New or improved methods String.IsNullOrWhitespace String.Concat String.Join Stream.CopyTo Tail recursion optimization for x64 JIT Function calls itself at the end  e.g. fact n = n* fact(n-1);
Demo New BCL Types ,[object Object]
BigInteger,[object Object]
Co- and Contra-variance .NET arrays are co-variant string[] strings = GetStringArray(); Process(strings); …but not safelyco-variant void Process(object[] objects) { … } void Process(object[] objects) {    objects[0] = "Hello";       // Ok    objects[1] = newButton();  // Exception! } Until now, C# generics have been invariant List<string> strings = GetStringList(); Process(strings); C# 4.0 supports safe co- and contra-variance void Process(IEnumerable<object> objects) { … } void Process(IEnumerable<object> objects) { // IEnumerable<T> is read-only and // therefore safely co-variant }
Variance in C# 4.0 Supported for interface and delegate types “Statically checked definition-site variance” Value types are always invariant IEnumerable<int> is notIEnumerable<object> Similar to existing rules for arrays ref and out parameters need invariant type
Demo Co- and Contra-variance support for generics varVs dynamic
Primary Interop Assemblies (PIA) Interoperability matters “COM is not dead; COM is done” (Don Box) E.g. Office automation APIs Introduction of PIAs to bridge with COM Inter-op assemblies translate between managed code and COM The fun part (PIA pain points): Versioning headaches (publisher policy) Deployment horror of huge files (~MB) Also hard to create (TLBIMP, ILASM etc.) All kinds of Interop can be hard Visit clrinterop.codeplex.com for great tools
Go Away, PIA!  - NO PIA  Embedding of interop types and members Happens at compile time No need to redistribute the PIAs “Play for play” (only what you use gets copied) Behind the scenes Type Equivalence Gets specified using [TypeIdentifier] E.g. COM GUID can be used as identified Vtable gaps for interface compatibility
No-PIA behind the scenes var app = new Word.Application(); app.ActiveDocument.Save();      _Document interface [TypeIdentifier] [Guid(…)] Interface _Document { void Save(); void _VtblGap1_168(); }
Demo ,[object Object]
Type Equivalence,[object Object]
Demo WPF – DataGrid
Parallel Extensions for .NET Parallel task library Provides task based model for executing code asynchronously Takes advantage of multiple cores and advances algorithms Provide model for cancellation, continuation, exception handling etc. The preferred way to execute async work in .NET System.Threading.Tasks.Parallel class AsParallel extension methods ForEach and ForEach<T>() Parallel LINQ Parallel implementation of LINQ to objects Merge options – how to bring the results back together
Demo Parallel ForEach Parallel LINQ Task Continuation
Dynamic Language Runtime Call dynamic languages from .NET Enable scripting of your application Take advantage of dynamic language features from .NET  Call .NET from dynamic languages  Take advantage of the BCL Two main types / keywords in the framework Dynamic – Enables late binding to objects ExpandoObject – dynamically add members (prop, method, event) Framework doesn’t include scripting engine Download full DLR and appropriate language to interoperate http://dlr.codeplex.com

More Related Content

What's hot

Next18 Extended Targu Mures - Bringing the Cloud to you
Next18 Extended Targu Mures - Bringing the Cloud to youNext18 Extended Targu Mures - Bringing the Cloud to you
Next18 Extended Targu Mures - Bringing the Cloud to youMárton Kodok
 
Developing Web Sites and Services using Visual Studio 2013
Developing Web Sites and Services using Visual Studio 2013Developing Web Sites and Services using Visual Studio 2013
Developing Web Sites and Services using Visual Studio 2013Microsoft Visual Studio
 
SharePoint Framework SPFx
SharePoint Framework SPFxSharePoint Framework SPFx
SharePoint Framework SPFxVladimir Medina
 
Azure servicefabric
Azure servicefabricAzure servicefabric
Azure servicefabricAbhishek Sur
 
Technology Roadmap by ericnel
Technology Roadmap by ericnelTechnology Roadmap by ericnel
Technology Roadmap by ericnelEric Nelson
 
Microsoft .NET Development Platform Internationalization
Microsoft .NET Development Platform InternationalizationMicrosoft .NET Development Platform Internationalization
Microsoft .NET Development Platform InternationalizationRishi Kothari
 
Microsoft� .NET and Microsoft� Office 2003
Microsoft� .NET and Microsoft� Office 2003Microsoft� .NET and Microsoft� Office 2003
Microsoft� .NET and Microsoft� Office 2003Rishi Kothari
 
Carbon Webinar
Carbon WebinarCarbon Webinar
Carbon WebinarWSO2
 
Polyglot Persistence in Azure
Polyglot Persistence in AzurePolyglot Persistence in Azure
Polyglot Persistence in AzureMarco Parenzan
 
Microservices with Azure Service Fabric
Microservices with Azure Service FabricMicroservices with Azure Service Fabric
Microservices with Azure Service FabricDavide Benvegnù
 
Spring tutorials
Spring tutorialsSpring tutorials
Spring tutorialsTIB Academy
 
AUG Belgium - Introduction to ColdFusion 9
AUG Belgium - Introduction to ColdFusion 9AUG Belgium - Introduction to ColdFusion 9
AUG Belgium - Introduction to ColdFusion 9Cyril Hanquez
 
Build Apps Using Dynamic Languages
Build Apps Using Dynamic LanguagesBuild Apps Using Dynamic Languages
Build Apps Using Dynamic LanguagesWes Yanaga
 
Forms, ADF and JET a Non-Aggression Pact
Forms, ADF and JET a Non-Aggression PactForms, ADF and JET a Non-Aggression Pact
Forms, ADF and JET a Non-Aggression Pactandrejusb
 
Concepts of Asp.Net
Concepts of Asp.NetConcepts of Asp.Net
Concepts of Asp.Netvidyamittal
 
BizSpark migreren naar de cloud
BizSpark migreren naar de cloudBizSpark migreren naar de cloud
BizSpark migreren naar de cloudDelta-N
 
Continuous Delivery of ML-Enabled Pipelines on Databricks using MLflow
Continuous Delivery of ML-Enabled Pipelines on Databricks using MLflowContinuous Delivery of ML-Enabled Pipelines on Databricks using MLflow
Continuous Delivery of ML-Enabled Pipelines on Databricks using MLflowDatabricks
 
REPORT ON ASP.NET
REPORT ON ASP.NETREPORT ON ASP.NET
REPORT ON ASP.NETLOKESH
 

What's hot (20)

Next18 Extended Targu Mures - Bringing the Cloud to you
Next18 Extended Targu Mures - Bringing the Cloud to youNext18 Extended Targu Mures - Bringing the Cloud to you
Next18 Extended Targu Mures - Bringing the Cloud to you
 
Developing Web Sites and Services using Visual Studio 2013
Developing Web Sites and Services using Visual Studio 2013Developing Web Sites and Services using Visual Studio 2013
Developing Web Sites and Services using Visual Studio 2013
 
SharePoint Framework SPFx
SharePoint Framework SPFxSharePoint Framework SPFx
SharePoint Framework SPFx
 
Azure servicefabric
Azure servicefabricAzure servicefabric
Azure servicefabric
 
Technology Roadmap by ericnel
Technology Roadmap by ericnelTechnology Roadmap by ericnel
Technology Roadmap by ericnel
 
Microsoft .NET Development Platform Internationalization
Microsoft .NET Development Platform InternationalizationMicrosoft .NET Development Platform Internationalization
Microsoft .NET Development Platform Internationalization
 
Microsoft� .NET and Microsoft� Office 2003
Microsoft� .NET and Microsoft� Office 2003Microsoft� .NET and Microsoft� Office 2003
Microsoft� .NET and Microsoft� Office 2003
 
Carbon Webinar
Carbon WebinarCarbon Webinar
Carbon Webinar
 
Polyglot Persistence in Azure
Polyglot Persistence in AzurePolyglot Persistence in Azure
Polyglot Persistence in Azure
 
Microservices with Azure Service Fabric
Microservices with Azure Service FabricMicroservices with Azure Service Fabric
Microservices with Azure Service Fabric
 
Spring tutorials
Spring tutorialsSpring tutorials
Spring tutorials
 
ASP.NET OVERVIEW
ASP.NET OVERVIEWASP.NET OVERVIEW
ASP.NET OVERVIEW
 
Azure Service Fabric
Azure Service FabricAzure Service Fabric
Azure Service Fabric
 
AUG Belgium - Introduction to ColdFusion 9
AUG Belgium - Introduction to ColdFusion 9AUG Belgium - Introduction to ColdFusion 9
AUG Belgium - Introduction to ColdFusion 9
 
Build Apps Using Dynamic Languages
Build Apps Using Dynamic LanguagesBuild Apps Using Dynamic Languages
Build Apps Using Dynamic Languages
 
Forms, ADF and JET a Non-Aggression Pact
Forms, ADF and JET a Non-Aggression PactForms, ADF and JET a Non-Aggression Pact
Forms, ADF and JET a Non-Aggression Pact
 
Concepts of Asp.Net
Concepts of Asp.NetConcepts of Asp.Net
Concepts of Asp.Net
 
BizSpark migreren naar de cloud
BizSpark migreren naar de cloudBizSpark migreren naar de cloud
BizSpark migreren naar de cloud
 
Continuous Delivery of ML-Enabled Pipelines on Databricks using MLflow
Continuous Delivery of ML-Enabled Pipelines on Databricks using MLflowContinuous Delivery of ML-Enabled Pipelines on Databricks using MLflow
Continuous Delivery of ML-Enabled Pipelines on Databricks using MLflow
 
REPORT ON ASP.NET
REPORT ON ASP.NETREPORT ON ASP.NET
REPORT ON ASP.NET
 

Viewers also liked

CTU June 2011 - Reporting Services with SharePoint 2010
CTU June 2011 - Reporting Services with SharePoint 2010CTU June 2011 - Reporting Services with SharePoint 2010
CTU June 2011 - Reporting Services with SharePoint 2010Spiffy
 
Microsoft and the Cloud - John Fernandes
Microsoft and the Cloud - John FernandesMicrosoft and the Cloud - John Fernandes
Microsoft and the Cloud - John FernandesSpiffy
 
Proactive project management_with_microsoft_visual_studio_2010
Proactive project management_with_microsoft_visual_studio_2010Proactive project management_with_microsoft_visual_studio_2010
Proactive project management_with_microsoft_visual_studio_2010Spiffy
 
LightUp SharePoint with Silverlight
LightUp SharePoint with SilverlightLightUp SharePoint with Silverlight
LightUp SharePoint with SilverlightSpiffy
 
NELSON KRAUCAK - ANTI-AGING MEDICINE
NELSON KRAUCAK - ANTI-AGING MEDICINENELSON KRAUCAK - ANTI-AGING MEDICINE
NELSON KRAUCAK - ANTI-AGING MEDICINEdrnelsonkraucak
 
01 server manager spiffy
01 server manager spiffy01 server manager spiffy
01 server manager spiffySpiffy
 

Viewers also liked (6)

CTU June 2011 - Reporting Services with SharePoint 2010
CTU June 2011 - Reporting Services with SharePoint 2010CTU June 2011 - Reporting Services with SharePoint 2010
CTU June 2011 - Reporting Services with SharePoint 2010
 
Microsoft and the Cloud - John Fernandes
Microsoft and the Cloud - John FernandesMicrosoft and the Cloud - John Fernandes
Microsoft and the Cloud - John Fernandes
 
Proactive project management_with_microsoft_visual_studio_2010
Proactive project management_with_microsoft_visual_studio_2010Proactive project management_with_microsoft_visual_studio_2010
Proactive project management_with_microsoft_visual_studio_2010
 
LightUp SharePoint with Silverlight
LightUp SharePoint with SilverlightLightUp SharePoint with Silverlight
LightUp SharePoint with Silverlight
 
NELSON KRAUCAK - ANTI-AGING MEDICINE
NELSON KRAUCAK - ANTI-AGING MEDICINENELSON KRAUCAK - ANTI-AGING MEDICINE
NELSON KRAUCAK - ANTI-AGING MEDICINE
 
01 server manager spiffy
01 server manager spiffy01 server manager spiffy
01 server manager spiffy
 

Similar to .NET 4 Demystified - Sandeep Joshi

Visual Studio .NET2010
Visual Studio .NET2010Visual Studio .NET2010
Visual Studio .NET2010Satish Verma
 
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...Maarten Balliauw
 
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...Maarten Balliauw
 
Building scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thriftBuilding scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thriftTalentica Software
 
Microservices for building an IDE – The innards of JetBrains Rider - TechDays...
Microservices for building an IDE – The innards of JetBrains Rider - TechDays...Microservices for building an IDE – The innards of JetBrains Rider - TechDays...
Microservices for building an IDE – The innards of JetBrains Rider - TechDays...Maarten Balliauw
 
Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...IndicThreads
 
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0Antonio Chagoury
 
Overview of VS2010 and .NET 4.0
Overview of VS2010 and .NET 4.0Overview of VS2010 and .NET 4.0
Overview of VS2010 and .NET 4.0Bruce Johnson
 
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for DevelopersMSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for DevelopersDave Bost
 
Visual Studio 2010 and .NET 4.0 Overview
Visual Studio 2010 and .NET 4.0 OverviewVisual Studio 2010 and .NET 4.0 Overview
Visual Studio 2010 and .NET 4.0 Overviewbwullems
 
Visual Studio.NET
Visual Studio.NETVisual Studio.NET
Visual Studio.NETsalonityagi
 
What’s New and Hot in .NET 4.0
What’s New and Hot in .NET 4.0What’s New and Hot in .NET 4.0
What’s New and Hot in .NET 4.0Jess Chadwick
 
.NET and C# introduction
.NET and C# introduction.NET and C# introduction
.NET and C# introductionPeter Gfader
 

Similar to .NET 4 Demystified - Sandeep Joshi (20)

Visual Studio .NET2010
Visual Studio .NET2010Visual Studio .NET2010
Visual Studio .NET2010
 
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
 
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
 
Building scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thriftBuilding scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thrift
 
Microservices for building an IDE – The innards of JetBrains Rider - TechDays...
Microservices for building an IDE – The innards of JetBrains Rider - TechDays...Microservices for building an IDE – The innards of JetBrains Rider - TechDays...
Microservices for building an IDE – The innards of JetBrains Rider - TechDays...
 
Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...
 
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0
 
Overview of VS2010 and .NET 4.0
Overview of VS2010 and .NET 4.0Overview of VS2010 and .NET 4.0
Overview of VS2010 and .NET 4.0
 
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for DevelopersMSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
 
Visual Studio 2010 and .NET 4.0 Overview
Visual Studio 2010 and .NET 4.0 OverviewVisual Studio 2010 and .NET 4.0 Overview
Visual Studio 2010 and .NET 4.0 Overview
 
Visual studio.net
Visual studio.netVisual studio.net
Visual studio.net
 
Visual Studio.NET
Visual Studio.NETVisual Studio.NET
Visual Studio.NET
 
What’s New and Hot in .NET 4.0
What’s New and Hot in .NET 4.0What’s New and Hot in .NET 4.0
What’s New and Hot in .NET 4.0
 
.NET and C# introduction
.NET and C# introduction.NET and C# introduction
.NET and C# introduction
 
Intro dotnet
Intro dotnetIntro dotnet
Intro dotnet
 
Intro dotnet
Intro dotnetIntro dotnet
Intro dotnet
 
Intro dotnet
Intro dotnetIntro dotnet
Intro dotnet
 
Intro dotnet
Intro dotnetIntro dotnet
Intro dotnet
 
Introduction to c_sharp
Introduction to c_sharpIntroduction to c_sharp
Introduction to c_sharp
 
.Net language support
.Net language support.Net language support
.Net language support
 

More from Spiffy

Active Directory Upgrade
Active Directory UpgradeActive Directory Upgrade
Active Directory UpgradeSpiffy
 
Checking the health of your active directory enviornment
Checking the health of your active directory enviornmentChecking the health of your active directory enviornment
Checking the health of your active directory enviornmentSpiffy
 
Agile in Action - Act 2: Development
Agile in Action - Act 2: DevelopmentAgile in Action - Act 2: Development
Agile in Action - Act 2: DevelopmentSpiffy
 
Agile in Action - Act 3: Testing
Agile in Action - Act 3: TestingAgile in Action - Act 3: Testing
Agile in Action - Act 3: TestingSpiffy
 
Agile in Action - Keynote: Becoming and Being Agile - What Does This Mean?
Agile in Action - Keynote: Becoming and Being Agile - What Does This Mean?Agile in Action - Keynote: Becoming and Being Agile - What Does This Mean?
Agile in Action - Keynote: Becoming and Being Agile - What Does This Mean?Spiffy
 
Agile in Action - Act 1 (Set Up, Planning, Requirements and Architecture)
Agile in Action - Act 1 (Set Up, Planning, Requirements and Architecture)Agile in Action - Act 1 (Set Up, Planning, Requirements and Architecture)
Agile in Action - Act 1 (Set Up, Planning, Requirements and Architecture)Spiffy
 
MS TechDays 2011 - WCF Web APis There's a URI for That
MS TechDays 2011 - WCF Web APis There's a URI for ThatMS TechDays 2011 - WCF Web APis There's a URI for That
MS TechDays 2011 - WCF Web APis There's a URI for ThatSpiffy
 
MS TechDays 2011 - NUI, Gooey and Louie
MS TechDays 2011 - NUI, Gooey and LouieMS TechDays 2011 - NUI, Gooey and Louie
MS TechDays 2011 - NUI, Gooey and LouieSpiffy
 
MS TechDays 2011 - Mango, Mango! Developing for Windows Phone 7
MS TechDays 2011 - Mango, Mango! Developing for Windows Phone 7MS TechDays 2011 - Mango, Mango! Developing for Windows Phone 7
MS TechDays 2011 - Mango, Mango! Developing for Windows Phone 7Spiffy
 
MS TechDays 2011 - Generate Revenue on Azure
MS TechDays 2011 - Generate Revenue on AzureMS TechDays 2011 - Generate Revenue on Azure
MS TechDays 2011 - Generate Revenue on AzureSpiffy
 
MS TechDays 2011 - HTML 5 All the Awesome Bits
MS TechDays 2011 - HTML 5 All the Awesome BitsMS TechDays 2011 - HTML 5 All the Awesome Bits
MS TechDays 2011 - HTML 5 All the Awesome BitsSpiffy
 
MS TechDays 2011 - Cloud Computing with the Windows Azure Platform
MS TechDays 2011 - Cloud Computing with the Windows Azure PlatformMS TechDays 2011 - Cloud Computing with the Windows Azure Platform
MS TechDays 2011 - Cloud Computing with the Windows Azure PlatformSpiffy
 
MS TechDays 2011 - Simplified Converged Infrastructure Solutions
MS TechDays 2011 - Simplified Converged Infrastructure SolutionsMS TechDays 2011 - Simplified Converged Infrastructure Solutions
MS TechDays 2011 - Simplified Converged Infrastructure SolutionsSpiffy
 
MS TechDays 2011 - SCDPM 2012 The New Feature of Data Protection
MS TechDays 2011 - SCDPM 2012 The New Feature of Data ProtectionMS TechDays 2011 - SCDPM 2012 The New Feature of Data Protection
MS TechDays 2011 - SCDPM 2012 The New Feature of Data ProtectionSpiffy
 
MS TechDays 2011 - Microsoft Exchange Server and Office 365 Hybrid Deployment
MS TechDays 2011 - Microsoft Exchange Server and Office 365 Hybrid DeploymentMS TechDays 2011 - Microsoft Exchange Server and Office 365 Hybrid Deployment
MS TechDays 2011 - Microsoft Exchange Server and Office 365 Hybrid DeploymentSpiffy
 
MS TechDays 2011 - How to Run Middleware in the Cloud Story of Windows Azure ...
MS TechDays 2011 - How to Run Middleware in the Cloud Story of Windows Azure ...MS TechDays 2011 - How to Run Middleware in the Cloud Story of Windows Azure ...
MS TechDays 2011 - How to Run Middleware in the Cloud Story of Windows Azure ...Spiffy
 
MS TechDays 2011 - Cloud Management with System Center Application Controller
MS TechDays 2011 - Cloud Management with System Center Application ControllerMS TechDays 2011 - Cloud Management with System Center Application Controller
MS TechDays 2011 - Cloud Management with System Center Application ControllerSpiffy
 
MS TechDays 2011 - Virtualization Solutions to Optimize Performance
MS TechDays 2011 - Virtualization Solutions to Optimize PerformanceMS TechDays 2011 - Virtualization Solutions to Optimize Performance
MS TechDays 2011 - Virtualization Solutions to Optimize PerformanceSpiffy
 
MS TechDays 2011 - Automating Your Infrastructure System Center Orchestrator ...
MS TechDays 2011 - Automating Your Infrastructure System Center Orchestrator ...MS TechDays 2011 - Automating Your Infrastructure System Center Orchestrator ...
MS TechDays 2011 - Automating Your Infrastructure System Center Orchestrator ...Spiffy
 
MS TechDays 2011 - Self-Service Private Cloud Management through Integrated P...
MS TechDays 2011 - Self-Service Private Cloud Management through Integrated P...MS TechDays 2011 - Self-Service Private Cloud Management through Integrated P...
MS TechDays 2011 - Self-Service Private Cloud Management through Integrated P...Spiffy
 

More from Spiffy (20)

Active Directory Upgrade
Active Directory UpgradeActive Directory Upgrade
Active Directory Upgrade
 
Checking the health of your active directory enviornment
Checking the health of your active directory enviornmentChecking the health of your active directory enviornment
Checking the health of your active directory enviornment
 
Agile in Action - Act 2: Development
Agile in Action - Act 2: DevelopmentAgile in Action - Act 2: Development
Agile in Action - Act 2: Development
 
Agile in Action - Act 3: Testing
Agile in Action - Act 3: TestingAgile in Action - Act 3: Testing
Agile in Action - Act 3: Testing
 
Agile in Action - Keynote: Becoming and Being Agile - What Does This Mean?
Agile in Action - Keynote: Becoming and Being Agile - What Does This Mean?Agile in Action - Keynote: Becoming and Being Agile - What Does This Mean?
Agile in Action - Keynote: Becoming and Being Agile - What Does This Mean?
 
Agile in Action - Act 1 (Set Up, Planning, Requirements and Architecture)
Agile in Action - Act 1 (Set Up, Planning, Requirements and Architecture)Agile in Action - Act 1 (Set Up, Planning, Requirements and Architecture)
Agile in Action - Act 1 (Set Up, Planning, Requirements and Architecture)
 
MS TechDays 2011 - WCF Web APis There's a URI for That
MS TechDays 2011 - WCF Web APis There's a URI for ThatMS TechDays 2011 - WCF Web APis There's a URI for That
MS TechDays 2011 - WCF Web APis There's a URI for That
 
MS TechDays 2011 - NUI, Gooey and Louie
MS TechDays 2011 - NUI, Gooey and LouieMS TechDays 2011 - NUI, Gooey and Louie
MS TechDays 2011 - NUI, Gooey and Louie
 
MS TechDays 2011 - Mango, Mango! Developing for Windows Phone 7
MS TechDays 2011 - Mango, Mango! Developing for Windows Phone 7MS TechDays 2011 - Mango, Mango! Developing for Windows Phone 7
MS TechDays 2011 - Mango, Mango! Developing for Windows Phone 7
 
MS TechDays 2011 - Generate Revenue on Azure
MS TechDays 2011 - Generate Revenue on AzureMS TechDays 2011 - Generate Revenue on Azure
MS TechDays 2011 - Generate Revenue on Azure
 
MS TechDays 2011 - HTML 5 All the Awesome Bits
MS TechDays 2011 - HTML 5 All the Awesome BitsMS TechDays 2011 - HTML 5 All the Awesome Bits
MS TechDays 2011 - HTML 5 All the Awesome Bits
 
MS TechDays 2011 - Cloud Computing with the Windows Azure Platform
MS TechDays 2011 - Cloud Computing with the Windows Azure PlatformMS TechDays 2011 - Cloud Computing with the Windows Azure Platform
MS TechDays 2011 - Cloud Computing with the Windows Azure Platform
 
MS TechDays 2011 - Simplified Converged Infrastructure Solutions
MS TechDays 2011 - Simplified Converged Infrastructure SolutionsMS TechDays 2011 - Simplified Converged Infrastructure Solutions
MS TechDays 2011 - Simplified Converged Infrastructure Solutions
 
MS TechDays 2011 - SCDPM 2012 The New Feature of Data Protection
MS TechDays 2011 - SCDPM 2012 The New Feature of Data ProtectionMS TechDays 2011 - SCDPM 2012 The New Feature of Data Protection
MS TechDays 2011 - SCDPM 2012 The New Feature of Data Protection
 
MS TechDays 2011 - Microsoft Exchange Server and Office 365 Hybrid Deployment
MS TechDays 2011 - Microsoft Exchange Server and Office 365 Hybrid DeploymentMS TechDays 2011 - Microsoft Exchange Server and Office 365 Hybrid Deployment
MS TechDays 2011 - Microsoft Exchange Server and Office 365 Hybrid Deployment
 
MS TechDays 2011 - How to Run Middleware in the Cloud Story of Windows Azure ...
MS TechDays 2011 - How to Run Middleware in the Cloud Story of Windows Azure ...MS TechDays 2011 - How to Run Middleware in the Cloud Story of Windows Azure ...
MS TechDays 2011 - How to Run Middleware in the Cloud Story of Windows Azure ...
 
MS TechDays 2011 - Cloud Management with System Center Application Controller
MS TechDays 2011 - Cloud Management with System Center Application ControllerMS TechDays 2011 - Cloud Management with System Center Application Controller
MS TechDays 2011 - Cloud Management with System Center Application Controller
 
MS TechDays 2011 - Virtualization Solutions to Optimize Performance
MS TechDays 2011 - Virtualization Solutions to Optimize PerformanceMS TechDays 2011 - Virtualization Solutions to Optimize Performance
MS TechDays 2011 - Virtualization Solutions to Optimize Performance
 
MS TechDays 2011 - Automating Your Infrastructure System Center Orchestrator ...
MS TechDays 2011 - Automating Your Infrastructure System Center Orchestrator ...MS TechDays 2011 - Automating Your Infrastructure System Center Orchestrator ...
MS TechDays 2011 - Automating Your Infrastructure System Center Orchestrator ...
 
MS TechDays 2011 - Self-Service Private Cloud Management through Integrated P...
MS TechDays 2011 - Self-Service Private Cloud Management through Integrated P...MS TechDays 2011 - Self-Service Private Cloud Management through Integrated P...
MS TechDays 2011 - Self-Service Private Cloud Management through Integrated P...
 

.NET 4 Demystified - Sandeep Joshi

  • 1. Visual Studio 2010, .NET 4, ASP.NET 4 & more… 13th April 2011
  • 3.
  • 4. If you would like to share in our events, please write to us at prakuma@microsoft.com
  • 5.
  • 6. Agenda General Framework Updates Base Class Library Updates C# - Language Innovations NO PIA – Inside look WPF Improvements Parallel Extensions Dynamic Language Runtime Not covering MEF Code Contracts …….
  • 7. Journey so far… SP1 You’re here! 3.5 3.0 .NET 1.0 .NET 1.1 .NET 2.0 .NET 4 2002 2003 2008 CTP 2005-08 CLR 1.0 CLR 1.1 CLR 2.0 CLR 4
  • 8. General Framework updates New client profile Smaller footprint Removes unnecessary libraries from client apps Default target framework for many project templates Side by side execution of .NET framework versions Out of Process – New Roll Forward Settings In Process - Important for hosting scenarios e.g. add-in frameworks
  • 9.
  • 10.
  • 11.
  • 12. Past : Only one CLR version in a process
  • 13. Now: side-by-side CLR versions in a process2.0 add-in 3.0 add-in 3.5 add-in 4.0 add-in 3.5 .NET 4.0 3.0 .NET 2.0 Host Process (i.e. Outlook)
  • 14. Base class library updates New classes and interfaces SortedSet Lazy<T>, IObservable<T>, Iobserver<T> Tuple, BigInteger, Complex System.IO.MemoryMappedFiles New or improved methods String.IsNullOrWhitespace String.Concat String.Join Stream.CopyTo Tail recursion optimization for x64 JIT Function calls itself at the end e.g. fact n = n* fact(n-1);
  • 15.
  • 16.
  • 17. Co- and Contra-variance .NET arrays are co-variant string[] strings = GetStringArray(); Process(strings); …but not safelyco-variant void Process(object[] objects) { … } void Process(object[] objects) { objects[0] = "Hello"; // Ok objects[1] = newButton(); // Exception! } Until now, C# generics have been invariant List<string> strings = GetStringList(); Process(strings); C# 4.0 supports safe co- and contra-variance void Process(IEnumerable<object> objects) { … } void Process(IEnumerable<object> objects) { // IEnumerable<T> is read-only and // therefore safely co-variant }
  • 18. Variance in C# 4.0 Supported for interface and delegate types “Statically checked definition-site variance” Value types are always invariant IEnumerable<int> is notIEnumerable<object> Similar to existing rules for arrays ref and out parameters need invariant type
  • 19. Demo Co- and Contra-variance support for generics varVs dynamic
  • 20. Primary Interop Assemblies (PIA) Interoperability matters “COM is not dead; COM is done” (Don Box) E.g. Office automation APIs Introduction of PIAs to bridge with COM Inter-op assemblies translate between managed code and COM The fun part (PIA pain points): Versioning headaches (publisher policy) Deployment horror of huge files (~MB) Also hard to create (TLBIMP, ILASM etc.) All kinds of Interop can be hard Visit clrinterop.codeplex.com for great tools
  • 21. Go Away, PIA! - NO PIA Embedding of interop types and members Happens at compile time No need to redistribute the PIAs “Play for play” (only what you use gets copied) Behind the scenes Type Equivalence Gets specified using [TypeIdentifier] E.g. COM GUID can be used as identified Vtable gaps for interface compatibility
  • 22. No-PIA behind the scenes var app = new Word.Application(); app.ActiveDocument.Save(); _Document interface [TypeIdentifier] [Guid(…)] Interface _Document { void Save(); void _VtblGap1_168(); }
  • 23.
  • 24.
  • 25. Demo WPF – DataGrid
  • 26. Parallel Extensions for .NET Parallel task library Provides task based model for executing code asynchronously Takes advantage of multiple cores and advances algorithms Provide model for cancellation, continuation, exception handling etc. The preferred way to execute async work in .NET System.Threading.Tasks.Parallel class AsParallel extension methods ForEach and ForEach<T>() Parallel LINQ Parallel implementation of LINQ to objects Merge options – how to bring the results back together
  • 27. Demo Parallel ForEach Parallel LINQ Task Continuation
  • 28. Dynamic Language Runtime Call dynamic languages from .NET Enable scripting of your application Take advantage of dynamic language features from .NET Call .NET from dynamic languages Take advantage of the BCL Two main types / keywords in the framework Dynamic – Enables late binding to objects ExpandoObject – dynamically add members (prop, method, event) Framework doesn’t include scripting engine Download full DLR and appropriate language to interoperate http://dlr.codeplex.com
  • 29.
  • 30. .NET USER GROUP http://www.sgdotnet.org My .NET Facebook Group - DOTNetGeeks

Editor's Notes

  1. MESSAGING:Run both 2.0-based and 4.0-based CLR in the same processOld components use old CLRNew components use new CLR Configuration file and hosting APIs give you fine-grained control
  2. MESSAGING:Office has thousands of APIs for addins exposed through COM. But COM was designed for native code. Interop Assemblies help “translate” between managed and native code by containing all the marshalling data necessary to make communication possible. For each interface, struct, enum, delegate, and member, contains a managed equivalent with marshalling data.MESSAGING:Let’s look at Office as an example. Add-ins in Excel, for instance, may very well need to talk to each other -&gt; Because they have to talk to each other, they have to be using the same types for Excel -&gt; Because of the way the type system works in the CLR, these types must also be in the same assembly -&gt; So, the assembly is required to be in a common location (e.g. the GAC) in order for the add-ins to function properly.Well, Office currently does not require the .NET Framework to be installed on a machine. If a machine doesn’t have .NET installed, there’s no GAC, and hence nothing to deploy the PIA into. Herein lies the problem. Even if an add-in is only using a single function, enum, etc. from the interop assembly, the add-in must deploy the entire PIA along with itself. Office PIA is around 10-20mb, it’s HUGE. So you might have a 100k add-in “bringing along” a 20mb PIA.
  3. MESSAGING:There are two primary things that enable PIAs to be buried, forever, never to rise again. Compiler enhancements (this embedding works down to the method level even, so even a full interface is not required).Runtime enhancementsEven though they are in different assembliesEven though they may have different subsetsHence, type equivalence allows two interfaces, enums, delegates and plain-old-data-structures to mark themselves as equivalent with each other.
  4. MESSAGING:PLINQ is a technology that allows developers to _easily_ leveragemanycore. The great thing about PLINQ is that if you are using LINQ-to-objects, there is a very minimal impact to your code in order for it to use PLINQ. All it takes to use PLINQ is adding “.AsParallel()” to your query. This will turn the query into a PLINQ query and will use the PLINQ execution engine when executed.One small change, and your code now takes advantage of all the hardware available to you.NOTES:AsParallel() works by returning an IParallelEnumerable so every subsequent query operator works against the new IParallelEnumerable rather than the normal IEnumerable. See the hands-on lab for Parallel Extensions for more details.