. NET Framework programming Reading Notes

Source: Internet
Author: User
Tags biztalk

1 underlying operating system Windows

Because Web services and applications using Web ServicesProgramStill running on the computer, and since there are peripherals on the computer, we still need an operating system .. XML support is added for windows .. windows XP and Windows .net (now renamed Windows Server 2003) All versions provide the best support for the service-driven world.

Windows XP and Windows 2003 Server are particularly integrated with Microsoft. NET Passport XML Web Service Support. passport is a user authentication service .. when you log on to a passport-certified web site or web service, the efficiency will be greatly improved. in other words, users no longer need to enter the user name and password each time they access different Internet sites.

In addition, both Windows XP and Windows Server 2003 provide built-in support for the. NET Framework.

2 auxiliary products:. NET Enterprise Servers

These products mainly help enterprises with information and information integration.

Microsoft Application Center

Microsoft Biztalk Server 2000 (a new version is available now)

Microsoft Commerce Server 2000

Microsoft Exchange 2000 email server

Microsoft hostintegration Server 2000

Microsoft Internet Security and Acceleration (ISA) Server 2000

Microsoft mobile info Server 2002

Microsoft SQL Server 2000

This product was just launched with us. NET platform does not matter. however, in the future. NET features are integrated into these products, and the latest version of BizTalk is integrated. NET feature, which is poor and developed through vs.net 2003.

3 Microsoft XML Web Service:. Net my servers

Microsoft, as the underlying technology provider of Web Services, also launched its own XML Web Service.

. Net alerts

. Net applicationsettings

. Net calendar

. Net categories

Wait ......

4. Development Platform:. NET Framework

The. NET Framework consists of the Common Language Runtime --- Clr and the. NET Framework class library (framework class libarary -- FCL ).

The. NET Framework is the most critical part of the. NET platform.

This article discusses the development of. NET Framework-oriented applications and XML Web Services.

. NET framework development platform allows us to create a variety of applications: XML Web Services, web forms, Win32 GUI programs, Win32 Cui applications, windows services, utilities, and independent component modules.

Windows 2003 Server has built-in. NET Framework

The microsft. NET Framework provides developers with more technologies than any previous Microsoft development platform, suchCodeReuse, code specialization, resource management, multi-language development, security, deployment, and management. When designing the. NET Framework, Microsoft also felt it necessary to improve some defects of the current Windows platform.

Some services provided by Clr and FCL:

L consistent programming model

In the current Windows operating system, some functions need to be accessed through the dynamic link library DLL, and some functions are accessed through the COM object. Under the. NET Framework, all application services are provided to developers with a consistent and object-oriented programming model.

L simplified programming

One of the goals of CLR is to simplify the complex infrastructure required in Win32 and COM environments. In CLR, we do not need the registry, globally unique identifier, iunknown, addref, release, and hresult.

L reliable version Mechanism

The. NET Framework uses a new version mechanism to isolate application components, ensuring that an application can always load the components used in the original test. The "DLL hell" door was closed completely.

L lightweight Deployment Management

In the. NET Framework, components are no longer referenced by the Registry. Most. NET Framework applications only need to copy files to a directory. Add shortcuts to the desktop and Start Menu.

L extensive platform support

Compiled. NET FrameworkSource codeIn fact, the common intermediate language (CLR) translates these intermediate languages into CPU commands only at runtime. This means that as long as a machine contains Clr and FCL compatible with ECMA, we can deploy. NET Framework applications on it.

L seamless language integration

CRL requires that all languages targeting it comply with a common type System (CTS) specification and general language specification.

L simple code reuse

L Automated memory management (garbage collection)

CLR automatically tracks resource usage.

L solid type security

CLR ensures that all code is type-safe.

L rich debugging support

CLR fully supports cross-language debugging

L unified error reports

In CLR, all failed calls are reported through exceptions.

L brand new security policies

Traditional security mechanisms are controlled based on user accounts.

Code access security in CLR provides code-centric control.

L powerful interoperability

The. NET Framework fully supports COM and Win32 functions in traditional DLL.
5. integrated development environment Visual Studio. NET

Microsoft Visual stuaio. NET 2003 is the best. NET Framework application development tool.


This chapter mainly describes the composition of the. NET platform and the features of the. NET platform, Clr and FCL.

The. NET Framework has 13 major features:

1. Consistent programming model

2. simplified programming

3. Reliable version Mechanism

4. Lightweight Deployment Management

5. Extensive platform support

6. Seamless language integration

7. Simple code reuse

8. Automated memory management (garbage collection)

9. Solid type security

10. Rich debugging support

11. Unified error reports

12. New Security Policies

13. Powerful interoperability

In fact, I personally feel that Article 5th is not very meaningful at present, because until now the. NET Framework can only be used well on windows. I have heard of a mono, but it is not very mature yet? 12th is actually very important. The security mechanism based on user accounts is not secure for the Internet, which will directly affect the popularity of. NET and my job bowl :).

In addition, I only know some of the enterprise servers of Microsoft, and others do not know what to do. There is no time to take the initiative to find relevant information. I participated in Microsoft developer day some time ago to know what BizTalk is. The speaker is also awesome. The dizzy things written on the materials are clearly explained by him and can be understood as soon as they are heard.

Technology, language features, or some integration solutions can only take the initiative to use it if you understand it, but the problem is that in many cases, it can also work normally if you do not use it, it only takes more time and cost. When I solve the problem at a higher cost, I don't know that there is a better solution, and it's just around me. I don't have much time to study the technology and characteristics behind the endless nouns.

