visual studio 2008 and the.net framework v3.5 gill cleeren microsoft regional director
TRANSCRIPT
Who do you see in front of you?Name: Gill CleerenAge: 29Company: Ordina BelgiumFunction:
@Ordina:Software Architect Lead Developer
@Microsoft: Regional DirectorMVP ASP.NET
Blog: www.snowball.be and www.codeflakes.netEmail: [email protected]
Agenda
• The evolution of .NET• A Tour around Visual Studio 2008 and .NET 3.5
• IDE enhancements• Language Enhancements• Web Development• Services (Workflow and Communication Foundation)• Client and Mobile Development• Office Development
• .NET Framework 3.5 new assemblies• Questions & Answers
Agenda
• The evolution of .NET• A Tour around Visual Studio 2005 and .NET 3.5
• IDE enhancements• Language Enhancements• Web Development• Services (Workflow and Communication Foundation)• Client and Mobile Development• Office Development
• .NET Framework 3.5 new assemblies• Questions & Answers
.NET Through the Ages
2002 2003 2005 2006 2007
Tool(Visual Studio) VS.NET 2002 VS.NET 2003 VS2005
VS2005+
ExtensionsVS2008
Languages C# v1.0VB.NET (v7.0)
C# v1.1VB.NET (v7.1)
C# v2.0VB2005 (v8.0) as before
C# v3.0VB9
Framework Libraries NetFx v1.0 NetFx v1.1 NetFx v2.0 NetFx v3.0 NetFx v3.5
Engine (CLR) CLR v1.0 CLR v1.1 CLR v2.0 same version
same version
Team system Team system
Visual Studio in the year 2008
Visual Studio 2005
+ Service Pack 1 + SP1 Update
for Vista
+ WF Extensions + WPF & WCF
Extensions
+ SharePoint Workflow
+ Visual Studio Tools for Office Second
Edition
+ ASP.NET AJAX Extensions
+ Device Emulator v2.0 + .NETCF v2.0
SP2
+ WM 5.0 Pocket PC SDK + WM5.0
Smartphone SDK
Visual Studio 2008
2006 2007 2008
.NET Framework - VS Roadmap
“Rosario”
• VS Extensions for WF• VS Extensions for WCF/WPF CTP
ASP.NET AJAX 1.0
SQL Server 2008 ADO.NET Entity
Framework
•VS 2008 Beta 2•.NET Framework 3.5 Beta 2
3.0 RTM
3.5 RTM
What is the .NET Framework 3.5?
.NET Framework 2.0 + SP1
Windows Presentatio
n Foundation
Windows Communicati
on Foundation
Windows Workflow
Foundation
Windows CardSpace
.NET Framework 3.0 + SP1
.NET Framework 3.5
LINQ ASP.NET 3.5CLR Add-in Framework
Additional Enhancemen
ts
Agenda
• The evolution of .NET• A Tour around Visual Studio 2008 and .NET 3.5
• IDE enhancements• Language Enhancements• Web Development• Services (Workflow and Communication Foundation)• Client and Mobile Development• Office Development
• .NET Framework 3.5 new assemblies• Questions & Answers
Visual Studio 2008 Highlights
• Side-by-Side support• Works side-by-side with Visual Studio
2005
• Multi-target Support• .NET framework version 2.0, 3.0 and 3.5• No project model or build changes• Solution can contain projects with
different targets• Enables organizations to move to Visual
Studio 2008 without upgrading all of your source code
VB9
Compiler Features
Most are LINQ enablers
XML Literals
Relaxed Delegates
C# 3.0
Extension Methods
Object Initialisers
Anonymous Types
Local Type Inference
Lambda expressions
Collection Initializers
Partial Methods
Automatic Properties
If Ternary Operator
Nullable Syntax
Lambda statements
C# 3.0 Language Innovations
var contacts = from c in customers where c.State == "WA" select new { c.Name, c.Phone };
var contacts = customers .Where(c => c.State == "WA") .Select(c => new { c.Name, c.Phone });
Extension methods
Lambda expressions
Query expressions
Object initializers
Anonymous types
Local variable type
inference
Expression trees
Automatic properties
Partial methods
string name = “Bart”;string reversed = MyExtensions.Reverse(name);
Extension methods• Add methods to existing types “virtually”
• Static method with first “this” parameter• Scoping using namespaces
static class MyExtensions { public static string Reverse(string s) { char[] c = s.ToCharArray(); Array.Reverse(c); return new string(c); }}
string name = “Bart”;string reversed = name.Reverse();
static class MyExtensions { public static string Reverse(this string s) { char[] c = s.ToCharArray(); Array.Reverse(c); return new string(c); }}
Promoted first parameter
Automatic properties• Tired of writing properties?
• Compiler can generate the get/set plumbing
class Customer { private string _name; public string Name { get { return _name; }; set { _name = value; }; }}
class Customer { public string Name { get; set; }}
Setter required; can be private or internal
Object initializers• Ever found the constructor of your taste?
• Insufficient overloads, so pick one• Call various property setters
class Customer { public string Name { get; set; } public int Age { get; set; }}
Customer c = new Customer();c.Name = “Bart”;c.Age = 24;
var c = new Customer(){ Name = “Bart”, Age = 24};
Can be combined with any constructor call
Collection initializers• Arrays easier to initialize than collections?!
int[] ints = new int[] { 1, 2, 3 };List<int> lst = new List<int>();lst.Add(1);lst.Add(2);lst.Add(3);
int[] ints = new int[] { 1, 2, 3 };var lst = new List<int>() { 1, 2, 3 };
Works for any ICollection class by calling its Add
method
Anonymous types• Let the compiler cook up a type
• Can’t be returned from a method• Local variable type inference becomes a must• Used in LINQ query projections
var person = new { Name = “Bart”, Age = 24 };
var customer = new { Id = id, person.Name };
Infers the name of the target property by looking at
the rhs
Lambda expressions• Functional-style anonymous methods
delegate R BinOp<A,B,R>(A a, B b);
int Calc(BinOp<int, int, int> f, int a, int b){ return f(a, b)}
int result = Calc( delegate (int a, int b) { return a + b; }, 1, 2);
var result = Calc((a, b) => a + b, 1, 2);
Parameter types inferred based on the target
delegate
First, A Taste of LINQusing System;using System.Query;using System.Collections.Generic; class app { static void Main() {
string[] names = { "Burke", "Connor", "Frank", "Everett", "Albert", "George",
"Harris", "David" }; var expr = from s in names where s.Length == 5 orderby s select s.ToUpper(); foreach (string item in expr) Console.WriteLine(item); }}
BURKEDAVIDFRANK
Query Expressions
• Introduce SQL-Like Syntax to Language• Compiled to Traditional C# (via Extension Methods)
from itemName in srcExprjoin itemName in srcExpr on keyExpr equals keyExpr
(into itemName)?let itemName = selExprwhere predExprorderby (keyExpr (ascending | descending)?)*select selExprgroup selExpr by keyExpr into itemName query-body
LINQ Architecture
LINQ-enabled data sources
LINQ To Objects
LINQ To XML
LINQ-enabled ADO.NET
Visual Basic Others
LINQ To Entities
LINQ To SQL
LINQ To Datasets
.Net Language Integrated Query (LINQ)
Visual C#
Objects
<book> <title/> <author/> <price/></book>
XMLDatabases
LINQ Architecture
LINQ-enabled data sources
LINQ To Objects
LINQ To XML
LINQ-enabled ADO.NET
Visual Basic Others
LINQ To Entities
LINQ To SQL
LINQ To Datasets
.Net Language Integrated Query (LINQ)
Visual C#
Objects
<book> <title/> <author/> <price/></book>
XMLDatabases
using System;using System.Query;using System.Collections.Generic; class app { static void Main() { string[] names = { "Allen", "Arthur",
"Bennett" }; IEnumerable<string> ayes = names
.Where(s => s[0] == 'A'); foreach (string item in ayes)
Console.WriteLine(item); names[0] = "Bob"; foreach (string item in ayes)
Console.WriteLine(item); }}
Arthur
LINQ to Objects• Native query
syntax in C# and VB• IntelliSense• Autocompletion
• Query Operators can be used against any .NET collection (IEnumerable<T>)• Select, Where,
GroupBy, Join, etc.• Deferred Query
Evaluation• Lambda
Expressions
using System;using System.Query;using System.Collections.Generic; class app { static void Main() { string[] names = { "Allen", "Arthur",
"Bennett" }; IEnumerable<string> ayes = names
.Where(s => s[0] == 'A'); foreach (string item in ayes)
Console.WriteLine(item); names[0] = "Bob"; foreach (string item in ayes)
Console.WriteLine(item); }}
AllenArthur
using System;using System.Query;using System.Collections.Generic; class app { static void Main() { string[] names = { "Burke", "Connor",
"Frank", "Everett", "Albert", "George",
"Harris", "David" }; IEnumerable<string> expr =
from s in names where s.Length == 5 orderby s select s.ToUpper(); foreach (string item in expr) Console.WriteLine(item); }}
BURKEDAVIDFRANK
using System;using System.Query;using System.Collections.Generic; class app { static void Main() { string[] names = { "Burke", "Connor",
"Frank", "Everett", "Albert", "George",
"Harris", "David" }; Func<string, bool> filter = s => s.Length == 5; Func<string, string> extract = s => s; Func<string, string> project = s = s.ToUpper(); IEnumerable<string> expr = names
.Where(filter)
.OrderBy(extract) .Select(project); foreach (string item in expr) Console.WriteLine(item); }}
BURKEDAVIDFRANK
LINQ Architecture
LINQ-enabled data sources
LINQ To Objects
LINQ To XML
LINQ-enabled ADO.NET
Visual Basic Others
LINQ To Entities
LINQ To SQL
LINQ To Datasets
.Net Language Integrated Query (LINQ)
Visual C#
Objects
<book> <title/> <author/> <price/></book>
XMLDatabases
LINQ to SQL Architecture
Application
LINQ to SQL
SQL Server
from c in db.Customerswhere c.City == "London"select c.CompanyName
Enumerate
SELECT CompanyNameFROM CustomerWHERE City = 'London'
SQL Queryor SProc
Rows
Objects
db.Customers.Add(c1);c2.City = “Seattle";db.Customers.Remove(c3);
SubmitChanges()
INSERT INTO Customer …UPDATE Customer …DELETE FROM Customer …
DML or SProcs
Web Applications
• ASP.NET 3.5• Microsoft AJAX libraries and project templates• ListView, DataPager, LinqDataSource
• Visual Studio 2008 IDE Enhancements• New HTML Designer• Shared with Expression Web• Rich CSS support, Nested Master Pages• Split view with better switching performance• Javascript IntelliSense and Debugging
HTML Designer
• New Split View mode• View source and design side by side• Updates in real-time
• Dramatically faster than previous versions• Switch between design, source, or split view with no lag.
CSS Designer
• Dramatically simplifies building and managing CSS styles.• Intuitive visual designer• Summary mode helps troubleshoot/trackdown where styles
are being applied.• Shares same CSS engine as Expression Web
• Developers and designers have access to same features.
ListView
• New data-bound control• Evolution of DataList and Repeater• Designer-friendly
• Full control over markup, including container• Use CSS to style layout
• Bind arbitrary elements (e.g. <select>)
DataPager
• Follows extender model• Add paging to any control that supports it (e.g.
ListView)• Flexible layout – choose from a number of fields to
create a customized pager
ASP.NET AJAX
• Increased productivity• Fewer concepts, fewer lines of code
• Easier to author, debug, and maintain• Well integrated with design and development tools
• Seamlessly integrated application model• Works with ASP.NET pages and server controls
• Works everywhere – cross-browser, standards based
A framework for building richer, more interactive, more personalized web experiences.
Windows Applications
• Windows Forms• ClickOnce improvements• Consume ASP.NET Provider Services• ASP.NET login, roles and profiles• Caching
• Consume WCF Services in Partial Trust• Host WPF controls and Content (and vice versa)
• Windows Presentation Foundation• XAML• Visual Designer Integrated into Visual Studio• XBAP deployment to FireFox
Mobile Applications
• NETCF v2.0 SP2 and v3.5
• Unit Testing• Cert manager• Config Manager• Device Emulator 3.0• CoreCon wrapper• WM5 SDKs
• C#3 and VB9• LINQ • WCF• CLR Profiler / RPM• Compression• Client-side certs• Sound APIs
Services (WF and WCF)
• Windows Communication Foundation• HTTP without SOAP
• XML or JSON serialisation• Syndication• RSS + ATOM Support
• Partial Trust Support
• Windows Workflow Foundation• WCF Send/Receive• WorkflowServiceHost
Office Business Applications• 2003 & 2007 Support
• 2007 Customisations• Document Level• Application Level• Office Ribbon Designer• Outlook Form Region Designer• Custom & Action Task Panes• Word Content Controls• ClickOnce Deployment and improved Security• VBA <-> VSTO interop• Workflow and SharePoint support
Extend the Office Ribbon• New Look and Feel for Office UI
• Replaces Command Bars in “the big 5” Office apps• Introduces a new extensibility model called RibbonX• Enables you to:
• Customize tabs• Add to built-in tabs• Remove tabs, groups, controls• Add to Office menu• Override built-in UI
TabGroup
Control
Rib
bon
Extend the Office Ribbon• Visual Ribbon Designer• Office built-in support for XML-based customization model• VSTO 2005 SE support:• Simplifies hookup from .NET via pre-generated classes and sample XML
• VSTO – Visual Studio 2007 support: • Adds full-blown visual designer support• “Export to XML” option• A more robust programming layer
Property Grid
Ribbon Control Toolbox
Design Surface
Extend the Office RibbonRibbon XML structure requires a specific hierarchy
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="OnLoad"> <ribbon> <tabs> <tab idMso="TabAddIns"> <group id="MyGroup" label="My Group"> <toggleButton id="toggleButton1" size="large" label="My Button" screentip="My Button Screentip" onAction="OnToggleButton1" imageMso="AccessFormModalDialog" /> </group> </tab> </tabs> </ribbon></customUI>
For example:
Create Custom Task & Actions Panes• VSTO simplifies and speeds up task pane UI
design process with visual designers and .NET hookup• Actions Pane: • Associated with a specific Word or Excel
document• More robust, easier to program alternative to
Office’s built-in “Smart Document” technology• Custom Task Pane: • The same general idea as Actions Pane, only
on the application add-in level, not individual doc
Agenda
• The evolution of .NET• A Tour around Visual Studio 2005 and .NET 3.5
• IDE enhancements• Language Enhancements• Web Development• Services (Workflow and Communication Foundation)• Client and Mobile Development• Office Development
• .NET Framework 3.5 new assemblies• Questions & Answers
Framework v3.5 New assemblies• System.Core.dll• System.Data.Linq.dll• System.Xml.Linq.dll• System.Data.DataSetExtensions.dll• System.Web.Extensions.dll• System.WorkflowServices.dll• System.ServiceModel.Web.dll• System.AddIn.dll, System.AddIn.Contract.dll• System.Windows.Presentation.dll• System.Net.dll• System.DirectoryServices.AccountManagement.dll• System.Management.Instrumentation.dll• System.VisualC.STLCLR.dllAddIn framework
Add-in frameworkAn add-in is custom code (i.e., a customization) usually written by a third partythat is dynamically loaded and activated by a Host application,based upon some context (e.g., Host startup,
document loading, security, lifetime,…)and typically not tested by the Host
The Add-in provides a service to a Host, Automates a Host, or provides Hosting functionality via public API’s (i.e., Object Model), which are typically made available via an SDK.
Resources
• MSDN: http://msdn.microsoft.com/ • MSDN BELUX: http://www.msdn.be • Visual Studio 2008 Training Kit:
http://go.microsoft.com/?linkid=7602397 • OBA:
http://msdn2.microsoft.com/en-us/architecture/aa699381.aspx
• LINQ Samples 101: http://msdn2.microsoft.com/en-us/vcsharp/aa336746.aspx
• Channel9: http://channel9.msdn.com/• CodePlex: http://www.codeplex.com/
Agenda• The evolution of .NET• A Tour around Visual Studio 2005 and .NET 3.5
• IDE enhancements• Language Enhancements• Web Development• Services (Workflow and Communication Foundation)• Client and Mobile Development• Office Development
• .NET Framework 3.5 new assemblies• Questions & Answers
Gill CleerenSoftware [email protected]