42
Ofir Aspis 1/2010 www.bna.co.il [email protected]

Ofir Aspis 1/2010 [email protected]. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

Embed Size (px)

Citation preview

Page 1: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

Ofir Aspis 1/[email protected]

Page 2: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

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

Page 3: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

Audience

Featu

re S

et

Minimal

Complete

Hobbyist Enterprise

ProfessionalProfessional

UltimateUltimate

ExpressExpress

PremiumPremium

Page 4: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

VSTS Team Suitew/ MSDN PremiumVSTS Team Suite

w/ MSDN Premium

VSTS Development Ed.w/ MSDN Premium

VSTS Development Ed.w/ MSDN Premium

VSTS Database Ed.w/ MSDN PremiumVSTS Database Ed.w/ MSDN Premium

VSTS Test Ed.w/ MSDN Premium

VSTS Test Ed.w/ MSDN Premium

VSTS Architecture Ed.w/ MSDN Premium

VSTS Architecture Ed.w/ MSDN Premium

Visual Studio Professionalw/ MSDN Professional

Visual Studio Professionalw/ MSDN Premium

Visual Studio Professional

Visual Studio Standard

VS 2010 Ultimatew/ MSDN

VS 2010 Ultimatew/ MSDN

VS 2010 Premiumw/ MSDN

VS 2010 Premiumw/ MSDN

VS 2010 Professionalw/ MSDN

VS 2010 Professional

Page 5: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

Visual Studio 2010ProfessionalVisual Studio 2010Professional

New WPF EditorNew WPF Editor

Generate FromUsage

Generate FromUsage

Customizable IDECustomizable IDE

Silverlight ToolingSilverlight Tooling

Multi-CoreDevelopment

Multi-CoreDevelopment

CloudDevelopment

CloudDevelopment

WebDevelopment

WebDevelopment

WindowsDevelopment

WindowsDevelopment

OfficeDevelopment

OfficeDevelopment

SharePointDevelopment

SharePointDevelopment

Page 6: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

New Look & Feel

Web Deploy

web.config Transformation

Call Hierarchy

Inline Call Tree

Highlight References

Document Map Margin

Extensible Test Runner

WPF-based Editor

Sharepoint Tooling

JQuery Intellisense

HTML Snippets

Historical Debugging

Concurrency Profiler

Parallel Tasks Window

Parallel Stacks Window

Quick Search

Generate From Usage

Improved Multi-Monitor

MVC Tooling

Dynamic Data Tooling

Click-Once Enhancements for Office

64-bit Mixed-Mode

Minidump Debugging

Breakpoint Grouping

Breakpoint Labeling

Breakpoint Import/Export

New features, the tip of the iceberg…

Improved WPF Tooling

Page 7: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

Visual Studio As An Editor

Visual Studio As A Platform

Page 8: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

An improved focus on …

Writing code,

Understanding code,

Navigating code,

Publishing code

Page 9: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

Demo

Page 10: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

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

Page 11: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

Enabling the Visual Studio Ecosystem through:

Online Templates

Extensions and Extension Manager

All Contributable by Community

Page 12: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

Demo

Page 13: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

Beta 2, October 19th, 2009

RTM, March 22nd, 2010

Page 14: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending
Page 15: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

.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#

Page 16: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

Base Class LibrariesBase Class Libraries

The CLRJIT & NGENJIT & NGEN

Garbage CollectorGarbage Collector

Security Model

Security Model

Exception HandlingException Handling

Loader & Binder

Loader & Binder

WPFWPF Win FormsWin

Forms DLRDLR ASP.NETASP.NET WCFWCF And more!And more!LINQLINQ

Page 17: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

.NET 1.0.NET 1.0 .NET 1.1.NET 1.1 .NET 2.0.NET 2.0

3.03.0

3.53.5

.NET 4.NET 4

2002 2003 2008 CTP2005-08

CLR 1.0CLR 1.0 CLR 1.1CLR 1.1 CLR 2.0CLR 2.0 CLR 4CLR 4

SP1SP1

Page 18: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

Client ApplicationsClient Applications

WPF 4MEF

Web ApplicationsWeb Applications

Web Forms 4AJAX 4

Client/ServerClient/Server

WCF 4

Page 19: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

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

Page 20: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

Our managed languages are starting to share some very similar features:

Functional

Concise

Declarative

Page 21: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

Imperative Declarative

What

How

Page 22: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

Before

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;

}

Page 23: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

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

Page 24: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

Parallel LINQ (PLINQ) enables developers to easily leverage manycore with a minimal impact to 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        orderby p.Year ascending        select p;

var q = from p in people        where p.Name == queryInfo.Name && p.State == queryInfo.State && p.Year >= yearStart && p.Year <= yearEnd        orderby p.Year ascending        select p;

Page 25: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending
Page 26: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

C# 1.0C# 1.0

C# 2.0C# 2.0

C# 3.0C# 3.0

Managed Code

Generics

LINQ

C# 4.0C# 4.0

Dynamic

Page 27: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

1. Late-Binding Support

2. Named and Optional Parameters

3. Improved COM Interop

4. Covariance and Contravariance

Page 28: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

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

Page 29: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

Interop Assemblies translate between managed code and COM

For each interface, struct, enum, delegate, and member, contains a managed equivalent with marshalling data

Page 30: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

Primary Interop Assemblies cause many

pain points…

Page 31: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

1. Compilers embed the portions of the interop assemblies that the add-ins actually use

2. Runtime ensures the embedded definitions of these types are considered equivalent

Page 32: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending
Page 33: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

Common Language Runtime

Statically-Typed

C#VB

RubyPython

Dynamically-Typed

Page 34: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

Common Language Runtime

Statically-Typed

C#VB

RubyPython

Dynamically-Typed

Dynamic Language Runtime

Page 35: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

PythonBinderPythonBinder

RubyBinderRuby

BinderCOM

BinderCOM

BinderJScriptBinderJScriptBinder

ObjectBinderObjectBinder

Dynamic Language RuntimeDynamic Language Runtime

Expression TreesExpression TreesExpression TreesExpression Trees Dynamic Dynamic DispatchDispatchDynamic Dynamic DispatchDispatch Call Site CachingCall Site CachingCall Site CachingCall Site Caching

IronPython

IronPython IronRubyIronRuby C#C# VB.NETVB.NET Others…Others…

Page 36: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

Calculator calc = GetCalculator;)(int sum = calc.Add(10, 20);

object calc = GetCalculator;)(Type calcType = calc.GetType;)(

object res = calcType.InvokeMember("Add",

BindingFlags.InvokeMethod, null, new object[] { 10, 20 };)

int sum = Convert.ToInt32(res);

ScriptObject calc = GetCalculator;)(object res = calc.Invoke("Add", 10, 20);int sum = Convert.ToInt32(res);

dynamic calc = GetCalculator;)(int sum = calc.Add(10, 20);

Statically typed to be

dynamic

Statically typed to be

dynamic

Dynamic method

invocation

Dynamic method

invocation

Dynamic conversionDynamic

conversion

Page 37: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending
Page 38: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

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

Page 39: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

“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

Page 40: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

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)

Page 41: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

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

Page 42: Ofir Aspis 1/2010  ofir@bna.co.il. VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending

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