There are two ways to solve this problem: Try to understand new things as much as possible, even if you initially think it is different from your work and interests. The other one is to expect those providers (such as Microsoft) to highlight more issues that programmers can use to solve practical applications. (At least it looks like a programmer's publicity)

It wasn't until I listened to the BizTalk lecture that I knew this was a perfect fit for our company. We can solve many difficult problems through BizTalk.
Chapter 1: Architecture of the Microsoft. NET Framework Development Platform

Objective of this chapter: to have a general understanding of the. NET Framework architecture and a basic understanding of some new technologies and terms in the. NET Framework.

1.1 compile the source code into a managed Module

AboutProgramming LanguageSelect

The core of the. NET Framework is the runtime of a common language. As the name suggests, it is a runtime that can be used by different programming languages. Many features of CLR can be used in all programming languages targeting it. If CLR reports errors with exceptions, all languages targeting it will get error reports through exceptions. If CLR allows us to create threads, all languages targeting it can also create threads.

In fact, CLR does not know the programming language used by developers to complete source code at runtime. This means that we should choose the programming languages that are most likely to express our intent. We can write code in any language we like (CLR-oriented.

Different programming languages allow us to develop with different syntaxes. different syntaxes affect the difficulty of solving various problems, such as mathematical or financial applications, it is faster to use the APL syntax.

Microsoft has created the following CLR-oriented compilers:

Managed extension C ++

C #

Visual Basic


J #

Il Assembler

We can use any programming language that supports CLR to create source code files. Then use the corresponding compiler for syntax check and source code analysis. Finally, the managed oak block is generated.

Hosting module

The managed module is a standard Windows Executable (PE) file that requires CLR execution.

Components of the hosting module:

L pe Header

The standard Windows PE file header is similar to the Common Object File Format header. This header specifies the file type: gui (graphical user interface), Cui (console user interface), or DLL. the DLL here is not a traditional Windows dynamic link library file, although it is called DLL, but the DLL in the net platform refers to a form of Assembly file ), this header also contains the file creation time. For a module containing CPU code, the header also contains information about the local CPU code.

L CLR Header

Contains information about the identity hosting module (which can be parsed by CLR or some utility tools ).

1. CLR version number

2. Metadata tag of the hosting module entry point method (main method)

3. Metadata tag of the hosting module

4. Resources

5. Strong naming

6. other locations and dimensions with little significance

L metadata

Each managed module contains metadata tables. Metadata tables are mainly divided into two types, one for describing the types and Members defined in the source code, and the other for describing the reference types and members in the source code.

L intermediate language (IL) and Code

The compiler generates commands when compiling source code. CLR will compile the Il code at the cost of CPU commands at runtime.

Metadata (metadata) is a collection of data tables. In these tables, some of them are used to describe the content defined in the managed module (such as the defined types and their members, others are used to describe the content referenced in the managed module (such as the referenced type and their members ). Metadata is always associated with files that contain il code.

Use of metadata:

1. Saving the need for source code compilation for first-class files and library files,

2. Visual Studio. NET can use metadata to help us write code. Smart sensing does this.

3. serialization and deserialization

4. the garbage collector can track the lifetime of the object.

1.2 combine managed modules into an assembly

CLR does not actually deal with managed modules. The objects it directly deals with are assembly. Assembly is an abstract concept, which is often hard to understand at the beginning. First, an assembly is one or more managed modules and a logical combination of some resource files. Second, the Assembly is the minimum unit for Component Reuse and implementing security policies and versions. Based on our selection of compilers and related tools, an assembly can be one file or multiple files.

By default, the compiler converts a hosted module to an assembly. That is to say, the C # compiler generates a managed model that contains a list. The list indicates that the set contains only one file. For projects that only contain one managed module and have no resources (or data) files, an assembly is a managed module, and no other steps are required during creation.

The module in the Assembly also contains information about the Assembly it references (such as the version number ). This information allows an assembly to implement self-describing ). In other words, CLR knows all the content required to execute an Assembly and does not need to obtain additional information in the registry or Active Directory. Therefore, the deployment of an assembly is much easier than that of an unmanaged component.

1.3 loading general language runtime

An assembly, an executable application, or a DLL containing a group of types (components) that can be used by an executable application. CLR is responsible for managing the execution of code contained in the Assembly. This means that the. NET Framework must be installed on the host machine. Microsoft has created a distribution package that can install the. NET Framework on the client for free .. The. NET Framework will eventually be packaged with windows in the future, so that we do not need to put it together with our assembly for release.

We can find the mscoree. dll file in the % Windir % \ system32 directory to determine whether the. NET Framework is installed on a machine. To determine which versions of the. NET Framework are installed on a machine, you can view the subkeys of the following registry keys:

HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \. netframework \ Policy

When an EXE assembly is generated, the compiler/Linker will generate some special information and embed them into the PE file header of the result assembly and the. Text part of each component file. When an EXE file is called, the special information will cause the CLR to be loaded and initialized. The CLR then locates the method of the entry point of the winning program and starts the application from the ground up.

Similarly, if an unmanaged application loads a hosted assembly by calling loadlibrary, then the entry point function of the hosted Assembly dll will also know to load CLR to process the Code contained in it.

Process of loading and initializing CLR by hosting exe

1. mscoree checks the CLR header to obtain the metadata tag of the main method.

2. mscoree checks the metadata of the main method to obtain the location of its il in the hosted exe.

3. mscoree compiles the main method's il to the local CPU command cost.

4. mscoree jump to the local CPU command compiled by the main method (using the main thread)

5. The application starts to run.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.