Friday, February 18, 2011

MSB3147: Could not find required file 'setup.bin' on a x64 machine.

Another day spent on the issue above. This one shows up during the automated build on a x64 machine. The MsBuild script works as a charm on a development machine and fails on the build server.

As internet explains, this issue stems from the fact that there’s no way for MsBuild to locate the folder containing so called bootstrapper which is required to assembly a ClickOnce setup package. Even if the SDK is installed but VS is not, there are some registry entries missing.

If you ever encounter this issue, please do know that there is a workaround which will work for sure – you just copy the Engine folder from the "c:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Engine" folder (assuming you are on .NET 4.0) to the folder of your ClickOnce app. To us, this was unacceptable.

What about other solutions? Well, the blog post above mentions that MsBuild tries to locate the Engine folder by reading the information from following registry entries:

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

And, well, that’s not exactly true. First, forget about 2. and 3., you possibly do not have these on your development machine and, still, the solution builds correctly. Second, the 1. should refer to “4.0” instead of “1.0” in case you build for .NET 4.0.

And third, remember that on 64-bit machines the registry entry differs from the one above, it should be HKLM\Software\Wow6432Node\Microsoft\GenericBootstrapper\4.0 (note the Wow6432Node in the path).

2 comments:

Felix said...

Thank you. Had the same problem on our Build server (other 4.0 projects with ClickOnce build ok but this new one failed..)

on my dev pc and on the build server was only a "12.0" key with the path under GenericBootstapper. Simply added the 4.0 Key and Path, Problem solved :-)

Wiktor Zychla said...

@Felix: I've just blogged on this like few days ago, http://www.wiktorzychla.com/2013/11/msb3147-could-not-find-required-file-on.html