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:
- HKLM\Software\Microsoft\GenericBootstrapper\1.0\path
- HKLM \Software\Microsoft\.NetFramework\SDKInstallRoot<Version>\Bootstrapper
- 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).