Compiles VS.NET solutions (or sets of projects), automatically determining project dependencies from inter-project references.

This task support the following projects:

Note: Right now, only Microsoft Visual Studio .NET 2002 and 2003 solutions and projects are supported. Support for .NET Compact Framework projects is also not available at this time.

The <solution> task also supports the model of referencing projects by their output filenames, rather than referencing them inside the solution. It will automatically detect the existance of a file reference and convert it to a project reference. For example, if project "A" references the file in the release output directory of project "B", the <solution> task will automatically convert this to a project dependency on project "B" and will reference the appropriate configuration output directory at the final build time (ie: reference the debug version of "B" if the solution is built as debug).

Note: The <solution> task expects all project files to be valid XML files.

Resx Files

When building a project for a down-level target framework, special care should be given to resx files. Resx files (can) contain references to a specific version of CLR types, and as such are only upward compatible.

For example: if you want to be able to build a project both as a .NET 1.0 and .NET 1.1 assembly, the resx files should only contain references to .NET 1.0 CLR types. Failure to do this may result in a InvalidCastException failure at runtime on machines with only the .NET Framework 1.0 installed.


Attribute Type Description Required
configuration string The name of the solution configuration to build. True
enablewebdav bool Allow the task to use WebDAV for retrieving/compiling the projects within solution. Use of WebMap is preferred over WebDAV. The default is false. False
includevsfolders bool Includes Visual Studio search folders in reference search path. The default is true. False
outputdir directory The directory where compiled targets will be placed. This overrides path settings contained in the solution/project. False
solutionfile file The name of the VS.NET solution file to build. False
failonerror bool Determines if task failure stops the build, or is just reported. The default is true. False
if bool If true then the task will be executed; otherwise, skipped. The default is true. False
unless bool Opposite of if. If false then the task will be executed; otherwise, skipped. The default is false. False
verbose bool Determines whether the task should report detailed build log messages. The default is false. False

Nested Elements:


The projects to build.



The projects to scan, but not build.



WebMap of URL's to project references.

Represents a single mapping from URL project path to physical project path.


pathfile Specifies the actual path to the project file, or the path fragment to replace. True
urlstring Specifies the URL of the project file, or a URL fragment to match. True
casesensitivebool Specifies whether the mapping is case-sensitive or not. False
ifbool Indicates if the URL of the project file should be mapped. False
unlessbool Indicates if the URL of the project file should not be mapped. False



Fileset of projects to exclude.



Set of folders where references are searched when not found in path from project file (HintPath).




Assembly: NAnt.VSNetTasks (0.85.2478.0)