Programming4us
         
 
 
Programming

.NET Debugging : Introduction to the Tools - .NET 2.0—Redistributable & .NET 2.0—SDK

8/10/2011 9:17:41 AM

Debugging Tools for Windows

Usage scenarios:Collection of debuggers and tools
Version:6.8.4.0
Download point:www.microsoft.com/whdc/devtools/debugging/default.mspx

The Debugging Tools for Windows package is a freely available support package that contains a set of powerful debuggers and tools to help in the software troubleshooting process. The package comes in two flavors: 32-bit and 64-bit depending on which architecture you want to debug.

There are three user mode debuggers available in the Debugging Tools for Windows package—NTSD, CDB, and WinDbg—and one kernel mode debugger (kd). Although these debuggers are three separate tools, it is important to understand that they all rely on the same core debugger engine. The most significant difference between the debuggers is that WinDbg has a graphical user interface (GUI) component, making it easier to work with when doing source level debugging. In contrast, NTSD and CDB are purely console-based debuggers.

After choosing the flavor of the debugger (32-bit or 64-bit), the installation process for Debugging Tools for Windows is straightforward and the default installation options are typically sufficient. The default installation path is

%programfiles%\Debugging Tools for Windows

Please note that at the time of publishing the most recent version was 6.8.4.0.There should be relatively minor changes in the debugger output. The debugger download URL also keeps a history of prior debugger versions (going back two or three releases) that can be downloaded. If you want to use the exact same version, you can download the Debugging Tools for Windows corresponding to version 6.8.4.0.

.NET 2.0—Redistributable

Usage scenarios:.NET Runtime
Version:2.0
Download point:www.microsoft.com/downloads/details.aspx?familyid=0856eacb-4362-4b0d-8edd-aab15c5e04f5&displaylang=en

The .NET 2.0 Redistributable component constitutes the core of the .NET platform. It contains all the fundamental runtime components that are needed for .NET 2.0 applications to run, including all framework assemblies and the .NET runtime binaries.

The distinction between framework assemblies and runtime binaries is important as there has been quite a lot of confusion surrounding the various .NET releases. Not counting service packs, the following releases are currently available: 1.0, 1.1, 2.0, 3.0, and 3.5. Table 1-1 illustrates the main difference between each version.

Table 1. Currently Available Major .NET Versions
.NET VersionIncluded in WindowsArchitectureLatest SPRuntime ChangesFramework Changes
1.0NoneX863Initial VersionInitial Version
1.1Windows Server 2003X86, x64, IA641No[*]Yes
2.0Windows Server 2003 R2[**]X86, x64, IA641YesYes
3.0Windows VistaX86, x64, ia64 No[*]Yes (notably WPF, WCF, WF)
3.5Windows Server 2008X86, x64, ia64 No[*]Yes

[*] Minor changes may have been made to the runtime to accommodate the new framework features but it is not considered a major release of the runtime.

[**] Ships with Windows Server 2003 R2 but does not install by default.

If you are running on an operating system where the .NET 2.0 redistributable component is not installed, the installation process is straightforward. Simply navigate to the installation URL and select the default installation options.

.NET 2.0—SDK

Usage scenarios:Development libraries and tools
Version:2.0
Download point:www.microsoft.com/downloads/details.aspx?FamilyID=FE6F2099-B7B4-4F47-A244-C96D69C35DEC&displaylang=en

Although the redistributable package enables .NET applications to run on a computer, the .NET SDK component enables developers to create .NET applications by providing all the necessary tools (compiler, assembler, build tool) and libraries. The .NET SDK does not provide a GUI-based integrated development environment but rather a command-line driven environment.

Prior to installing the .NET 2.0 SDK, ensure that the .NET 2.0 Redistributable package has been installed. To install the .NET 2.0 SDK, navigate to the download URL and launch the setup. You will have a few options as part of the installation process:

  • Install quick start samples. Quick start samples are great tools when you want to get started building .NET applications. They include small pieces of sample code in the different .NET areas (such as ADO, interoperability, and networking).

  • Tools and Debuggers. This option installs a number of tools and debuggers. The debugger that comes as part of the .NET 2.0 SDK is DbgClr. DbgClr is a source-level GUI debugger with a look and feel similar to that of Visual Studio. If you are familiar with the Visual Studio debugger, using DbgClr will be a very similar experience.

  • Product Documentation. It is strongly recommended that you install the product documentation as it contains a ton of information useful when developing .NET applications.

The last step of the installation process is to select the installation location (default is %programfiles\Microsoft.net\SDK).

Included with the .NET 2.0 SDK is a build utility called MSBUILD. It is the same build utility that Visual Studio utilizes and works on the basis of defining the build process in XML format. Listing 1 shows an example of an MSBUILD project file for a simple .NET command line application written in C#.

Listing 1. MSBUILD project file for simple .NET command-line application
<Project DefaultTargets = "Compile"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003" >


<!-- Set the application name as a property -->
<PropertyGroup>
<appname>Welcome</appname>
</PropertyGroup>
<!-- Specify the inputs by type and file name -->
<ItemGroup>
<CSFile Include = "simple.cs"/>
</ItemGroup>


