Issue with clickonce bootstrapper and msbuild
Asked Answered
M

9

14

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?

Mccown answered 25/8, 2010 at 15:25 Comment(2)
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.Mccown
This solution worked for me after 4h of trying to make it work: Get Visual Studio C# Express for bootstrapper/engine/setup.binBobbibobbie
O
15

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:

Organ answered 25/1, 2011 at 17:44 Comment(1)
On a 64-bit system the registry keys are under HKLM\Software\Wow6432Node\Microsoft\ - see netpl.blogspot.com.au/2011/02/…Monaco
A
6

You can also pass the location of the bootstrapper packages to the common Publish target like this:

<PropertyGroup>
     <BootstrapperSdkPath>C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper</BootstrapperSdkPath>
</PropertyGroup>

and then

<Target Name="Publish">
    <MSBuild Targets="publish" ... Properties="GenerateBootstrapperSdkPath=$(BootstrapperSdkPath); ..."/>
</Target>
Alleman answered 7/11, 2012 at 11:6 Comment(1)
After spending countless hours trying every other solution to this problem, this worked and is so straightforward. Thanks.Toreador
K
3

I struggled with the same problem on my win7 x64 machine. I have not installed Visual Studio and tried to build and publish a .NET 4.5 WPF solution. I had to add the following keys to the registry

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\GenericBootstrapper\11.0]
"Path"="C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v8.1A\\Bootstrapper\\"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\GenericBootstrapper\4.0]
"Path"="C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v8.1A\\Bootstrapper\\"

You also need to copy the Bootstrapper folders from your dev machine. This blogpost directed me in the right direction http://www.wiktorzychla.com/2013/11/msb3147-could-not-find-required-file-on.html

Kinchen answered 20/5, 2014 at 13:2 Comment(0)
A
2

I had a similar issue to this but in my case I do have Visual Studio installed on the box, and publishing from Visual Studio works fine. When publishing from the command line with msbuild.exe, the build failed with aforementioned error "MSB3147 Could not find required file 'setup.bin'".

The solution was to explicitly specify what version of Visual Studio to use during build.

<MSBuild
  Projects="MyProject.csproj"
  Targets="publish"
  Properties="Configuration=Release;PublishUrl=C:\AnyFolder;VisualStudioVersion=12.0"/>

I have Visual Studio 2013 on a Win7 x64 machine. My reading of the problem is that MSBuild was looking in the wrong place in the registry. By explicitly telling MS Build to use VS 12.0, it picked the correct registry location entry and consequently the correct path to BootstrapperSdkPath.

Ampoule answered 21/7, 2014 at 10:4 Comment(0)
S
1

I was able to fix this problem by pointing to MSBuild.exe from this location

C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe

Previously I was pointing to

C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe

Sinciput answered 27/8, 2016 at 6:48 Comment(0)
P
1

Hi I know this answer its soooooo late but just in case

I had to add the Path prop to the task, with the Path where the bootstrapper its located, in my case I used Visual Studio 2015 so the Path is:

**Program Files(x86)\Microsoft Visual Studio 14.0\SDK\Boostrapper**

MSBuild has a Task GenerateBootstrapper in my case

    <GenerateBootstrapper> 
       AplicationFile="$(AppName)"
       ApplicationName=..
       ApplicationUrl=..
       BootstrapperItems=..
       Culture=..
       ApplicationUrl=.. 
       Path="Program Files(x86)\Microsoft Visual Studio 14.0\SDK\Boostrapper\"
    </GenerateBootstrapper>

with this the MSBuild is able to recognize and generate the file

Now i'm stucked with the .net 4 bootstrapper but guess is another story...

Proser answered 7/9, 2016 at 20:13 Comment(0)
W
0

I experienced this same error via my TeamCity build server. The cause in my case was that I was running an MSBuild task against my .sln file, with a 'MyProject:publish' target. In this case, the solution+projecth had been updated to target .NET v4.5, but the build server was still configured to use MSBuild Tools 4.0 and .NET v4.0.

Took me a little while to work out the inconsistency between working and non-working branch builds.

Woollyheaded answered 2/10, 2014 at 1:40 Comment(0)
C
0

I added this line to script. It helped.

call "%VS120COMNTOOLS%vsvars32.bat"

Visual Studio 2013, SDK v8.1A.

Carnallite answered 22/11, 2014 at 0:34 Comment(0)
Y
0

Just struggled with this myself - I chose to commit the bootstrapper files to source control. It is possible to override the path to bootstrappers, just provide /p:GenerateBootstrapperSdkPath=.build\Bootstrapper

Then no need to modify registry - and the added benefit that the build is now self-contained.

Only "problem" is that I have to manually copy the Bootstrapper files into source control. In my case (VStudio2015), this meant copying the files from C:\Program Files (x86)\Microsoft Visual Studio 14.0\SDK\Bootstrapper

Yoo answered 21/9, 2016 at 7:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.