Wednesday, August 25, 2010

Walk-In 28th & 29th Aug -Chn HCL Technologies Java /J2EE Professionals

We have requirements across projects in Banking & Financial Domain in Chennai.

Experience in Core Java / Swing orJ2EE / Spring / Hibernate, Struts, EJB, Ajax, Weblogic, RMI, JSP, JDBC ( All skills are not mandatory)

Knowledge in BFSI Domain is preferred

Excellent analytical and problem solving approach

Very good communication skills (Written & Oral)

Experience : 3 to 6 Years.

Date : 28th and 29th August( Saturday and Sunday)

Registration Time : 10.00 AM – 1.00 PM.

Candidates can take their F2F interview in any of the below 2 HCL offices according to their availability.


1.HCL Technologies Ltd;

Arihant Technopolis,

4/293, Old Mahabalipuram Road,


Chennai -96.

Ph.:+(91)44 4395 7777.

Fax:+(91)44 4359 1024.

Contact Person : Jude

2. HCL Technologies Ltd;

Aurora Building,

34&35, Haddows Road,Nungambakkam,

Chennai – 600 034.

Contact Person : Narmada, Amira

Openings... Freshers of Batch 2010 ‘Buddy Referral’

Corporate Development Center India is hiring Freshers of Batch 2010 for their Research and Development projects at Bangalore. We invite you to send your ‘Buddy Referral’ resumes to

All resumes must reach the above email id on or before 27-Aug-10 (Friday).

Interview Process:

01. Candidates will be screened as per the ‘Entry Criteria’ given below.

02. Suitable candidates will be invited for a written test.

03. Candidates who clear the written test will undergo personal Interview.

Entry Criteria:

Qualification· BE, B.Tech with minimum 65% or 7.5 CGPA and no backlogs throughout the course.

· M.E., M.Tech, M.Sc, MCA with minimum 65% (including in Graduation) / 7.5 CGPA and no backpapers throughout the course.

· Year of completion / Passing out - 2010

Stream / Branch· Computer Science, Information Technology, Electronics & Communication, Instrumentation, Information Science.

Preferred Skills · Good Communication Skills (Written & Verbal)

· Team Player

· Go-getter

· Open for relocation / Travel

* Please note this will not qualify under the company’s Buddy Referral Scheme.

Corporate Social Responsibility is an integral part of Siemens’ business philosophy and we extend opportunities to those who are disadvantaged.


Human Resources

Corporate Development Center India

Note: You can forward it to your friends/relatives, but somebody you know may need it.

Happy Job Hunting!!

Urgent Opening for Testing Eng / Testing Lead @ Bangalore / Hyderabad Location

Greetings from Sahaysree Solutions!

We are Hyderabad based consulting company retained by top IT & Non IT companies to hunt talent.

This requirement is for one of the Top leading IT product development company in Healthcare sector.

We are looking for top-flight professionals committed to creating and implementing innovative solutions that help transform businesses. If you are looking for a career that challenges and inspires you, consider us. Our Clients associates have diverse backgrounds, talents, experiences, and interests, a commitment to delivering quality results and the desire to keep growing professionally.

We have two different opening for Bangalore and Hyderabad location. Following are the job description for Testing Lead and Testing Engineer

Position : Testing Lead

Experience : 5 to 9 Years

Location : Hyderabad / Bangalore

Job Description:


Job Description:

• Healthcare domain knowledge

• Exposure to Automation tools like QTP/ Win runner/ Load runner

• Should have experience working for a product development company in a large product development environment

• Should have effectively managed a team of at least 5 members.

• Hands of experience in developing Test Strategy, test cases against the requirements & executing the same.

• Should have working experience in SDLC & STLC

• Ability to troubleshoot a problem based of incident reports, assisting developments to reproduce the incidents.

• Hands on experience in analyzing & recreating the problems in the products built

• Perform module, integration, performance and functional tests on developed Programs/ modules.

• Bug reporting through Defect Tracking tools

• Well versed with testing methodologies, manual and automated testing, and testing best practices.

• Should be excellent team player and ability to mentor other members.

• Should have tested the product on multi browser and distributed environment

Position : Test Engineer

Experience : 3 to 5 Years

Location : Hyderabad / Bangalore

Job Description:


• Healthcare domain experience/ knowledge are must.

• Exposure to automation tools like QTP/ Load runner/ Win runner.

• Should have experience working for a product development company in a large product development environment

• Hands of experience in developing Test Strategy, test cases against the requirements & executing the same.

• Should have working experience in SDLC & STLC

• Ability to troubleshoot a problem based of incident reports, assisting developments to reproduce the incidents.

• Hands on experience in analyzing & recreating the problems in the products built

• Perform module, integration, performance and functional tests on developed Programs/ modules.

• Bug reporting through Defect Tracking tools

• Well versed with testing methodologies, manual and automated testing, and testing best practices.

• Should be excellent team player and ability to mentor other members.

• Should have tested the product on multi browser and distributed environment

Qualifications :


Any Graduates/Masters in premier institutes

If you are interested then please send us your updated resume along with following details:

Need information while processing to Company:

1.Total Experience:

2. Experience in Manual and Automation Testing:

3. CTC :

4. Expected CTC :

5. Notice Period :

6. Current Location:

7. Preferred Location:


Contact me on 09885294900 or Mail Me:

You can chat with me in office timings : Skype: nagesh.koppula


Best regards,


Sahaysree Solutions

+919885294900 / 040 64 526 527

Note: You can forward it to your friends/relatives, but somebody you know may need it.

Happy Job Hunting!!

Referral Openings for Freshers in Convergys

There are openings for freshers ( passouts from 2009 ).

We are now looking to augment our hiring of freshers (A4 Graduate Engineering Trainees). While no referral bonus is payable, this would still be an opportunity for you to refer your relatives/friends and persons known to you to help in the growth of our CIM Hyderabad Center.

Please, therefore, refer candidates with strong technical and analytical backgrounds, reasonable programming capabilities, effective communication skills, strong result orientation, high energy & drive and good inter-personal skills. The candidates must be Engineering graduates (BE/BTech) from the Computer Sciences, IT, Electrical & Electronics Engineering and Electronics & Communications streams who have graduated not earlier than 2005 and who have scored at least 65% in their BE / BTech aggregate scores with a consistent academic track record of at least 60% in their Class X and Class XII board examinations. MCAs with at least 65% in their aggregates in their graduation AND MCA and a first class academic track records can also be referred for this drive.

The selection process, which will be conducted for the shortlisted candidates on Saturday, 28 August, 2010 at our CIM Hyderabad facility will comprise of:

1. An initial Written Test for 75 minutes with sections on Analytical Skills (20 questions), Programming Skills (20), Technical Knowledge (20) and English (15).

2. Should a candidate qualify in the written test, he/she will have to attend HR OR Technical interviews on the same day or the next day.

3. Candidates who qualify in either the Technical OR HR interviews will, thereafter, have to attend an HR OR Technical interview, as the case may be.

4. Candidates who qualify in both the HR AND Technical interviews would go through a final panel interview.


HR Team


Note: You can forward it to your friends/relatives, but somebody you know may need it.

Happy Job Hunting!!


Dear Candidate's,

We have Urgent Opening's for JAVA & .NET developer's ,to work at our client's Organization.The details of the requirement are mentioned below.

Required Skill's: JAVA ,J2ee,Struts,Servlet's,hibernate,,,,SQL


*Percentage: 60%

Interested Candidate's,Please Send Your UPDATED RESUME ASAP to

We will be back to you with Scheduled Date, Time & Venue Detail's.

Minimum amount of Registration fee will be charged at the drive.

OPENING'S is one of the topmost Job consultant,located at Madhapur,Hyderabad.We have TOp MNC'S,LEVEL 3 & Many small companies as our client's.We provide resources to these Companies as per the requirement.

Note: You can forward it to your friends/relatives, but somebody you know may need it.

Happy Job Hunting!!

Siebel Tech Lead - Testing/6-9 Yrs/Bangaluru


Urgent Opening for US MNC CMML5 in Bangalore for Onsite opportunity.

Onsite QA Lead (Job Location: Bangalore)

Should have 6 to 9 year of QA experience in Siebel 7.x/8.x.

# Should have Good analytical and technical knowledge.

# Should have good communication skills.