<Target Name = "Compile">
<!-- Run the Visual C# compilation using input files of type CSFile -->
<CSC
Sources = "@(CSFile)"
OutputAssembly = "$(appname).exe">
<!-- Set the OutputAssembly attribute of the CSC task
to the name of the executable file that is created -->
<Output
TaskParameter = "OutputAssembly"
ItemName = "EXEFile" />
</CSC>
<!-- Log the file name of the output file -->
<Message Text="The output file is @(EXEFile)"/>
</Target>
</Project>


To build an MSBUILD project, simply invoke the MSBUILD utility and point it to the project file (located in the same folder as source code):

C:\MSBuild>c:\Windows\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe build.xml
Microsoft (R) Build Engine Version 2.0.50727.1434
[Microsoft .NET Framework, Version 2.0.50727.1434]
Copyright (C) Microsoft Corporation 2005. All rights reserved.


Build started 4/7/2008 10:25:36 AM.


Project "C:\MSBuild\build.xml" (default targets):


Target Compile:
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Csc.exe
/out:Welcome.exe simple.cs
The output file is Welcome.exe


Build succeeded.
0 Warning(s)
0 Error(s)


Time Elapsed 00:00:00.86
Other -----------------
- .NET Debugging : Managed Heap and Garbage Collection
- Context and Interception : Custom Component Services (part 3) - The Transaction Management Service
- Context and Interception : Custom Component Services (part 2) - The Logbook Service
- Context and Interception : Custom Component Services (part 1) - Building a Custom Context Attribute & Installing a Custom Message Sink
- Software Testing with Visual Studio Team System 2008 : Data-driven unit testing
- Software Testing with Visual Studio Team System 2008 : Unit testing an ASP.NET application
- Microsoft Enterprise Library : Error Management Made Exceptionally Easy - Replacing an Exception & Logging an Exception
- Microsoft Enterprise Library : Error Management Made Exceptionally Easy - Diving in with a Simple Example
- iPhone Programming : Connecting to the Network - Embedding a Web Browser in Your App
- iPhone Programming : Connecting to the Network - Detecting Network Status
- Parallel Programming with Microsoft Visual Studio 2010 : Introduction to Parallel Programming - Software Patterns
- Parallel Programming with Microsoft Visual Studio 2010 : Introduction to Parallel Programming - Multicore Computing & Speedup
- Microsoft ASP.NET 3.5 : Web Services for ASP.NET AJAX Applications (part 2) - Consuming AJAX Web Services
- Microsoft ASP.NET 3.5 : Web Services for ASP.NET AJAX Applications (part 1) - Remote Calls via Web Services
- Microsoft ASP.NET 3.5 : AJAX-Enabled Web Services - Implementing the AJAX Paradigm
- The Art of SEO : Measuring Search Traffic (part 2)
- The Art of SEO : Measuring Search Traffic (part 1)
- Programming Excel with VBA and .NET : Tasks in Visual Basic - Do Math
- Programming Excel with VBA and .NET : Tasks in Visual Basic - Interact with Users
- Context and Interception : The .NET Context
 
 
Most View
- Exchange Server 2010 : Fundamentals and Components of Federated Delegation (part 4)
- Setting SEO Goals and Objectives
- Migrating Databases and Data to SQL Azure (part 6) - Building a Migration Package
- Upgrading to SQL Server 2008 : Upgrading Other SQL Server Components
- Microsoft Exchange Server 2003: Configuring Recipient Objects (part 2) - Managing Mailboxes
- jQuery 1.3 : The jQuery UI plugin library
- SharePoint 2010 : Social Sites: Providing a Structure for Collaborative Conversations
- Windows 7 : Migrating the Existing User Data - Working with Windows Easy Transfer (part 2)
- Working with Windows 7’s Basic Network Tools and Tasks (part 2) - Setting Up a Homegroup
- SQL Azure Primer (part 4) - Creating Logins and Users
Top 10
- Implementing Edge Services for an Exchange Server 2007 Environment : Utilizing the Basic Sender and Recipient Connection Filters (part 3) - Configuring Recipient Filtering
- Implementing Edge Services for an Exchange Server 2007 Environment : Utilizing the Basic Sender and Recipient Connection Filters (part 2)
- Implementing Edge Services for an Exchange Server 2007 Environment : Utilizing the Basic Sender and Recipient Connection Filters (part 1)
- Implementing Edge Services for an Exchange Server 2007 Environment : Installing and Configuring the Edge Transport Server Components
- What's New in SharePoint 2013 (part 7) - BCS
- What's New in SharePoint 2013 (part 6) - SEARCH
- What's New in SharePoint 2013 (part 6) - WEB CONTENT MANAGEMENT
- What's New in SharePoint 2013 (part 5) - ENTERPRISE CONTENT MANAGEMENT
- What's New in SharePoint 2013 (part 4) - WORKFLOWS
- What's New in SharePoint 2013 (part 3) - REMOTE EVENTS