Custom MSBuild Task Development with Visual C++ Wyoming

Visual C++ 2010 sees the integration of MSBuild with Visual C++. MSBuild is Microsoft's common build engine and one of its key design goals is the ability to support a high-degree of flexibility in customizing the build process. See how a custom MSBuild task can be built in Visual C++, and how the task can be used to customize the build process of other Visual C++ 2010 projects.

Local Companies

Dubois Technical Services Web Site: Www.Duboistech.Com
(307) 455-2690
302 Horse Creek Rd
Dubois, WY
OPTEC Communications - "Fiber Optic Services"
307-778-4054
Web Page: www.fiber-splice.net
Cheyenne, WY

The introduction of MSBuild in Visual C++ 2010 opens up the C++ compilation and linking process to a high degree of customization and extension. Prior to MSBuild, the build process could only be extended with pre- and post-build steps that offered limited flexibility and were decoupled from the rest of the build process. In contrast, MSBuild allows fine-tuned, integrated extension, and any new-format Visual C++ project file (vcxproj) can be customized to complete whatever task is required during a build.

In my last Using Visual C++.NET article, MSBuild basics were covered, including Tasks, which are the building-blocks of the build process. Tasks take items and properties to complete some action, and tasks are chained together in targets, with targets being the entry point into a MSBuild file. MSBuild and Visual C++ ship with a large number of predefined tasks, but in the spirit of MSBuild extensibility, custom task development is extremely easy with helper classes present in the MSBuild assemblies. The remainder of this article will cover the process of building a custom MSBuild task in C++/CLI and then using this task in a Visual C++ 2010 project.



Developing the Hard Link Task



The NT File System (NTFS) supports a feature known as hard links, which allows multiple directory entries to map to the same underlying file. Hard links have a number of advantages over simply copying a file, with the main advantage being that, because all directory entries point to the same physical file, an update to the file is automatically available to all consumers of the file regardless of which directory entry the file is accessed through. Using hard links also conserves disk space, as multiple copies of the same file are not scattered randomly across a drive.

Read the Rest of this Article at Developer.com

Featured Local Company

OPTEC Communications - "Fiber Optic Services"

307-778-4054
Web Page: www.fiber-splice.net
Cheyenne, WY

Related Local Events
Ag, Energy & Natural Resource Committee Meeting
Dates: 4/5/2010 - 4/5/2010
Location: Chamber of Commerce
Gillette, WY
View Details

Public Policy Committee Meeting
Dates: 5/6/2010 - 5/6/2010
Location: Chamber of Commerce
Gillette, WY
View Details

Retail Committee Meeting
Dates: 6/1/2010 - 6/1/2010
Location: Chamber of Commerce
Gillette, WY
View Details

NEWCA Board Meeting
Dates: 6/3/2010 - 6/3/2010
Location: Chamber of Commerce
Gillette, WY
View Details

Executive Board Meeting
Dates: 10/13/2010 - 10/13/2010
Location: Chamber of Commerce
Gillette, WY
View Details

Topics: 
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML