Monday, June 23, 2014

Building/Publishing ClickOnce projects in a TFS build server without installing Visual Studio

If you have tried to build or publish a ClickOnce project in a build server, you might find that you receive the following error:

Could not find required file 'setup.bin'

This basically means that MSBuild can't locate a bootstrap file needed to be able to build/publish ClickOnce applications

I have tried to fix it by installing the following Windows SDK on the TFS build servers:

Unfortunately, this was not enough to fix it.

After a lot of research, I found that the missing setup.bin file is actually installed locally in my developer environment where I have installed Visual Studio

So the fix looks like hacky but it works perfectly

Procedure to fix it:

  1. In the TFS build server, install this Windows SKD
  2. From your local environment (with Visual Studio installed), copy the following two folders
    • C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper\Engine
    • C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper\Schemas
  3. Paste those two folders in your TFS build server:
    • C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper
  4. Update the Windows Registry in the TFS build server by running the following command (save the text in a file with the extension .reg and double click it):

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

That's it, the next time you try to build and publish your ClickOnce application in the TFS build server will run smoothly

No comments:

Post a Comment

If you found this post useful please leave your comments, I will be happy to hear from you.