Share via


Troubleshooting Team Foundation Builds for Web Projects

The following section describes common troubleshooting scenarios you may experience when you build Web projects with Team Foundation Build.

Web Projects Are Not Being Built

The build configuration must be set to ".NET" for building Web projects only, and to "Mixed Platforms" for building a mix of Web projects and other managed projects in Visual Studio.

If you have specified an incorrect build configuration, this warning is recorded in the build log file:

Warning MSB4126: The specified solution configuration "Release|Any CPU" is invalid. Specify a valid solution configuration using the Configuration and Platform properties (e.g, MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration.

Solution

Change the configuration to "Mixed Platforms" or ".NET" by editing the tfsbuild.proj file for your build type. Alternatively, when you create a new build type, select either ".NET" or "mixed Platforms" as the configuration on the Configurations page of the New Team Build Type Creation Wizard. For more information, see How to: Create a New Build Type.

Conflicting Directory Structures

By default, when you create a Web project in Visual Studio, the solution files and Web site files are stored in two different locations. For a Web project, "SampleWS," the solution files are saved in:

  • <root>:\Documents and Settings\user\My Documents\Visual Studio 2005\Projects\SampleWS

The Web site files are saved in:

  • <root>:\Documents and Settings\user\My Documents\Visual Studio 2005\Websites\SampleWS

A Web project solution file contains a PhysicalPath property that points to the Web site folder to locate it for compilation. However, when a Web project solution is checked in to source control, the solution file is stored in the root folder and the Web sites are stored in immediate sub folders. The result of this is broken PhysicalPath properties in the source-controlled solution file. During the build, Team Foundation Build synchronizes the Web project files like they are persisted in source control. Compilation errors result because the source-controlled directory structure differs from the structure stored in the solution file.

If you have conflicting directory structures in the solution file and source control, this error is recorded in the build log file:

ASPNETCOMPILER(0,0): error 1003: The directory d:\<builddirectory>\MyTeamProject\SampleWS\WebSites\SampleWS\' doesn't exist.

Solution

  • Create a blank a solution in Visual Studio, and then create websites in the same location as the solution.

  • Modify the properties Debug.AspNetCompiler.PhysicalPath and Release.AspNetCompiler.PhysicalPath in the solution file to point to the source-controlled website folder.

See Also

Other Resources

Administering Team Foundation Build
Troubleshooting Team Foundation Build
Managing Builds with Team Foundation Build