TFS heat file access denied problem occurs usually on TFS server. When you try to set up WiX project to build automatically in TFS build, there’s a good chance you will get error, saying something like this:
heat.exe: Access to the path '..\WixSetupProject\adminfiles.wxs' is denied.
This means that as TFS build gets the latest files from source control, files will be automatically marked as “read-only”. This is default behavior with TFS. However, heat needs to modify the files, because it is harvesting. One of the solutions to this problem can be found here: http://www.rajapet.com/2013/12/a-work-around-for-files-in-use-bug-with.html
There is another solution that I use. Namely: don’t include the heated files in TFS. This functionality is supported from VS2012 onward. In VS solution explorer, select the files you want to exclude. Then go to File->Source Control->Advanced->Exclude files from source control.
And that’s it!
Well, almost. To my surprise, it was actually not enough, as “check-in” kept checking these files in, accidentally. This might have been Visual Studio bug, but I solved it with one extra-step.
Add new file called “.tfignore” to root of the Wix installer, and include it in the project. This file will hold path/pattern to files that it should never check-in.
#ignore all automatically generated heat files. Heat\Auto\*.wxs
By the way, to actually create that tricky file, you need to use something like “Notepad++”. I don’t think Notepad can create those files.