# Should perform Integration testing, Test management, Test planning, Test coverage analysis.

# Should test Siebel views, applets, VBCs, EIM, CTI Toolbar, web services and in using Siebel tools.

# Should work on infrastructure tools like the QTP, Quality Center, Load Runner, etc.

# Should create all levels of testing scripts that contain multiple cases and cycles.

# Should verify readiness of the product for release through release review.

# Should execute testing for the business area and clearly document the test results.

Thanks & Regards,

Gajendra P Singh

Mount Talent Consulting
B-109, Sec-27, Noida
Cell: +91- 9871707161

Note: You can forward it to your friends/relatives, but somebody you know may need it.

Happy Job Hunting!!

SQA(CMMI)/5-8 Yrs/ MindTree/Bangalore


Hope you are doing well.We are looking SQA (Quality Catalyst) with strong exp in CMM / CMMI / PCMM implementation for our client Mindtree Ltd ,Bangalore

Job Location : Bangalore

Company : MindTree Ltd,


Exp - 5 - 8 yrs

Job details overview

Should have worked in SQA function for an IT organization for minimum of 4 years

· Experience in Software Development / Project Leading / Project Management Background will be an added advantage

· Responsible for defining detailed, end-to-end processes for all the assigned project domains across the organization

· Present to next level management on the Process Improvement tasks, status, efforts on a periodic basis

· Facilitate Process Training for Delivery Teams

· Manage organization level Assessments and Audits

Role Details

Process Mapping Methodology Experience

· Good Understanding of CMM and/or CMMI framework is a must

· Good understanding of at least two other process models listed here – ISO 9001, ISO 270001,

· Certifications (CSQA, PMP, Lead Assessor etc.) will be preferred

· Should know basics of project management

· Responsible for implementing the process corrective and preventive measures for the assigned domain projects

· Responsible for collecting, analyzing, publishing Metrics, Scorecards, RCA reports to concerned stake-holders

· Responsible for integrating process improvement inputs from Business Quality, Delivery and Knowledge Management Functions

· Should posses knowledge about statistical tools & techniques

· Should have published White-papers or delivered talks on Quality, Process

· Should have actively participated in CMM/CMMI/PCMM implementation programs in their previous organizations

· Present MindTree Processes to Prospects and Customers

. Soft Skills

High Integrity

Problem solving skills and learning attitude

Good communication, analytical and presentation skills

Team player

Process oriented

Incase If you are interested and looking for a change, Please do reply with your updatded resume at the earliest.with given below details :

Current CTC :

Expected CTC :

Notice Period :

Thanks & Regards,


+91.20.24362418, 9373509818

AKS Infotech Services,Pune

Note: You can forward it to your friends/relatives, but somebody you know may need it.

Happy Job Hunting!!

PL/SQL-Unix Lead/Pune

We have urgent openings for "Operation Shift Lead" with CMML5 company in Pune.

Please send your updated resume along with the following details:




Rel Exp PL/SQL:

Rel Exp in Unix(any Flavour like linux, solaris etc)

Rel exp in Telco operations, if any:

Rel exp in ITIL processes, if any:


List of certifications, if any:

Notice Period:

How soon can u join:

Current Company:

Current Designation:

Current Role:

Current Location:

Willing to relocate to Pune:

Why are u looking for change:

Current job Type(Permanent/Contract):



Shift Leads:

* Overall 6-8 yrs exp -

* Hands on knowledge on Pl,SQL and unix

* Atleast 2 yrs working experience in operations for a telco

* Good communication skills (oral and written)

* Experience in ITIL processes

Requirement is for immediate basis, long term in Pune.

Thanks and Regards,


Sr. Executive Resourcing

Future Focus Infotech

Note: You can forward it to your friends/relatives, but somebody you know may need it.

Happy Job Hunting!!


Oracle Corporation

Employee Referral Walk-in interview Graphic123.jpg


Oracle Financial Services Software Limited

Each of you has been a great support in the years gone by . we want to continue your support in the year ahead . refer friends/ex-colleagues & be proud of your achievement!.

Our next WALK-IN event for experienced professionals (IT & KPO) is scheduled in Bangalore, Mumbai, Chennai & Pune on 21st August 2010 as per details below.

Qualification: B.E / B Tech/ MCA

Selection process: Technical Test (up to 4 years experience only ) + Interviews

Date: Aug 21, 2010 (Saturday) Location: Bangalore, Time: 10am to 3pm

Role : Developer

Skillset : Core Java, JDBC (mandatory). Experience in Hibernate, Eclipse is an advantage.

Work location : Bangalore

Relevant Exp: 2 - 4 yrs


Oracle Financial Services Software Limited

C/o Embassy Business Park

C.V Raman Nagar,

Bangalore 560 093.

Contact Number: +91-80-6659 3000

Role : Senior Developer

Skillset: Java, J2EE, XML/XSD, OOAD, frameworks such as Spring or hibernate or Struts, Strong command over PL/SQL

Work location : Bangalore

Relevant Exp: 4 - 6 yrs

Role : Senior Developer

Skillset: Java, J2EE, EJB (mandatory). Strong command over PL/SQL, Design patterns.

Work location : Bangalore

Relevant Exp: 4 - 6 yrs

Role : Senior Developer

Skillset: Java with Swing & MQ Series, Websphere Application, build tools like Nexus, Maven (mandatory).

Work location: Bangalore

Relevant Exp: 4 - 6 yrs

Role : Senior Tester

Skillset : Automation Testing (with QTP) &

experience Insurance and/or Banking domain (mandatory).

Work location: Bangalore

Relevant Exp: 4 - 6 yrs

Role : Production Support

Skillset: Java with Documentum

Work location: Bangalore

Relevant Exp: 2 - 4 yrs

Role: Production Support

Skillset: Cognos Reporting/qlikview

Work location : Bangalore

Relevant Exp : 2 - 4 yrs

Role: Production Support

Skillset: Informatica

Work location : Bangalore

Relevant Exp : 2 - 4 yrs


Oracle Financial Services Software Limited

#333, Millennium Tower

Brookefields, Kundalahalli Road

Mahadevapura, Bangalore.

Contact Number: +91-80-6659 6000

Date: Aug 21, 2010 (Saturday) Location: Mumbai, Time: 10am to 3pm

Role : Developer / Sr. Developer

Skillset : Java, JSP, Servlets, PL/SQL (all mandatory)

Work location : Mumbai

Relevant Exp: 2 - 5 yrs

Role : Tech Lead

Skillset : Java, JSP, Servlets, PL/SQL with experience in Product Development (all mandatory)

Work location : Mumbai

Relevant Exp: 5 - 7 Years

Role : Developer

Skillset : C#,.NET,SQL Server (all mandatory)

Work location : Mumbai

Relevant Exp: 2 - 4 Years


Oracle Financial Services Software Limited

Oracle Park,

1-E, Nirlon Complex,

Near Western Express Highway,

Next to HUB, Goregaon (East), Mumbai.

Contact Number: +91-22-6718 4000

Role : Developer / Sr. Developer

Skillset: Core Java and PL/SQL.

Experience in Hibernate is an advantage.

Work location : Mumbai

Relevant Exp : 2 - 6 yrs

Role : Developer / Sr. Developer

Skillset: Core Java, J2EE, Servlets, JMS, XML. Experience in WebSphere / Weblogic

is a must.

Work location : Mumbai

Relevant Exp : 2 - 6 yrs


Oracle Financial Services Software Limited

Oracle Annex

Off Western Express Highway,

Next to HUB, Goregaon (East), Mumbai.

Contact Number: +91-22-6718 8000

Date: Aug 21, 2010 (Saturday) Location: Chennai, Time: 10am to 3pm

Role : Developer / Senior Developer

Skillset : Java, J2EE, Oracle

Work location : Chennai

Relevant Exp: 2 - 5 yrs


Oracle Financial Services Software Limited

Green i-tech,

5-4,Off Cathedral Road,


Contact Number: +91- 44- 6678 4000

Date: Aug 21, 2010 (Saturday) Location: Pune, Time: 10am to 3pm

Role : Developer/ Senior Developer

Skillset : C++ with Unix or PL/SQL

Work location : Pune

Relevant Exp : 2 - 6 yrs

Role : Tester ( Manual Testing)

Skillset : Test data preparation, writing test cases and system testing for Funds Transfer applications (mandatory).

