Team build for ClickOnce application with bootstrapper

(Chinese Version)


When one builds an ClickOnce application which requires bootstrapper, the team build might fail with the error message in the build report resembles this:

“C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(3604,9): error MSB3147: Could not find required file ‘setup.bin’ in ‘BuildAgent_work_folder\Sources\Project_Root\Engine’. “


The error is raised from a MSBuild task named GenerateBootstrapper. It looks on local machine for the resources to make the bootstrapper setup.exe file. The task searches the bootstrapper resource files (setup.bin and its friends) installation path by checking registry keys one by one:

1. HKLM\Software\Microsoft\GenericBootstrapper\1.0\path

2. HKLM \Software\Microsoft\.NetFramework\SDKInstallRoot<Version>\Bootstrapper

3. HKLM \Software\Microsoft\VisualStudio\<Version>\InstallDir\Bootstrapper

In each step of the search, if MSBuild finds the registry value is set, it uses the value as the bootstrapper resource installation path and stops searching. If none of these registry value are found, it takes the root path of the ClickOnce project  being built.  MSBuild tries to locate \engine\setup.bin file under bootstrapper resource installation path. If the file is not found there, MSB3147 occurs.


The bootstrapper files comes as part of .Net Framework SDK. During the SDK installation a set of files/folders are copied to the disk. The registry value is created and set to point to the installation path. On a computer that does not have .Net Framework SDK/Visual Studio IDE installed, none of the registry key would be set. In such case MSBuild will try to find the resource files under the ClickOnce  project root and fail there.


So the solution would be to install .Net Framework SDK on the build machine.  If one installs windows SDK or Visual Studio IDE, .Net Framework SDK will be installed as a part .

Comments (7)

  1. ( English Version ) 当使用团队构建(Team Build)来构建带有bootstrapper的ClickOnce应用程序时,构建过程可能会失败,日志中带有如下错误信息(采自英文版)

  2. Vishal says:

    Installing only .Net framework SDK is not working. And we cannot install Visual studio on the server.

    I copied the files from my laptop to the server and added required registry key, with path pointing to the copied files.

  3. Dave says:

    The solution will not work. The ClickOnce bootstrapper is not part of the SDK (even though it is in the SDK folder), it is installed with Visual Studio. See…/ViewFeedback.aspx

    As far as I can tell, there is no solution to this problem, except to copy the files from a box with Visual Studio to the build machine (which probably violates a license agreement) and set the registry values. Lame.

  4. Jeff says:

    @Dave – I agree double Lame! If the Windows SDK doesn't give us all that we need on a build server then I think it warrants a new type of Visual Studio minimal install for build servers specifically. See my related connect bug for more details and help me vote if you want to make it priority.…/clickonce-bootstrapper-generation-issues-on-build-server

  5. Umesh says:

    I have Visual Studio 2005, 2008 and Visual Studio 2010 installed. I also have installed Windows 7 SDK and redistributables yet I continue to get this error. I have searched several forums without an answer.

    Are there other settings such as MSBUild path that installations should have made but could be missing?

  6. Ian Crane says:

    I have installed Visual Studio 2010 with all options selected, but none of the registry entries exist and my C:Program FilesMicrosoft SDKsWindowsv6.0ABootstrapper folder only contains one item – a folder named Packages.  I reinstalled VS 2010 with the repair option, but no luck.  I installed SP1 for VS as well.  Running Windows XP with all updates as of 1/24/2010.