A found an article (Extend the Visual Studio Build Process) that explained how to override build targets in a C# project file. I tested this, and it seems to work well. However, what I really want to do is override a build target in a C++ project (with Visual Studio 2005). The problem is that C++ projects use different XML. Instead of having <project>
as the root, C++ projects have <VisualStudioProject>
as the root. When I add the <target>
tag to a C++ project file and try to open the project in Visual Studio, I get this error:
The following error has occurred during XML parsing:
File: [Path to Project File].vcproj Line: 304 Column: 30 Error Message: Element 'Target' is unexpected according to content model of parent element 'VisualStudioProject'.
The file '[Path to Project File].vcproj' has failed to load.
How can I override a Visual Studio build target for a C++ project? Or is there a better way to customize what happens during a C++ build?