1. Trang chủ
  2. » Công Nghệ Thông Tin

windows vista for developers delivery guide phần 5 pptx

21 240 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 21
Dung lượng 1,36 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

To install Microsoft .NET Framework 3.0, one of the following operating systems must be installed on the target computer: • Microsoft Windows XP with Service Pack 2 or later.. Installing

Trang 1

Comparing NET Framework 3.0 and Earlier Versions of the NET

Framework

The NET Framework 3.0 adds new technologies to NET Framework 2.0, which makes

the NET Framework 3.0 a superset of the NET Framework 2.0 You can think of

the NET Framework 3.0 as an additive release to the NET Framework 2.0, as contrasted

with a generational release, in which software is revised across the board (For example,

the NET Framework 2.0 was a generational release over the NET Framework 1.0.)

The NET Framework 3.0 is composed of the existing NET Framework 2.0 components,

including Microsoft ASP.NET 2.0, WinForms 2.0, Microsoft ADO.NET, Base Class

Libraries 2.0, and the Common Language Runtime CLR 2.0, in addition to new

developer-focused innovative technologies in WPF, WCF, WF, and WCS

Because NET Framework 3.0 is an additive release and uses the core runtime

components from NET Framework 2.0, it is completely backward compatible with the

earlier version Your existing NET Framework 2.0–based applications will continue to

run without any modifications, and you can safely continue your investments by using the

technologies that were included with NET Framework 2.0

Trang 2

If you are moving to NET Framework 3.0 from NET Framework 1.1 or 1.0, you should perform impact analysis and run compatibility testing prior to deployment Most

applications developed using the older versions of NET Framework will be compatible with NET Framework 3.0; there are a small number of known incompatibilities because

of security and significant functionality additions

For additional information see the document “Breaking Changes in NET

Framework 2.0” on the Microsoft NET Developer Center Web site

Trang 3

.NET Framework 3.0 Installation Requirements

Operating System Requirements

For Microsoft Windows Vista and Microsoft Windows Server™ code-named Longhorn

Edition, the NET Framework 3.0 is a feature of the operating system You do not need to

include the runtime components if these are the only target platform for your application

For distribution to previous versions of Windows, you will need to deploy the runtime

components with your applications

To install Microsoft NET Framework 3.0, one of the following operating systems must

be installed on the target computer:

• Microsoft Windows XP with Service Pack 2 or later

• Microsoft Windows Server 2003 family with Service Pack 1 or later

Installing Runtime Components 3.0

When you deploy applications that are created with Microsoft Visual Studio® 2005 and

that require NET Framework 3.0, the NET Framework must be installed on the target

computer before your application is installed The Microsoft NET Framework 3.0

provides a redistributable installer that contains NET Framework 2.0 bindings to the

required Windows Vista APIs to run NET Framework 3.0 applications

Trang 4

The NET Framework 3.0 redistributable package is available as a stand-alone executable file The name of the file depends on the type of targeted platform

• For 32-bit platforms, the file is named Dotnetfx3.exe

• For 64-bit platforms, the file is named Dotnetfx3_x64.exe

You can also deploy a small redistributable package named Dotnet3setup.exe that

downloads the required components when you install the runtime components

Hardware Requirements

The following table lists the hardware requirements for running NET Framework 3.0

Recommended Pentium 1 GHz or higher 256 MB or more

Trang 5

Deploying NET Framework 3.0

You can manually launch and install the NET Framework 3.0 redistributable file, or the

Framework can be launched and installed as part of the setup program for a NET

Framework 3.0 application

Having Users Install the NET Framework Manually

In some situations, it might be impractical for you to automatically install the NET

Framework 3.0 Runtime Components with your application In that case, you can have

users install the NET Framework themselves The redistributable file is available from

several sources; however, you should not assume that users of your application know

where to get it or how to install it In your setup process, provide instructions for how

users should locate and install the NET Framework

Note Administrator privileges are required to install the NET Framework 3.0

Runtime Components

You can download the Microsoft NET Framework 3.0 redistributable package from the

Microsoft Vista Download Center or from the Microsoft Windows Update Web site

Note The Microsoft Windows Update site offers only the officially released version

of the NET Framework 3.0; it does not offer beta versions

Trang 6

Redistributing Using a Visual Studio 2005 Setup Project

You can include the NET Framework 3.0 in an executable setup file that you create using a Visual Studio 2005 setup project When you configure a Visual Studio 2005 setup project to install Microsoft NET Framework 3.0 with your application, the NET

Framework 3.0 is packaged with your application A launch condition in your

application’s setup program checks whether NET Framework 3.0 is installed, and if necessary, Setup installs the NET Framework before installing your application

Microsoft NET Framework 3.0 in turn checks whether NET Framework 2.0 is installed

If not, Setup prompts the user to install the earlier version of the NET Framework also

To include NET Framework 3.0 with your application’s setup process, the optional Visual Studio Extensions for NET Framework 3.0 must be installed on the computer on which you create the setup program

If Visual Studio 2005 Extensions for NET Framework 3.0 is not listed, you can download and install the extensions package as part of the Development Tools for WinFX, available on the page with the document “Microsoft Visual Studio Code Name “Orcas” Community Technology Preview – Development Tools for WinFX®”

on the Microsoft Download Center

Trang 7

Demonstration 1: Using Visual Studio to Deploy Runtime

Components 3.0

In this demonstration, you will see how you can include the NET Framework 3.0 with an

application setup program

Key Point

The key point of this demonstration is:

• To distribute the NET Framework by using Visual Studio and create a setup program

that includes the application files and the NET Framework files

Trang 8

Developing Applications by Using Windows

Communication Foundation

Introduction

Windows Communication Foundation is one of the new components in NET

Framework 3.0 By using WCF, you can build secure and reliable transacted Web

services that integrate across platforms and interoperate with existing Web Services

To create a WCF application, you need to create the application, deploy it, and then

configure client applications to use it

Objectives

After completing this section, you will be able to:

• Describe the Windows Communication Foundation features

• Describe the Windows Communication Foundation architecture

• Describe endpoints

• Define service contracts

• Define data contracts

• Implement services

Trang 9

• Choose and configure bindings

• Deploy the WCF service

• Consume the WCF service

• Secure the WCF service

Trang 10

Introducing the Windows Communication Foundation

Windows Communication Foundation is Microsoft’s unified programming model for

building service-oriented applications with managed code It extends the NET

Framework to enable developers to build secure and reliable transacted Web services that

integrate across platforms and interoperate with existing investments Windows

Communication Foundation combines and extends the capabilities of existing Microsoft

distributed systems technologies to deliver a unified development experience for

applications running in different locations using different computers, protocols, and

security models

Windows Communication Foundation simplifies development of distributed applications

in several ways Windows Communication Foundation:

• Reduces complexity by unifying the silos that exist with today’s distributed

technology stacks such as Enterprise Services, System.Messaging, Microsoft NET

Remoting, ASMX, and WSE This enables developers to compose distributed

applications using the best features of each of today’s stacks

• Maximizes developer productivity through an attribute-based programming model

• Is built on the principle of service-orientation, enabling developers to build loosely

coupled applications that interoperate securely and reliably across platforms

Trang 11

Architecture Overview of Windows Communication Foundation

Windows Communication Foundation includes several core components:

Contracts

Contracts are used to specify explicitly what an endpoint for a service does and what you

need to know to make use of the resource provided by the service at that endpoint

Contracts that specify what a service does, what it expects as input, and what it returns as

output are said to be behavioral Structural contracts specify the formats and other

conventions that are required in order to communicate with a service endpoint WCF

supports the following types of contracts:

• Data contracts The data contract describes every parameter that makes up every

message that a service can create or consume The message parameters are specified

by XSD documents, thus allowing any system that understands XML to process the

documents

• Message contracts The message contract defines specific message parts using SOAP

protocols and allows finer-grained control over parts of the message for use when

interoperability demands such precision

• Service contracts The service contract specifies the actual method signatures of the

service and is distributed as an interface in one of the supported programming

languages, including Microsoft Visual Basic® and Microsoft Visual C#®

Trang 12

• Policy and binding contracts The policy and binding contracts enable you to specify