Work location : Pune

Relevant Exp : 4 - 6 yrs

Role : Developer / Sr. Developer

Skillset : Java, JSP, Servlets (all mandatory)

Work location : Pune

Relevant Exp: 3 - 6 yrs

Role : Developer

Skillset :Tibco Middleware

Work location : Pune

Relevant Exp : 2 - 4 yrs


Oracle Financial Services Software Limited

Lohia Jain IT Park,

Paud Road, Kothrud,


Contact Number: +91-20-6670 7000

Employee Referral Policy at a Glance

Candidates between 1 and 2 yrs

Lunch / Dinner reimbursement of up to INR 1000

Above 2 yrs & up to 6 yrs relevant experience(All skills excl. Java)

INR 15,000

6+ yrs relevant experience(All skills excl. Java)

INR 20,000

Above 2 yrs & up to 6 yrs relevant experience

(Java and its family of tools)

INR 25,000

6+ yrs relevant experience(Java and its family of tools)

INR 35,000

Kindly request your Referees' to come along with their current resume (with your name & employee Id. written on the cover page) and a photograph for the selection process.

Employees whose referees are unable to appear for the WALK-IN events may send the Referees' resumes to any one of the following email-id's, depending upon the preferred work location(s).

Bangalore - HYPERLINK "" \

Chennai - HYPERLINK "" \

Mumbai - HYPERLINK "" \

Pune - HYPERLINK "" \

Kindly visit the HYPERLINK ""i-Connect link on the intranet, to know about the employee referral policy and additional career openings.

Go ahead, spread the message!


Employee referral team


Copyright C 2010, Oracle Corporation

and/or its affiliates. All rights reserved.

HYPERLINK "" \nContact Us
HYPERLINK "" \nLegal Notices and Terms of Use
HYPERLINK "" \nPrivacy Statement

Oracle Financial Services Software Limited

C/o. Embassy Business Park,

C V Raman Nagar,

Bangalore-560 093

HYPERLINK "about:blank" \nTel:+91-80-6659 7000


Note: You can forward it to your friends/relatives, but somebody you know may need it.

Happy Job Hunting!!

Freshers with Java Knowledge/Hyderabad

Prapan Solutions recruiting freshers with JAVA knowledge.

Location: Hyderabad

Position: JAVA Fresher Trainee Urgent Requirement-(Night Shift Only)

Job Description :

Sound Knowledge of Core Java, Servlets, JSP, JDBC, JSF/JSF implemented

Technologies, EJB /Hibernate & J2EE stack will be appreciated. On Job

Training is provided for 6 months with Rs.3000 Stipend during Training

period. Training is on JSF/JSF implemet

Desired Profile :

Should be willing to work with the latest technologies like EJB 3.0,

JSF, Toplinks, ADF and ability to work on new technologies and in a

team. Attitude to work based on task schedules, rather than time

schedules. Knowledge of Advanced Java Script.

How to apply : send resumes to

Note: You can forward it to your friends/relatives, but somebody you know may need it.

Happy Job Hunting!!

Sunday, August 22, 2010

Dot net FAQ'S

dot Net FAQs

.NET Framework Frequently Asked Questions

This FAQ tries to answer some commonly asked questions about the fundamentals of the .NET Framework - topics like assemblies, garbage collection, security, interop with COM, and remoting. The most commonly-used parts of the class library are also covered. Other aspects of the .NET Framework such as ASP.NET, ADO.NET and WinForms are not covered.
This FAQ was inspired by discussions on the DOTNET mailing list. The list has now been split into several DOTNET-X lists - for details see http://discuss.
Christophe Lauer has translated the FAQ into French - you can find it at http://www.dotnet- /andy_faqdotnet_ fr.html
Royal has translated the FAQ into Chinese - you can find it at http://www.royaloo. com/articles/ articles_ 2002/dotNetFAQ. htm
Disclaimer: The content of this FAQ is just my interpretation of information gleaned from various sources, including postings to the DOTNET-X mailing lists and various MS documents. The answers are not necessarily correct or up-to-date. Note that this FAQ has no official connection to the DOTNET-X mailing lists, or to Developmentor (the company who host the lists), or to Microsoft.
Revision history:
Added link to Christophe Lauer's French translation.
Added Serialization section
Overhaul of Resources section, including new Recommended Books and Weblogs topics.
Minor update to reflect arrival of version 1.
Updated all the code samples to be fully compatible with Beta 2.
Minor update to reflect arrival of Beta 2.
Added Tracing sub-section to the Class Library section.
Updated for arrival of Beta 1.
Started Class Library section.
Added section on IL.
Added section on Code Access Security.
Started revision history.
29-Jul-00 to 28-Aug-00
Miscellaneous (unrecorded) updates.
Posted first version.


1. Introduction

1.1 What is .NET?

That's difficult to sum up in a sentence. According to Microsoft, .NET is a "revolutionary new platform, built on open Internet protocols and standards, with tools and services that meld computing and communications in new ways".
A more practical definition would be that .NET is a new environment for developing and running software applications, featuring ease of development of web-based services, rich standard run-time services available to components written in a variety of programming languages, and inter-language and inter-machine interoperability.
Note that when the term ".NET" is used in this FAQ it refers only to the new .NET runtime and associated technologies. This is sometimes called the ".NET Framework". This FAQ does NOT cover any of the various other existing and new products/technologi es that Microsoft are attaching the .NET name to (e.g. SQL Server.NET).

1.2 Does .NET only apply to people building web-sites?

No. If you write any Windows software (using ATL/COM, MFC, VB, or even raw Win32), .NET may offer a viable alternative (or addition) to the way you do things currently. Of course, if you do develop web sites, then .NET has lots to interest you - not least ASP.NET.

1.3 When was .NET announced?

Bill Gates delivered a keynote at Forum 2000, held June 22, 2000 , outlining the .NET 'vision'. The July 2000 PDC had a number of sessions on .NET technology, and delegates were given CDs containing a pre-release version of the .NET framework/SDK and Visual Studio.NET.

1.4 When was the first version of .NET released?

The final version of the 1.0 SDK and runtime was made publicly available around 6pm PST on 15-Jan-2002 . At the same time, the final version of Visual Studio.NET was made available to MSDN subscribers.

1.5 What tools can I use to develop .NET applications?

