Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue with clickonce bootstrapper and msbuild

I have a CruiseControl .NET build server running on Windows Server 2003, and I am trying to build and publish my ClickOnce application using msbuild.

Everything is working fine, except when I enable the bootstrapper of my ClickOnce application. When this happens, I get the following error in the DeploymentGenerateBootstrapper target:

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets (3939,9):

error MSB3147: 

Could not find required file 'setup.bin' in 'E:\Projects\src\TestProject\Engine'.

.NET Framework 3.5 SP1 and 4 and latest Windows SDK for both are installed on the server, but the bootstrapper folder in C:\Program Files\Microsoft SDKs\Windows\versionNo\ does not exist. I tried copying the files from my workstation machine with no luck.

I do not want to install Visual Studio on server and only install the necessary SDKs.

I have also tried copying the bootsrapper folder from my machine

C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper

C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper

to build server but no luck.

Any ideas?

like image 215
nabeelfarid Avatar asked Aug 25 '10 15:08

nabeelfarid


1 Answers

You will also have to add the associated key and value to the registry to allow MSBuild to find the path to the Bootstrapper folder. I can confirm that this has worked for me using the following regedit.

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\GenericBootstrapper\4.0]
@="0"
"Path"="C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\Bootstrapper\\"

Update: According to Emma's TFS Blog it appears the following registry values are checked in order to find the bootstrapper path and if not found looks in your local project folder under the Engine sub folder and then bails with the MSB3147 error if not found there.

  1. HKLM\Software\Microsoft\GenericBootstrapper\<.NET Tools Version>\
  2. HKLM \Software\Microsoft.NetFramework\SDKInstallRoot\Bootstrapper
  3. HKLM \Software\Microsoft\VisualStudio\\InstallDir\Bootstrapper

Reminder: Also remember that there is a 32-bit and a 64-bit registry so be sure to add this value to the same registry that your tools will be accessing.

In the meantime I've also created a feature request to get a more reasonable solution for this issue. Please vote on my feature request to get Microsoft to take a look at it.

BTW, here are a few more links about this issue:

  • http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/7672078f-f2bd-4142-b8a9-740c2a8a5ae7
  • http://social.msdn.microsoft.com/Forums/en/msbuild/thread/6964ba78-5b66-4cd1-bdd1-b31edb76b96a
  • http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/97ac8717-daf7-4554-8dfa-8a63da47a17d
  • MSBuild: error MSB3147: Could not find required file 'setup.bin'
  • https://connect.microsoft.com/VisualStudio/feedback/details/361924/remove-bootstrapper-from-microsoft-sdks-directory
  • http://blogs.msdn.com/b/emmamou/archive/2009/04/08/team-build-for-clickonce-application-with-bootstrapper.aspx?CommentPosted=true#commentmessage
like image 69
jpierson Avatar answered Sep 24 '22 23:09

jpierson