1 / 42

What’s new in Visual Studio 2010 .Net Framework 4.0 and C#4.0

What’s new in Visual Studio 2010 .Net Framework 4.0 and C#4.0. Ofir Aspis 1/2010 www.bna.co.il ofir@bna.co.il. Agenda. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending the IDE Web MVC 2 and TDD Break

Gabriel
Download Presentation

What’s new in Visual Studio 2010 .Net Framework 4.0 and C#4.0

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. What’s new in Visual Studio 2010.Net Framework 4.0 and C#4.0 Ofir Aspis 1/2010 www.bna.co.il ofir@bna.co.il

  2. Agenda • VS 2010 Targets • High Level - IDE New Features • VS 2010 As Editor and Platform • Demo • Editor features • Extending the IDE • Web MVC 2 and TDD • Break • What’s new in .Net Framework 4.0 and C# 4.0 • New Language Features • New Framework Application Blocks

  3. Visual Studio 2010 Targets Complete Ultimate Premium Feature Set Professional Express Minimal Hobbyist Enterprise Audience

  4. A New, Simplified SKU Structure VSTS Team Suite w/ MSDN Premium VS 2010 Ultimate w/ MSDN VSTS Development Ed. w/ MSDN Premium VSTS Database Ed. w/ MSDN Premium VS 2010 Premium w/ MSDN VSTS Architecture Ed. w/ MSDN Premium VSTS Test Ed. w/ MSDN Premium VS 2010 Professional w/ MSDN Visual Studio Professional w/ MSDN Premium Visual Studio Professional w/ MSDN Professional VS 2010 Professional Visual Studio Professional Visual Studio Standard

  5. High-Level Features Visual Studio 2010 Professional Web Development Windows Development Silverlight Tooling Office Development Customizable IDE SharePoint Development Generate From Usage Cloud Development New WPF Editor Multi-Core Development

  6. New features, the tip of the iceberg… Breakpoint Grouping Parallel Tasks Window New Look & Feel Extensible Test Runner Dynamic Data Tooling Generate From Usage Highlight References WPF-based Editor Breakpoint Labeling Click-Once Enhancements for Office Call Hierarchy Web Deploy Improved WPF Tooling Sharepoint Tooling Historical Debugging MVC Tooling Inline Call Tree Minidump Debugging Quick Search Concurrency Profiler JQuery Intellisense Breakpoint Import/Export Document Map Margin 64-bit Mixed-Mode Parallel Stacks Window HTML Snippets Improved Multi-Monitor web.config Transformation

  7. The Two Faces of Visual Studio 2010 Visual Studio As An Editor Visual Studio As A Platform

  8. … As An Editor An improved focus on… Writing code, Understanding code, Navigating code, Publishing code

  9. Demo

  10. … As A Platform New Extensible Editor allows editor to be easily extended to provide a rich and robust editing experience Online Visual Studio Gallery integrated directly into Visual Studio

  11. … As A Platform Enabling the Visual Studio Ecosystem through: Online Templates Extensions and Extension Manager All Contributable by Community

  12. Demo

  13. The VS2010 Roadmap • Beta 2, October 19th, 2009 • RTM, March 22nd, 2010

  14. What’s new in .Net 4.0and C# 4.0

  15. What’s new in .Net4.0 and C# 4.0 • .Net Framework - A Brief Review • .Net Framework 4.0 Highlights • Managed Extensibility Framework (MEF) • Managed Languages • C# 4.0 New Features • Dynamic Language Runtime (DLR) • F#

  16. The .NET Framework WPF Win Forms DLR ASP.NET WCF LINQ And more! Base Class Libraries The CLR JIT & NGEN Garbage Collector Security Model Exception Handling Loader & Binder

  17. A Look Back… SP1 3.5 3.0 .NET 1.0 .NET 1.1 .NET 2.0 .NET 4 2002 2003 2005-08 2008 CTP CLR 1.0 CLR 1.1 CLR 2.0 CLR 4

  18. Web Applications Client Applications Web Forms 4 AJAX 4 WPF 4 MEF Client/Server WCF 4

  19. Managed Extensibility Framework • The Managed Extensibility Framework (MEF) is a new library in the .NET Framework that enables greater reuse of applications and components. • Using MEF, .NET applications can make the shift from being statically compiled to dynamically composed

  20. Managed Languages Today Our managed languages are starting to share some very similar features: Functional Concise Declarative

  21. Why Declarative Matters… What How Imperative Declarative

  22. LINQ, The Power of Declarative IList<Person> FindParentsWithChildNamed(string childName) { var matches = new List<Person>(); foreach(var person in _people) { foreach(var child in person.Children) { if (child.Name.Equals(childName)) { matches.Add(person); break; } } } return matches; } Before

  23. LINQ, The Power of Declarative IList<Person> FindParentsWithChildNamed(string childName) { var matches = from person in people from child in person.Children where child.Name.Equals(childName) select person; return matches.ToList(); } After

  24. Parallel LINQ Parallel LINQ (PLINQ)enables developers to easily leveragemanycore with a minimal impactto existing LINQ programming model var q = from p in people         where p.Name == queryInfo.Name && p.State == queryInfo.State && p.Year >= yearStart && p.Year <= yearEnd orderbyp.Year ascending         select p; .AsParallel()

  25. Addressing Language Trends

  26. The Evolution of C# C# 4.0 Dynamic C# 3.0 LINQ C# 2.0 Generics C# 1.0 Managed Code

  27. New C# 4.0 Features • Late-Binding Support • Named and Optional Parameters • Improved COM Interop • Covariance and Contravariance

  28. Named and Optional Parameters • Consider this example: public void M(int x, int y = 5, int z = 7) { } • In this method, the parameters y and z are assigned default values. Calls to this method might look like this: M(1, 2, 3); // ordinary call of MM(1, 2); // omitting z – equivalent to M(1, 2, 7)M(1);  // omitting both y and z – equivalent to M(1, 5, 7)M(1, z: 3); // passing z by nameM(x: 1, z: 3); // passing both x and z by nameM(z: 3, x: 1); // reversing the order of arguments

  29. Type Equivalence Interop Assemblies translate between managed code and COM For each interface, struct, enum, delegate, and member, contains a managed equivalent with marshalling data

  30. However Primary Interop Assemblies cause many pain points…

  31. NO PIA • Compilers embed the portions of the interop assemblies that the add-ins actually use • Runtime ensuresthe embedded definitions of these types are considered equivalent

  32. Simplifying Your Code with C# 4.0

  33. Why a “Dynamic Language Runtime”? Dynamically-Typed Ruby Python Statically-Typed VB C# Common Language Runtime

  34. Why a “Dynamic Language Runtime”? Dynamically-Typed Ruby Python Statically-Typed VB Dynamic Language Runtime C# Common Language Runtime

  35. .NET Dynamic Programming IronPython IronRuby C# VB.NET Others… Dynamic Language Runtime Expression Trees Dynamic Dispatch Call Site Caching PythonBinder RubyBinder ObjectBinder JScriptBinder COMBinder

  36. Dynamically Typed Objects Calculator calc = GetCalculator(); int sum = calc.Add(10, 20); object calc = GetCalculator(); TypecalcType = calc.GetType(); object res = calcType.InvokeMember("Add", BindingFlags.InvokeMethod, null, newobject[] { 10, 20 }); int sum = Convert.ToInt32(res); ScriptObject calc = GetCalculator(); object res = calc.Invoke("Add", 10, 20); int sum = Convert.ToInt32(res); Statically typed to be dynamic dynamic calc = GetCalculator(); int sum = calc.Add(10, 20); Dynamic conversion Dynamic method invocation

  37. Dynamic Language Interop

  38. F# in VS2010 • F# is .NET managed programming language combining functional programming and object-oriented programming. • It’s ideally suited for parallel, algorithmic, technical and explorative development • F# is a strongly-typed language like C#, but with a lightweight syntax often seen in a dynamic language like Python

  39. F# Features • “Programming in The Small” with Tuples and functions • Simple, and more error-free asynchronous programming • Strong types for floating point code • Integrated with Visual Studio 2010

  40. Syntax Sample let data = (1,2,3) let rotations (x, y, z) = [ (x, y, z); (z, x, y); (y, z, x) ] let derivative f x = let p1 = f (x - 0.05) let p2 = f (x + 0.05) (p2 - p1) / 0.1 let f x = 2.0*x*x - 6.0*x + 3.0 let df = derivative f System.Console.WriteLine("The derivative of f at x=4 is {0}", df 4.0)

  41. Parallel and Asynchronous Programming with F# let http url = async { let req = WebRequest.Create(Uri url) let! resp = req.AsyncGetResponse() let stream = resp.GetResponseStream() let reader = new StreamReader(stream) let! contents = reader.AsyncReadToEnd() return contents } let sites = ["http://bing.com"; "http://microsoft.com"; "http://msdn.com"; "http://msnbc.com"] let htmlOfSites = Async.Parallel [for site in sites -> http(site)] |> Async.RunSynchronously

  42. RESOURCES • Visual Studio 2010/.NET Framework 4.0 Training Kit • November Preview: http://tinyurl.com/5zf8y8 • Visual Studio Topic Area on Channel 9 • http://channel9.msdn.com/visualstudio • Includes videos from VS2010 and VSTS2010 weeks on Channel 9 • VS2010/NETFX4 Futures on MSDN • http://msdn.microsoft.com/en-us/vs2008/products/cc948977.aspx

More Related