There are a number of tools, described here in ascending order of cost:
  • .NET Framework SDK: The SDK is free and includes command-line compilers for C++, C#, and VB.NET and various other utilities to aid development.
  • ASP.NET Web Matrix: This is a free ASP.NET development environment from Microsoft. As well as a GUI development environment, the download includes a simple web server that can be used instead of IIS to host ASP.NET apps. This opens up ASP.NET development to users of Windows XP Home Edition, which cannot run IIS.
  • Microsoft Visual C# .NET Standard 2003: This is a cheap (around $100) version of Visual Studio limited to one language and also with limited wizard support. For example, there's no wizard support for class libraries or custom UI controls. Useful for beginners to learn with, or for savvy developers who can work around the deficiencies in the supplied wizards. As well as C#, there are VB.NET and C++ versions.
  • Microsoft Visual Studio.NET Professional 2003: If you have a license for Visual Studio 6.0, you can get the upgrade. You can also upgrade from VS.NET 2002 for a token $30. Visual Studio.NET includes support for all the MS languages (C#, C++, VB.NET) and has extensive wizard support.
At the top end of the price spectrum are the Visual Studio.NET 2003 Enterprise and Enterprise Architect editions. These offer extra features such as Visual Sourcesafe (version control), and performance and analysis tools. Check out the Visual Studio.NET Feature Comparison at http://msdn. microsoft. com/vstudio/ howtobuy/ choosing. asp.

1.6 What platforms does the .NET Framework run on?

The runtime supports Windows XP, Windows 2000, NT4 SP6a and Windows ME/98. Windows 95 is not supported. Some parts of the framework do not work on all platforms - for example, ASP.NET is only supported on Windows XP and Windows 2000. Windows 98/ME cannot be used for development.
IIS is not supported on Windows XP Home Edition, and so cannot be used to host ASP.NET. However, the ASP.NET Web Matrix web server does run on XP Home.
The Mono project is attempting to implement the .NET framework on Linux.

1.7 What languages does the .NET Framework support?

MS provides compilers for C#, C++, VB and JScript. Other vendors have announced that they intend to develop .NET compilers for languages such as COBOL, Eiffel, Perl, Smalltalk and Python.

1.8 Will the .NET Framework go through a standardisation process?

From http://msdn. microsoft. com/net/ecma/: "On December 13, 2001 , the ECMA General Assembly ratified the C# and common language infrastructure (CLI) specifications into international standards. The ECMA standards will be known as ECMA-334 (C#) and ECMA-335 (the CLI)."

2. Basic terminology

2.1 What is the CLR?

CLR = Common Language Runtime. The CLR is a set of standard resources that (in theory) any .NET program can take advantage of, regardless of programming language. Robert Schmidt (Microsoft) lists the following CLR resources in his MSDN PDC# article:
  • Object-oriented programming model (inheritance, polymorphism, exception handling, garbage collection)
  • Security model
  • Type system
  • All .NET base classes
  • Many .NET framework classes
  • Development, debugging, and profiling tools
  • Execution and code management
  • IL-to-native translators and optimizers
What this means is that in the .NET world, different programming languages will be more equal in capability than they have ever been before, although clearly not all languages will support all CLR services.

2.2 What is the CTS?

CTS = Common Type System. This is the range of types that the .NET runtime understands, and therefore that .NET applications can use. However note that not all .NET languages will support all the types in the CTS. The CTS is a superset of the CLS.

2.3 What is the CLS?

CLS = Common Language Specification. This is a subset of the CTS which all .NET languages are expected to support. The idea is that any program which uses CLS-compliant types can interoperate with any .NET program written in any language.
In theory this allows very tight interop between different .NET languages - for example allowing a C# class to inherit from a VB class.

2.4 What is IL?

IL = Intermediate Language. Also known as MSIL (Microsoft Intermediate Language) or CIL (Common Intermediate Language). All .NET source code (of any language) is compiled to IL. The IL is then converted to machine code at the point where the software is installed, or at run-time by a Just-In-Time (JIT) compiler.

2.5 What is C#?

C# is a new language designed by Microsoft to work with the .NET framework. In their "Introduction to C#" whitepaper, Microsoft describe C# as follows:
"C# is a simple, modern, object oriented, and type-safe programming language derived from C and C++. C# (pronounced “C sharp”) is firmly planted in the C and C++ family tree of languages, and will immediately be familiar to C and C++ programmers. C# aims to combine the high productivity of Visual Basic and the raw power of C++."
Substitute 'Java' for 'C#' in the quote above, and you'll see that the statement still works pretty well :-).
If you are a C++ programmer, you might like to check out my C# FAQ.

2.6 What does 'managed' mean in the .NET context?

The term 'managed' is the cause of much confusion. It is used in various places within .NET, meaning slightly different things.
Managed code: The .NET framework provides several core run-time services to the programs that run within it - for example exception handling and security. For these services to work, the code must provide a minimum level of information to the runtime. Such code is called managed code. All C# and Visual Basic.NET code is managed by default. VS7 C++ code is not managed by default, but the compiler can produce managed code by specifying a command-line switch (/com+).
Managed data: This is data that is allocated and de-allocated by the .NET runtime's garbage collector. C# and VB.NET data is always managed. VS7 C++ data is unmanaged by default, even when using the /com+ switch, but it can be marked as managed using the __gc keyword.
Managed classes: This is usually referred to in the context of Managed Extensions (ME) for C++. When using ME C++, a class can be marked with the __gc keyword. As the name suggests, this means that the memory for instances of the class is managed by the garbage collector, but it also means more than that. The class becomes a fully paid-up member of the .NET community with the benefits and restrictions that brings. An example of a benefit is proper interop with classes written in other languages - for example, a managed C++ class can inherit from a VB class. An example of a restriction is that a managed class can only inherit from one base class.

2.7 What is reflection?

All .NET compilers produce metadata about the types defined in the modules they produce. This metadata is packaged along with the module (modules in turn are packaged together in assemblies), and can be accessed by a mechanism called reflection. The System.Reflection namespace contains classes that can be used to interrogate the types for a module/assembly.
Using reflection to access .NET metadata is very similar to using ITypeLib/ITypeInfo to access type library data in COM, and it is used for similar purposes - e.g. determining data type sizes for marshaling data across context/process/ machine boundaries.
Reflection can also be used to dynamically invoke methods (see System.Type. InvokeMember) , or even create types dynamically at run-time (see System.Reflection. Emit.TypeBuilder ).

3. Assemblies

3.1 What is an assembly?

An assembly is sometimes described as a logical .EXE or .DLL, and can be an application (with a main entry point) or a library. An assembly consists of one or more files (dlls, exes, html files etc), and represents a group of resources, type definitions, and implementations of those types. An assembly may also contain references to other assemblies. These resources, types and references are described in a block of data called a manifest. The manifest is part of the assembly, thus making the assembly self-describing.
An important aspect of assemblies is that they are part of the identity of a type. The identity of a type is the assembly that houses it combined with the type name. This means, for example, that if assembly A exports a type called T, and assembly B exports a type called T, the .NET runtime sees these as two completely different types. Furthermore, don't get confused between assemblies and namespaces - namespaces are merely a hierarchical way of organising type names. To the runtime, type names are type names, regardless of whether namespaces are used to organise the names. It's the assembly plus the typename (regardless of whether the type name belongs to a namespace) that uniquely indentifies a type to the runtime.
Assemblies are also important in .NET with respect to security - many of the security restrictions are enforced at the assembly boundary.
Finally, assemblies are the unit of versioning in .NET - more on this below.

3.2 How can I produce an assembly?

The simplest way to produce an assembly is directly from a .NET compiler. For example, the following C# program:
public class CTest
     public CTest()
            System.Console. WriteLine( "Hello from CTest" );
can be compiled into a library assembly (dll) like this:
csc /t:library ctest.cs
You can then view the contents of the assembly by running the "IL Disassembler" tool that comes with the .NET SDK.
Alternatively you can compile your source into modules, and then combine the modules into an assembly using the assembly linker (al.exe). For the C# compiler, the /target:module switch is used to generate a module instead of an assembly.

3.3 What is the difference between a private assembly and a shared assembly?

  • Location and visibility: A private assembly is normally used by a single application, and is stored in the application' s directory, or a sub-directory beneath. A shared assembly is normally stored in the global assembly cache, which is a repository of assemblies maintained by the .NET runtime. Shared assemblies are usually libraries of code which many applications will find useful, e.g. the .NET framework classes.
  • Versioning: The runtime enforces versioning constraints only on shared assemblies, not on private assemblies.

3.4 How do assemblies find each other?

By searching directory paths. There are several factors which can affect the path (such as the AppDomain host, and application configuration files), but for private assemblies the search path is normally the application' s directory and its sub-directories. For shared assemblies, the search path is normally same as the private assembly path plus the shared assembly cache.

3.5 How does assembly versioning work?

Each assembly has a version number called the compatibility version. Also each reference to an assembly (from another assembly) includes both the name and version of the referenced assembly.
The version number has four numeric parts (e.g. Assemblies with either of the first two parts different are normally viewed as incompatible. If the first two parts are the same, but the third is different, the assemblies are deemed as 'maybe compatible'. If only the fourth part is different, the assemblies are deemed compatible. However, this is just the default guideline - it is the version policy that decides to what extent these rules are enforced. The version policy can be specified via the application configuration file.
Remember: versioning is only applied to shared assemblies, not private assemblies.

4. Application Domains

4.1 What is an Application Domain?

An AppDomain can be thought of as a lightweight process. Multiple AppDomains can exist inside a Win32 process. The primary purpose of the AppDomain is to isolate an application from other applications.
Win32 processes provide isolation by having distinct memory address spaces. This is effective, but it is expensive and doesn't scale well. The .NET runtime enforces AppDomain isolation by keeping control over the use of memory - all memory in the AppDomain is managed by the .NET runtime, so the runtime can ensure that AppDomains do not access each other's memory.

4.2 How does an AppDomain get created?

AppDomains are usually created by hosts. Examples of hosts are the Windows Shell, ASP.NET and IE. When you run a .NET application from the command-line, the host is the Shell. The Shell creates a new AppDomain for every application.
AppDomains can also be explicitly created by .NET applications. Here is a C# sample which creates an AppDomain, creates an instance of an object inside it, and then executes one of the object's methods. Note that you must name the executable 'appdomaintest. exe' for this code to work as-is.
using System;
using System.Runtime. Remoting;
public class CAppDomainInfo : MarshalByRefObject
     public string GetAppDomainInfo( )
            return "AppDomain = " + AppDomain.CurrentDo main.FriendlyNam e;
public class App
    public static int Main ()
            AppDomain ad = AppDomain.CreateDom ain( "Andy's new domain", null, null );
            ObjectHandle oh = ad.CreateInstance( "appdomaintest" , "CAppDomainInfo" );
            CAppDomainInfo adInfo = (CAppDomainInfo) (oh.Unwrap( ));
            string info = adInfo.GetAppDomain Info();
            Console.WriteLine( "AppDomain info: " + info );
            return 0;

4.3 Can I write my own .NET host?

Yes. For an example of how to do this, take a look at the source for the moniker developed by Jason Whittington and Don Box (http://staff. jasonw/clr/ readme.htm ). There is also a code sample in the .NET SDK called CorHost.

5. Garbage Collection

5.1 What is garbage collection?

Garbage collection is a system whereby a run-time component takes responsibility for managing the lifetime of objects and the heap memory that they occupy. This concept is not new to .NET - Java and many other languages/runtimes have used garbage collection for some time.

5.2 Is it true that objects don't always get destroyed immediately when the last reference goes away?

Yes. The garbage collector offers no guarantees about the time when an object will be destroyed and its memory reclaimed.
There is an interesting thread in the archives, started by Chris Sells, about the implications of non-deterministic destruction of objects in C#: http://discuss. archives/ wa.exe?A2= ind0007&L=DOTNET&P=R24819
In October 2000, Microsoft's Brian Harry posted a lengthy analysis of the problem: http://discuss. archives/ wa.exe?A2= ind0010A&L=DOTNET&P=R28572
Chris Sells' response to Brian's posting is here: http://discuss. archives/ wa.exe?A2= ind0010C&L=DOTNET&P=R983

5.3 Why doesn't the .NET runtime offer deterministic destruction?

Because of the garbage collection algorithm. The .NET garbage collector works by periodically running through a list of all the objects that are currently being referenced by an application. All the objects that it doesn't find during this search are ready to be destroyed and the memory reclaimed. The implication of this algorithm is that the runtime doesn't get notified immediately when the final reference on an object goes away - it only finds out during the next sweep of the heap.
Futhermore, this type of algorithm works best by performing the garbage collection sweep as rarely as possible. Normally heap exhaustion is the trigger for a collection sweep.

5.4 Is the lack of deterministic destruction in .NET a problem?

It's certainly an issue that affects component design. If you have objects that maintain expensive or scarce resources (e.g. database locks), you need to provide some way for the client to tell the object to release the resource when it is done. Microsoft recommend that you provide a method called Dispose() for this purpose. However, this causes problems for distributed objects - in a distributed system who calls the Dispose() method? Some form of reference-counting or ownership-managemen t mechanism is needed to handle distributed objects - unfortunately the runtime offers no help with this.

5.5 Does non-deterministic destruction affect the usage of COM objects from managed code?

Yes. When using a COM object from managed code, you are effectively relying on the garbage collector to call the final release on your object. If your COM object holds onto an expensive resource which is only cleaned-up after the final release, you may need to provide a new interface on your object which supports an explicit Dispose() method.

5.6 I've heard that Finalize methods should be avoided. Should I implement Finalize on my class?

An object with a Finalize method is more work for the garbage collector than an object without one. Also there are no guarantees about the order in which objects are Finalized, so there are issues surrounding access to other objects from the Finalize method. Finally, there is no guarantee that a Finalize method will get called on an object, so it should never be relied upon to do clean-up of an object's resources.
Microsoft recommend the following pattern:
public class CTest : IDisposable
     public void Dispose()
            ... // Cleanup activities
            GC.SuppressFinalize (this); 
     ~CTest()       // C# syntax hiding the Finalize() method
In the normal case the client calls Dispose(), the object's resources are freed, and the garbage collector is relieved of its Finalizing duties by the call to SuppressFinalize( ). In the worst case, i.e. the client forgets to call Dispose(), there is a reasonable chance that the object's resources will eventually get freed by the garbage collector calling Finalize(). Given the limitations of the garbage collection algorithm this seems like a pretty reasonable approach.

5.7 Do I have any control over the garbage collection algorithm?

A little. For example, the System.GC class exposes a Collect method - this forces the garbage collector to collect all unreferenced objects immediately.

5.8 How can I find out what the garbage collector is doing?

Lots of interesting statistics are exported from the .NET runtime via the '.NET CLR xxx' performance counters. Use Performance Monitor to view them.

6. Serialization

6.1 What is serialization?

Serialization is the process of converting an object into a stream of bytes. Deserialization is the opposite process of creating an object from a stream of bytes. Serialization/ Deserialization is mostly used to transport objects (e.g. during remoting), or to persist objects (e.g. to a file or database).

6.2 Does the .NET Framework have in-built support for serialization?

There are two separate mechanisms provided by the .NET class library - XmlSerializer and SoapFormatter/ BinaryFormatter. Microsoft uses XmlSerializer for Web Services, and uses SoapFormatter/ BinaryFormatter for remoting. Both are available for use in your own code.

6.3 I want to serialize instances of my class. Should I use XmlSerializer, SoapFormatter or BinaryFormatter?

It depends. XmlSerializer has severe limitations such as the requirement that the target class has a parameterless constructor, and only public read/write properties and fields can be serialized. However, on the plus side, XmlSerializer has good support for customising the XML document that is produced or consumed. XmlSerializer' s features mean that it is most suitable for cross-platform work, or for constructing objects from existing XML documents.
SoapFormatter and BinaryFormatter have fewer limitations than XmlSerializer. They can serialize private fields, for example. However they both require that the target class be marked with the [Serializable] attribute, so like XmlSerializer the class needs to be written with serialization in mind. Also there are some quirks to watch out for - for example on deserialization the constructor of the new object is not invoked.
The choice between SoapFormatter and BinaryFormatter depends on the application. BinaryFormatter makes sense where both serialization and deserialization will be performed on the .NET platform and where performance is important. SoapFormatter generally makes more sense in all other cases, for ease of debugging if nothing else.

6.4 Can I customise the serialization process?

Yes. XmlSerializer supports a range of attributes that can be used to configure serialization for a particular class. For example, a field or property can be marked with the [XmlIgnore] attribute to exclude it from serialization. Another example is the [XmlElement] attribute, which can be used to specify the XML element name to be used for a particular property or field.
Serialization via SoapFormatter/ BinaryFormatter can also be controlled to some extent by attributes. For example, the [NonSerialized] attribute is the equivalent of XmlSerializer' s [XmlIgnore] attribute. Ultimate control of the serialization process can be acheived by implementing the the ISerializable interface on the class whose instances are to be serialized.

6.5 Why is XmlSerializer so slow?

There is a once-per-process- per-type overhead with XmlSerializer. So the first time you serialize or deserialize an object of a given type in an application, there is a significant delay. This normally doesn't matter, but it may mean, for example, that XmlSerializer is a poor choice for loading configuration settings during startup of a GUI application.

6.6 Why do I get errors when I try to serialize a Hashtable?

XmlSerializer will refuse to serialize instances of any class that implements IDictionary, e.g. Hashtable. SoapFormatter and BinaryFormatter do not have this restriction.

6.7 XmlSerializer is throwing a generic "There was an error reflecting MyClass" error. How do I find out what the problem is?

Look at the InnerException property of the exception that is thrown to get a more specific error message.

7. Attributes

7.1 What are attributes?

There are at least two types of .NET attribute. The first type I will refer to as a metadata attribute - it allows some data to be attached to a class or method. This data becomes part of the metadata for the class, and (like other class metadata) can be accessed via reflection. An example of a metadata attribute is [serializable] , which can be attached to a class and means that instances of the class can be serialized.
[serializable] public class CTest {}
The other type of attribute is a context attribute. Context attributes use a similar syntax to metadata attributes but they are fundamentally different. Context attributes provide an interception mechanism whereby instance activation and method calls can be pre- and/or post-processed. If you've come across Keith Brown's universal delegator you'll be familiar with this idea.

7.2 Can I create my own metadata attributes?

Yes. Simply derive a class from System.Attribute and mark it with the AttributeUsage attribute. For example:
[AttributeUsage( AttributeTargets .Class)]
public class InspiredByAttribute : System.Attribute 
     public string InspiredBy;
     public InspiredByAttribute ( string inspiredBy )
            InspiredBy = inspiredBy;
[InspiredBy( "Andy Mc's brilliant .NET FAQ")]
class CTest
class CApp
     public static void Main ()
            object[] atts = typeof(CTest) .GetCustomAttrib utes(true) ;
            foreach( object att in atts )
                    if( att is InspiredByAttribute )
                            Console.WriteLine( "Class CTest was inspired by {0}", ((InspiredByAttribu te)att).Inspired By  );

7.3 Can I create my own context attributes?

Yes. Take a look at Don Box's sample (called CallThreshold) at http://www.develop. com/dbox/ dotnet/threshold /, and also Peter Drayton's Tracehook.NET at http://www.razorsof

8. Code Access Security

8.1 What is Code Access Security (CAS)?

CAS is the part of the .NET security model that determines whether or not a piece of code is allowed to run, and what resources it can use when it is running. For example, it is CAS that will prevent a .NET web applet from formatting your hard disk.

8.2 How does CAS work?

The CAS security policy revolves around two key concepts - code groups and permissions. Each .NET assembly is a member of a particular code group, and each code group is granted the permissions specified in a named permission set.
For example, using the default security policy, a control downloaded from a web site belongs to the 'Zone - Internet' code group, which adheres to the permissions defined by the 'Internet' named permission set. (Naturally the 'Internet' named permission set represents a very restrictive range of permissions. )

8.3 Who defines the CAS code groups?

Microsoft defines some default ones, but you can modify these and even create your own. To see the code groups defined on your system, run 'caspol -lg' from the command-line. On my system it looks like this:
Level = Machine
Code Groups:
1.  All code: Nothing
   1.1.  Zone - MyComputer: FullTrust
      1.1.1.  Honor SkipVerification requests: SkipVerification
   1.2.  Zone -
 Intranet: LocalIntranet
   1.3.  Zone - Internet: Internet
   1.4.  Zone - Untrusted: Nothing
   1.5.  Zone - Trusted: Internet
   1.6.  StrongName - 0024000004800000940 0000006020000002 4000052534131000 4000003
000000CFCB3291AA715 FE99D40D49040336 F9056D7886FED467 75BC7BB5430BA444 4FEF8348EBD06
F962F39776AE4DC3B7B 04A7FE6F49F25F74 0423EBF2C0B89698 D8D08AC48D69CED0 FC8F83B465E08
07AC11EC1DCC7D054E8 07A43336DDE408A5 393A48556123272C EEEE72F1660B7192 7D38561AABF5C
AC1DF1734633C602F8F 2D5: Everything
Note the hierarchy of code groups - the top of the hierarchy is the most general ('All code'), which is then sub-divided into several groups, each of which in turn can be sub-divided. Also note that (somewhat counter-intuitively ) a sub-group can be associated with a more permissive permission set than its parent.

8.4 How do I define my own code group?

Use caspol. For example, suppose you trust code from www.mydomain. com and you want it have full access to your system, but you want to keep the default restrictions for all other internet sites. To achieve this, you would add a new code group as a sub-group of the 'Zone - Internet' group, like this:
caspol -ag 1.3 -site www.mydomain. com FullTrust 
Now if you run caspol -lg you will see that the new group has been added as group 1.3.1:
   1.3.  Zone - Internet: Internet
      1.3.1.  Site - www.mydomain. com: FullTrust
Note that the numeric label (1.3.1) is just a caspol invention to make the code groups easy to manipulate from the command-line. The underlying runtime never sees it.

8.5 How do I change the permission set for a code group?

Use caspol. If you are the machine administrator, you can operate at the 'machine' level - which means not only that the changes you make become the default for the machine, but also that users cannot change the permissions to be more permissive. If you are a normal (non-admin) user you can still modify the permissions, but only to make them more restrictive. For example, to allow intranet code to do what it likes you might do this:
caspol -cg 1.2 FullTrust
Note that because this is more permissive than the default policy (on a standard system), you should only do this at the machine level - doing it at the user level will have no effect.

8.6 Can I create my own permission set?

Yes. Use caspol -ap, specifying an XML file containing the permissions in the permission set. To save you some time, here is a sample file corresponding to the 'Everything' permission set - just edit to suit your needs. When you have edited the sample, add it to the range of available permission sets like this:
caspol -ap samplepermset. xml
Then, to apply the permission set to a code group, do something like this:
caspol -cg 1.3 SamplePermSet
(By default, 1.3 is the 'Internet' code group)

8.7 I'm having some trouble with CAS. How can I diagnose my problem?

Caspol has a couple of options that might help. First, you can ask caspol to tell you what code group an assembly belongs to, using caspol -rsg. Similarly, you can ask what permissions are being applied to a particular assembly using caspol -rsp.

8.8 I can't be bothered with all this CAS stuff. Can I turn it off?

Yes, as long as you are an administrator. Just run:
caspol -s off

9. Intermediate Language (IL)

9.1 Can I look at the IL for an assembly?

Yes. MS supply a tool called Ildasm which can be used to view the metadata and IL for an assembly.

9.2 Can source code be reverse-engineered from IL?

Yes, it is often relatively straightforward to regenerate high-level source (e.g. C#) from IL.

9.3 How can I stop my code being reverse-engineered from IL?

There is currently no simple way to stop code being reverse-engineered from IL. In future it is likely that IL obfuscation tools will become available, either from MS or from third parties. These tools work by 'optimising' the IL in such a way that reverse-engineering becomes much more difficult.
Of course if you are writing web services then reverse-engineering is not a problem as clients do not have access to your IL.

9.4 Can I write IL programs directly?

Yes. Peter Drayton posted this simple example to the DOTNET mailing list:
.assembly MyAssembly {}
.class MyApp {
  .method static void Main () {
    ldstr      "Hello, IL!"
    call       void System.Console: :WriteLine( class System.Object)
Just put this into a file called, and then run ilasm An exe assembly will be generated.

9.5 Can I do things in IL that I can't do in C#?

Yes. A couple of simple examples are that you can throw exceptions that are not derived from System.Exception, and you can have non-zero-based arrays.

10. Implications for COM

10.1 Is COM dead?

This subject causes a lot of controversy, as you'll see if you read the mailing list archives. Take a look at the following two threads:
http://discuss. archives/ wa.exe?A2= ind0007&L=DOTNET&D=0&P=68241
http://discuss. archives/ wa.exe?A2= ind0007&L=DOTNET&P=R60761

FWIW my view is as follows: COM is many things, and it's different things to different people. But to me, COM is fundamentally about how little blobs of code find other little blobs of code, and how they communicate with each other when they find each other. COM specifies precisely how this location and communication takes place. In a 'pure' .NET world, consisting entirely of .NET objects, little blobs of code still find each other and talk to each other, but they don't use COM to do so. They use a model which is similar to COM in some ways - for example, type information is stored in a tabular form packaged with the component, which is quite similar to packaging a type library with a COM component. But it's not COM.
So, does this matter? Well, I don't really care about most of the COM stuff going away - I don't care that finding components doesn't involve a trip to the registry, or that I don't use IDL to define my interfaces. But there is one thing that I wouldn't like to go away - I wouldn't like to lose the idea of interface-based development. COM's greatest strength, in my opinion, is its insistence on a cast-iron separation between interface and implementation. Unfortunately, the .NET framework seems to make no such insistence - it lets you do interface-based development, but it doesn't insist. Some people would argue that having a choice can never be a bad thing, and maybe they're right, but I can't help feeling that maybe it's a backward step.

10.2 Is DCOM dead?

Pretty much, for .NET developers. The .NET Framework has a new remoting model which is not based on DCOM. Of course DCOM will still be used in interop scenarios.

10.3 Is MTS/COM+ dead?

No. The approach for the first .NET release is to provide access to the existing COM+ services (through an interop layer) rather than replace the services with native .NET ones. Various tools and attributes are provided to try to make this as painless as possible. The PDC release of the .NET SDK includes interop support for core services (JIT activation, transactions) but not some of the higher level services (e.g. COM+ Events, Queued components).
Over time it is expected that interop will become more seamless - this may mean that some services become a core part of the CLR, and/or it may mean that some services will be rewritten as managed code which runs on top of the CLR.
For more on this topic, search for postings by Joe Long in the archives - Joe is the MS group manager for COM+. Start with this message:
http://discuss. archives/ wa.exe?A2= ind0007&L=DOTNET&P=R68370

10.4 Can I use COM components from .NET programs?

Yes. COM components are accessed from the .NET runtime via a Runtime Callable Wrapper (RCW). This wrapper turns the COM interfaces exposed by the COM component into .NET-compatible interfaces. For oleautomation interfaces, the RCW can be generated automatically from a type library. For non-oleautomation interfaces, it may be necessary to develop a custom RCW which manually maps the types exposed by the COM interface to .NET-compatible types.
Here's a simple example for those familiar with ATL. First, create an ATL component which implements the following IDL:
import "oaidl.idl"; 
import "ocidl.idl";
     uuid(EA013F93- 487A-4403- 86EC-FD9FEE5E620 6),
     helpstring(" ICppName Interface"), 
     pointer_default( unique), 
interface ICppName : IUnknown
     [helpstring( "method SetName")] HRESULT SetName([in] BSTR name); 
     [helpstring( "method GetName")] HRESULT GetName([out, retval] BSTR *pName ); 
     uuid(F5E4C61D- D93A-4295- A4B4-2453D4A4484 D), 
     version(1.0) ,
     helpstring(" cppcomserver 1.0 Type Library")
     importlib("stdole32 .tlb");
     importlib("stdole2. tlb"); 
            uuid(600CE6D9- 5ED7-4B4D- BB49-E8D5D5096F7 0),  
            helpstring(" CppName Class") 
     coclass CppName
            [default] interface ICppName; 
When you've built the component, you should get a typelibrary. Run the TLBIMP utility on the typelibary, like this:
tlbimp cppcomserver. tlb
If successful, you will get a message like this:
Typelib imported successfully to CPPCOMSERVERLib. dll
You now need a .NET client - let's use C#. Create a .cs file containing the following code:
using System;
public class MainApp 
     static public void Main () 
            CppName cppname = new CppName();
            cppname.SetName( "bob" ); 
            Console.WriteLine( "Name is " + cppname.GetName( ) ); 
Note that we are using the type library name as a namespace, and the COM class name as the class. Alternatively we could have used CPPCOMSERVERLib. CppName for the class name and gone without the using CPPCOMSERVERLib statement.
Compile the C# code like this:
csc /r:cppcomserverlib. dll csharpcomclient. cs
Note that the compiler is being told to reference the DLL we previously generated from the typelibrary using TLBIMP.
You should now be able to run csharpcomclient. exe, and get the following output on the console:
Name is bob

10.5 Can I use .NET components from COM programs?

Yes. .NET components are accessed from COM via a COM Callable Wrapper (CCW). This is similar to a RCW (see previous question), but works in the opposite direction. Again, if the wrapper cannot be automatically generated by the .NET development tools, or if the automatic behaviour is not desirable, a custom CCW can be developed. Also, for COM to 'see' the .NET component, the .NET component must be registered in the registry.
Here's a simple example. Create a C# file called testcomserver. cs and put the following in it:
using System; 
namespace AndyMc 
     [ClassInterface( ClassInterfaceTy pe.AutoDual) ]
     public class CSharpCOMServer
            public CSharpCOMServer( ) {} 
            public void SetName( string name ) { m_name = name; } 
 public string GetName() { return m_name; }  
            private string m_name; 
Then compile the .cs file as follows:
csc /target:library testcomserver. cs
You should get a dll, which you register like this:
regasm testcomserver. dll /tlb:testcomserver. tlb /codebase
Now you need to create a client to test your .NET COM component. VBScript will do - put the following in a file called comclient.vbs:
Dim dotNetObj 
Set dotNetObj = CreateObject( "AndyMc.CSharpCO MServer") 
dotNetObj.SetName ("bob") 
MsgBox "Name is " & dotNetObj.GetName( )
and run the script like this:
wscript comclient.vbs
And hey presto you should get a message box displayed with the text "Name is bob".
An alternative to the approach above it to use the moniker developed by Jason Whittington and Don Box. Go to http://staff. jasonw/clr/ readme.htm to check it out.

10.6 Is ATL redundant in the .NET world?

Yes, if you are writing applications that live inside the .NET framework. Of course many developers may wish to continue using ATL to write C++ COM components that live outside the framework, but if you are inside you will almost certainly want to use C#. Raw C++ (and therefore ATL which is based on it) doesn't have much of a place in the .NET world - it's just too near the metal and provides too much flexibility for the runtime to be able to manage it.

11. Miscellaneous

11.1 How does .NET remoting work?

.NET remoting involves sending messages along channels. Two of the standard channels are HTTP and TCP. TCP is intended for LANs only - HTTP can be used for LANs or WANs (internet).
Support is provided for multiple message serializarion formats. Examples are SOAP (XML-based) and binary. By default, the HTTP channel uses SOAP (via the .NET runtime Serialization SOAP Formatter), and the TCP channel uses binary (via the .NET runtime Serialization Binary Formatter). But either channel can use either serialization format.
There are a number of styles of remote access:
  • SingleCall. Each incoming request from a client is serviced by a new object. The object is thrown away when the request has finished.
  • Singleton. All incoming requests from clients are processed by a single server object.
  • Client-activated object. This is the old stateful (D)COM model whereby the client receives a reference to the remote object and holds that reference (thus keeping the remote object alive) until it is finished with it.
Distributed garbage collection of objects is managed by a system called 'leased based lifetime'. Each object has a lease time, and when that time expires the object is disconnected from the .NET runtime remoting infrastructure. Objects have a default renew time - the lease is renewed when a successful call is made from the client to the object. The client can also explicitly renew the lease.
If you're interested in using XML-RPC as an alternative to SOAP, take a look at Charles Cook's XML-RPC.Net site at http://www.cookcomp xmlrpc/xmlrpc. shtml.

11.2 How can I get at the Win32 API from a .NET program?

Use P/Invoke. This uses similar technology to COM Interop, but is used to access static DLL entry points instead of COM objects. Here is an example of C# calling the Win32 MessageBox function:
using System; 
using System.Runtime. InteropServices; 
class MainApp 
     [DllImport(" user32.dll" , EntryPoint=" MessageBox" , SetLastError= true, CharSet=CharSet. Auto)]      
     public static extern int MessageBox(int hWnd, String strMessage, String strCaption, uint uiType);
     public static void Main () 
            MessageBox( 0, "Hello, this is PInvoke in operation!", ".NET", 0 ); 

12. Class Library

12.1 File I/O

12.1.1 How do I read from a text file?

First, use a System.IO.FileStrea m object to open the file:
FileStream fs = new FileStream( @"c:\test.txt" , FileMode.Open, FileAccess.Read );
FileStream inherits from Stream, so you can wrap the FileStream object with a StreamReader object. This provides a nice interface for processing the stream line by line:
StreamReader sr = new StreamReader( fs );
string curLine;
while( (curLine = sr.ReadLine( )) != null )
     Console.WriteLine( curLine );
Finally close the StreamReader object:
Note that this will automatically call Close() on the underlying Stream object, so an explicit fs.Close() is not required.

12.1.2 How do I write to a text file?

Similar to the read example, except use StreamWriter instead of StreamReader.

12.1.3 How do I read/write binary files?

Similar to text files, except wrap the FileStream object with a BinaryReader/ Writer object instead of a StreamReader/ Writer object.

12.2 Text Processing

12.2.1 Are regular expressions supported?

Yes. Use the System.Text. RegularExpressio ns.Regex class. For example, the following code updates the title in an HTML file:
FileStream fs = new FileStream( "test.htm", FileMode.Open, FileAccess.Read );
StreamReader sr = new StreamReader( fs ); 
Regex r = new Regex( "(.*)" ); 
string s; 
while( (s = sr.ReadLine( )) != null ) 
     if( r.IsMatch( s ) )  
            s = r.Replace( s, "New and improved ${1}" );
     Console.WriteLine( s ); 

12.3 Internet

12.3.1 How do I download a web page?

First use the System.Net.WebReque stFactory class to acquire a WebRequest object:
WebRequest request = WebRequest.Create( "http://localhost" );
Then ask for the response from the request:
WebResponse response = request.GetResponse ();
The GetResponse method blocks until the download is complete. Then you can access the response stream like this:
Stream s = response.GetRespons eStream() ;
// Output the downloaded stream to the console
StreamReader sr = new StreamReader( s );
string line;
while( (line = sr.ReadLine( )) != null )
     Console.WriteLine( line );
Note that WebRequest and WebReponse objects can be downcast to HttpWebRequest and HttpWebReponse objects respectively, to access http-specific functionality.

12.3.2 How do I use a proxy?

Two approaches - to affect all web requests do this:
System.Net.GlobalPr oxySelection. Select = new WebProxy( "proxyname", 80 );
Alternatively, to set the proxy for a specific web request, do this:
HttpWebRequest request = (HttpWebRequest) WebRequest. Create( "http://localhost" );
request.Proxy = new WebProxy( "proxyname", 80 );

12.4 XML

12.4.1 Is DOM supported?

Yes. Take this example XML document:
This document can be parsed as follows:
XmlDocument doc = new XmlDocument( );
doc.Load( "test.xml" );
XmlNode root = doc.DocumentElement ;
foreach( XmlNode personElement in root.ChildNodes )
     Console.WriteLine( personElement. FirstChild. Value.ToString( ) );
The output is:

12.4.2 Is SAX supported?

No. Instead, a new XmlReader/XmlWriter API is offered. Like SAX it is stream-based but it uses a 'pull' model rather than SAX's 'push' model. Here's an example:
XmlTextReader reader = new XmlTextReader( "test.xml" );
while( reader.Read( ) )
     if( reader.NodeType == XmlNodeType. Element && reader.Name == "PERSON" )
            reader.Read( ); // Skip to the child text
            Console.WriteLine( reader.Value );

12.4.3 Is XPath supported?

Yes, via the XPathXXX classes:
XPathDocument xpdoc = new XPathDocument( "test.xml" );
XPathNavigator nav = xpdoc.CreateNavigat or();
XPathExpression expr = nav.Compile( "descendant: :PEOPLE/PERSON" );
XPathNodeIterator iterator = nav.Select(expr) ;
while (iterator.MoveNext( ))
     Console.WriteLine( iterator. Current);

12.5 Threading

12.5.1 Is multi-threading supported?

Yes, there is extensive support for multi-threading. New threads can be spawned, and there is a system-provided threadpool which applications can use.

12.5.2 How do I spawn a thread?

Create an instance of a System.Threading. Thread object, passing it an instance of a ThreadStart delegate that will be executed on the new thread. For example:
class MyThread
     public MyThread( string initData )
            m_data = initData;
            m_thread = new Thread( new ThreadStart( ThreadMain) ); 
            m_thread.Start( );      
     // ThreadMain() is executed on the new thread.

     private void ThreadMain()
            Console.WriteLine( m_data );
     public void WaitUntilFinished( )
            m_thread.Join( );
     private Thread m_thread;
     private string m_data;
In this case creating an instance of the MyThread class is sufficient to spawn the thread and execute the MyThread.ThreadMain () method:
MyThread t = new MyThread( "Hello, world." );
t.WaitUntilFinished ();

12.5.3 How do I stop a thread?

There are several options. First, you can use your own communication mechanism to tell the ThreadStart method to finish. Alternatively the Thread class has in-built support for instructing the thread to stop. The two principle methods are Thread.Interrupt( ) and Thread.Abort( ). The former will cause a ThreadInterruptedEx ception to be thrown on the thread when it next goes into a WaitJoinSleep state. In other words, Thread.Interrupt is a polite way of asking the thread to stop when it is no longer doing any useful work. In contrast, Thread.Abort( ) throws a ThreadAbortExceptio n regardless of what the thread is doing. Furthermore, the ThreadAbortExceptio n cannot normally be caught (though the ThreadStart' s finally method will be executed). Thread.Abort( ) is a heavy-handed mechanism which should not normally be required.

12.5.4 How do I use the thread pool?

By passing an instance of a WaitCallback delegate to the ThreadPool.QueueUse rWorkItem( ) method:
class CApp
     static void Main ()
            string s = "Hello, World";
            ThreadPool.QueueUse rWorkItem( new WaitCallback( DoWork ), s );
            Thread.Sleep( 1000 );  // Give time for work item to be executed
     // DoWork is executed on a thread from the thread pool.
     static void DoWork( object state )
            Console.WriteLine( state );

12.5.5 How do I know when my thread pool work item has completed?

There is no way to query the thread pool for this information. You must put code into the WaitCallback method to signal that it has completed. Events are useful for this.

12.5.6 How do I prevent concurrent access to my data?

Each object has a concurrency lock (critical section) associated with it. The System.Threading. Monitor.Enter/ Exit methods are used to acquire and release this lock. For example, instances of the following class only allow one thread at a time to enter method f():
class C
     public void f()
                    Monitor.Enter( this);
                    Monitor.Exit( this);
C# has a 'lock' keyword which provides a convenient shorthand for the code above:
class C
     public void f()
Note that calling Monitor.Enter( myObject) does NOT mean that all access to myObject is serialized. It means that the synchronisation lock associated with myObject has been acquired, and no other thread can acquire that lock until Monitor.Exit( o) is called. In other words, this class is functionally equivalent to the classes above:
class C
     public void f()
            lock( m_object )
     private m_object = new object();

12.6 Tracing

12.6.1 Is there built-in support for tracing/logging?

Yes, in the System.Diagnostics namespace. There are two main classes that deal with tracing - Debug and Trace. They both work in a similar way - the difference is that tracing from the Debug class only works in builds that have the DEBUG symbol defined, whereas tracing from the Trace class only works in builds that have the TRACE symbol defined. Typically this means that you should use System.Diagnostics. Trace.WriteLine for tracing that you want to work in debug and release builds, and System.Diagnostics. Debug.WriteLine for tracing that you want to work only in debug builds.

12.6.2 Can I redirect tracing to a file?

Yes. The Debug and Trace classes both have a Listeners property, which is a collection of sinks that receive the tracing that you send via Debug.WriteLine and Trace.WriteLine respectively. By default the Listeners collection contains a single sink, which is an instance of the DefaultTraceListene r class. This sends output to the Win32 OutputDebugString( ) function and also the System.Diagnostics. Debugger. Log() method. This is useful when debugging, but if you're trying to trace a problem at a customer site, redirecting the output to a file is more appropriate. Fortunately, the TextWriterTraceList ener class is provided for this purpose.
Here's how to use the TextWriterTraceList ener class to redirect Trace output to a file:
Trace.Listeners. Clear();
FileStream fs = new FileStream( @"c:\log.txt" , FileMode.Create, FileAccess.Write );
Trace.Listeners. Add( new TextWriterTraceList ener( fs ) );
Trace.WriteLine( @"This will be writen to c:\log.txt!" );
Trace.Flush( );
Note the use of Trace.Listeners. Clear() to remove the default listener. If you don't do this, the output will go to the file and OutputDebugString( ). Typically this is not what you want, because OutputDebugString( ) imposes a big performance hit.

12.6.3 Can I customise the trace output?

Yes. You can write your own TraceListener- derived class, and direct all output through it. Here's a simple example, which derives from TextWriterTraceList ener (and therefore has in-built support for writing to files, as shown above) and adds timing information and the thread ID for each trace line:
class MyListener : TextWriterTraceList ener
     public MyListener( Stream s ) : base(s)
     public override void WriteLine( string s )
            Writer.WriteLine( "{0:D8} [{1:D4}] {2}", 
                    Environment. TickCount - m_startTickCount, 
                    AppDomain.GetCurren tThreadId( ),
                    s );
     protected int m_startTickCount = Environment. TickCount;
(Note that this implementation is not complete - the TraceListener. Write method is not overridden for example.)
The beauty of this approach is that when an instance of MyListener is added to the Trace.Listeners collection, all calls to Trace.WriteLine( ) go through MyListener, including calls made by referenced assemblies that know nothing about the MyListener class.

13. Resources

13.1 Recommended books

I recommend the following books, either because I personally like them, or because I think they are well regarded by other .NET developers. (Note that I get a commission from Amazon if you buy a book after following one of these links.)

13.2 Internet Resources

13.3 Weblogs

The following Weblogs ('blogs') have regular .NET content:

Receive All Free Updates Via Facebook.