MS.NET 3.
Trendz IT
New Features in 3.5
• VS 2008 Multi-Targeting Support
• ASP.NET AJAX and JavaScript Support
• VS 2008 Web Designer and CSS Support
• VS 2008 Code Editing Features
• Language Improvements
• LINQ
• Data Access Improvements
• ASP.NET 3.5 Controls
• WPF Designer
• New WCF and WF Projects and Designers
VS 2008 Multi-Targeting Support
• VS 2008 enables you to build applications that target
multiple versions of the .NET Framework.
• This means you can use VS 2008 to open, edit and build
existing .NET 2.0 and ASP.NET 2.0 applications
(including ASP.NET 2.0 applications using ASP.NET
AJAX 1.0), and continue to deploy these applications on
.NET 2.0 machines.
ASP.NET AJAX and JavaScript Support
• VS 2008 and Visual Web Developer 2008 also
now have support for integrating JavaScript and
AJAX into your applications:
– JavaScript Intellisense
– JavaScript Debugging
– ASP.NET AJAX Control Extender Support
– JavaScript Intellisense for SliverLight
ASP.NET AJAX 3.5
• .NET 3.5 has ASP.NET AJAX built-in (no separate
download required).
• In addition to including all of the features in ASP.NET
AJAX 1.0, ASP.NET 3.5 also now includes
– richer support for UpdatePanels integrating with WebParts,
– ASP.NET AJAX integration with controls like <asp:menu> and
<asp:treeview>,
– WCF support for JSON, and many other AJAX improvements.
JavaScript Intellisense
• Some of the new JavaScript intellisense features to take
advantage of:
– JavaScript Type Inference
– Intellisense for External JavaScript Libraries
– Intellisense Hints to JavaScript
– Intellisense within External JavaScript Files
– Calling Web Services using ASP.NET AJAX
– Re-usable ASP.NET AJAX Behaviors, Controls and Libraries
JavaScript Debugging
• The new JavaScript Debugging features include:
– Setting JavaScript Breakpoints in ASP.NET pages
– Script Document Navigation within the Solution Explorer
– Much Richer Debug Watch/Locals and Visualizer support
ASP.NET AJAX Control Extenders
• VS 2008 has improved designer support for ASP.NET
AJAX Control Extenders.
• With VS 2005 you had to manually wire-up control
extenders yourself (either via source-view or via the
property grid).
• VS 2008 makes it even easier to discover and attach
control extenders to your controls.
Web Designer and CSS Support
• VS 2008 and Visual Web Developer 2008
Express includes a significantly improved HTML web
designer (the same one that ships with Expression
Web).
• This delivers support for split-view editing, nested master
pages, and great CSS integration.
Web Designer and CSS Support
• Some of the new web designer features that you'll be
able to take advantage are:
– Split View Editing
– CSS Style Manager
– CSS Properties Window
– CSS Source View Intellisense
– Nested Master Page Support
VS 2008 Code Editing Features
• VS 2008 supports the following new code editing
features:
– Transparent Intellisense Mode
– VB Intellisense Filtering
– VB LINQ Intellisense
– Organize C# Using Statements
Language Improvements
• The new VB and C# compilers in VS 2008 add
functional programming concepts that enable
you to write cleaner, terser, and more expressive
code.
• These features also enable a new programming
model we call LINQ (language integrated query)
that makes querying and working with data a
first-class programming concept with .NET.
New Features in C# 2008
• Implicitly Typed Local Variables
• Automatic Properties
• Object and Collection Initializers
• Extension Methods
• Partial Methods
• Anonymous Types
• Lambda Expressions
• Query Syntax
Partial Methods
• Partial methods are methods living in partial classes
which are marked as partial.
• In case of partial methods, it's really partial: there can be
calls to 'non-implemented' methods.
• A partial method cannot have access modifiers or the
virtual, abstract, override, new, sealed, or extern
modifiers.
LINQ
• LINQ (Language Integrated Query) is a
declarative way of querying data.
• Instead of being imperative and using loops and
if statements you can tell C# what you want and
LINQ will go ahead and build that data for you.
• You can sort, group and also join data using
LINQ.
Data Access Improvements
• In .NET 3.5, data access is improved using LINQ to
SQL.
• LINQ to SQL is a built-in OR/M (object relational
mapper) in .NET 3.5.
• It enables you to model relational databases using
a .NET object model.
• You can then query the database using LINQ, as well as
update/insert/delete data from it.
ASP.NET 3.5 Controls
• Apart from integrated support for AJAX, ASP.NET 3.5 introduces
two new controls:
– ListView Control, and
– DataPager Control
ListView Control
• The ListView control is an update to the old DataList and Repeater
controls.
• It is used for displaying mulitple records and providing functionality
like the GridView, but allowing for a more flexible layout through the
use of templates.
DataPager Control
• The DataPager control operates as a sort of free-
standing paging interface. In short, it renders a paging
user interface - next, previous, first, last buttons, for
instance - and is tied to a data Web control.
• The DataPager only works with those controls that
implement the IPageableItemContainer interface, which
(currently) includes only the ListView control.
New Features in WCF and WWF
• Windows Workflow Foundation (WF) and Windows Communication
Foundation (WCF) were released in 2006 as part of the Microsoft
.NET Framework 3.0 with separate extensions for Microsoft Visual
Studio 2005.
• These tools were improved on and are now integrated with Microsoft
Visual Studio 2008 and enhanced in the .NET Framework 3.5.
New Features in WCF and WWF
The major new features are:
• Enhanced tooling for WCF .
• REST/Web Programming, Syndication (RSS/ATOM),
and AJAX (JSON) with WCF .
• Workflow Services (exposing a Workflow as a WCF
Service / Calling WCF services from a workflow) .
• SharePoint Workflows
WCF-Provided Host
• Visual Studio 2008 ships with a ready-made, general-purpose
service host called WcfSvcHost.exe.
• It's found under C:\Program Files\Microsoft Visual Studio
9.0\Common7\IDE.
• It’s a simple command-line utility, accepting two parameters: the file
path to a .NET assembly containing the service class or classes,
and a file path to the host .config file.
WcfSvcHost.exe
• WcfSvcHost is a Windows Forms application that resides
as a desktop tray icon.
• WcfSvcHost is designed to eliminate the need during
development for a separate host assembly to
accompany your service library.
• You can even use WcfSvcHost in your .NET Framework
3.0 applications and with Visual Studio 2005 projects.
WCF-Provided Test Client
• In addition to the service host, Visual Studio 2008 ships
with a simple, general-purpose test client for rudimentary
testing that you can use to invoke operations on most
services.
• The test client, WcfTestClient.exe, is found after normal
installation at C:\Program Files\Microsoft Visual Studio
9.0\Common7\IDE.
WcfTestClient.exe
• You must provide WcfTestClient with a single command-
line argument containing the metadata address of the
service to test.
• You can specify any metadata address, such as HTTP-
GET, or metadata endpoint over HTTP, TCP, or IPC
(named pipes).
• You can also specify multiple metadata addresses.
WcfTestClient.exe
• WcfTestClient is a Windows Forms 3.5 application.
• WcfTestClient functions by silently creating an assembly
from a proxy file, complete with a .config file, and then
loading it from a temporary location.
• You cannot use WcfTestClient on machines with only
.NET Framework 3.0, since it makes use of an internal
.NET Framework 3.5 tree grid control
WCF Service Libraries
• With the target Framework as 3.0, there is a new project
template called the ‘WCF Service Library’.
• This project type is merely the pre-built usage of
WcfSvcHost and WcfTestClient.
• The WCF Service Library also provides a simple
template for a service contract, its implementation, and
the matching .config file.
Syndication Service Library
• The ‘Syndication Service Library’ template is available
when Framework 3.5 is selected.
• The Syndication Service Library allows you to implement
an RSS feed over a WCF endpoint, and it starts you off
with a simple service contract that returns a feed, its
implementation, and a matching .config file.
Syndication Service Library
• You can host and expose your feed like any
other service.
• The syndicated endpoints make use of the new
WebHttpBinding binding.
• This new binding is designed to receive Web
requests and cannot be used for normal service
invocations.
Sequential Workflow Service Library
• .NET 3.5 also supports the new “Workflow
Services” projects.
• The Sequential Workflow Service Library
template allows you to implement an endpoint's
contract operations as workflow activities or, for
that matter, to expose a workflow as a service.
Sequential Workflow Service Library
• The project will contain a single sequential activity that
implements a simple contract and a matching .config file.
• The client still interacts with what looks like a traditional
endpoint, and yet the implementation is purely workflow-
driven.
State Machine Workflow Service Library
• This template uses a state machine instead of a
sequential workflow to implement its operations (trigger
state transitions).
• The workflow project templates make use of WcfSvcHost
and WcfTestClient, just as the plain WCF Service Library
does.
• The workflow templates also make use of the new
context bindings to manage passing the workflow
instance ID to support durable workflows.
Adding Service References
• The Visual Studio 2005 extensions for .NET Framework
3.0 provided a rudimentary ability to add a reference to a
WCF service, without many of the advanced features of
SvcUtil.
• Bust Visual Studio 2008 features a new service
reference dialog, where all advanced options can be
specified.
Add Service Reference Dialog
• In the Add Service Reference dialog, you first need to specify the
service metadata address (not the service URL, as the dialog
states) and click Go to view the available service endpoints (not
Services, as labeled).
• You must specify a namespace (such as MyService) to contain the
generated proxy and click OK to generate the proxy and update the
.config file.
Add Service Reference Dialog
• In the case of a WCF service library, WCF will
auto-launch its host (WcfSvcHost) to get the
metadata.
• The Advanced button brings up the settings
dialog that lets you tweak the proxy generation
almost as if you were using SvcUtil.