the transport protocol (for example, HTTP or TCP), security details, and other aspects that must be met to communicate with a service

Service run-time layer

The service run-time layer contains the behaviors that occur only during the actual operation of the service, that is, the run-time behaviors of the service The service run-time layer provides the following services:

• Throttling controls how many messages are processed, which can be varied if the

demand for the service grows to a preset limit

• Error behavior determines what happens when a fault occurs

• Metadata behavior governs whether and how metadata is made available to the

outside world

• Instance behavior specifies how many instances of the service can be run (for

example, a singleton specifies only one instance to process all messages)

• Message inspection is the facility to inspect parts of a message

• Transaction behavior enables the rollback of transacted operations if a failure occurs

• Dispatch behavior is the control of how a message is processed by the WCF

• WS Security, which is an implementation of the WS-Security specification and which

enables security at the message layer

• WS Reliable Messaging channel, which enables the guarantee of message delivery

• Encoders included with the messaging layer present a variety of encodings that can

be used to suit the needs of the message

• The HTTP channel specifies that the Hyper Text Transport Protocol (HTTP) is used

for message delivery

• The TCP channel similarly specifies the TCP protocol

• The Transaction Flow channel governs transacted message patterns

• The Named Pipe channel enables interprocess communication (IPC)

• The MSMQ channel enables interoperation with Microsoft Message Queuing

(MSMQ) applications

Trang 13

Activation and Hosting

The specific method by which a service is started is determined by its activation options And services can be either self-hosted or hosted in the context of another application The Windows Activation Service (WAS) enables WCF applications to be activated

automatically when deployed on a computer running the WAS A service can be run:

• As an executable (.exe file)

• Automatically as a Windows service

• As a COM+ application

Trang 14

What Are Endpoints?

The endpoint is a basic unit of communication in Windows Communication Foundation

and is represented by the ServiceEndpoint class Services expose one or more endpoints

that allow clients to access the service Services can package endpoint descriptions to

share with clients, typically by using Web Services Description Language (WSDL)

Each endpoint is made up of three elements:

• Address The endpoint’s address is a network address where the endpoint resides

The EndpointAddress class represents a WCF Endpoint Address

• Binding The endpoint’s binding specifies how the endpoint communicates with

client applications, including such items as transport protocol, encoding, and security

requirements The Binding class represents a WCF binding

• Contract The endpoint’s contract specifies the information that the endpoint

communicates and is essentially a collection of messages organized in operations that

have basic Message Exchange Patterns (MEPs) The ContractDescription class

represents a WCF Contract

Trang 15

Defining Service Contracts

The first task when creating a basic Windows Communication Foundation (WCF) service

is to create the contract for the service that is shared with the outside world The contract

describes how other applications will be able to communicate with the service by

specifying the collection and structure of messages required to access the operations

offered by the service

The easiest way to do define a service contract is to create an interface that specifies the

input and output types and apply the ServiceContract attribute to the interface and

OperationContract attribute to the methods that you want to expose In order to define

the contract, you must also include the reference to System.ServiceModel

An example of a very simple service contract is:

Trang 16

Any methods that do not have an OperationContract attribute are not exposed for use

by clients of WCF services As any managed method, they can be called only by objects within their declared access scope

It is also valid to create a service contract class or interface that declares no service operations Any services built using a contract of this type expose no operations for clients to use

Trang 17

Defining Data Contracts

Once the target method has been determined based on the action, WCF relies on the

method’s data contract to perform serialization The data contract is defined by the types

used in the method signature In Web Services Description Language (WSDL), the data

contract is equivalent to the type element

In WCF, data contracts are defined through classes instead of interfaces as service

contracts are The way WCF serializes classes depends on the serialization engine in use

The default serialization engine is known as DataContract, a simplified version of

XmlSerializer, which is the default serialization engine used in ASMX today

DataContract defines attributes for annotating class definitions to influence the

serialization process Those classes are decorated with an attribute named DataContract,

and members that should be considered part of the message should be decorated with the

DataMember attribute The following code illustrates a DataContract

Ngày đăng: 14/08/2014, 02:22

TỪ KHÓA LIÊN QUAN