Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wix HeatFile Task Locks Dll

I'm using the Wix HeatFile task in a post build step

<HeatFile OutputFile="Interop.dll.wxs" File="..\Interop\bin\x86\$(Configuration)\Interop.dll" DirectoryRefId="INSTALLDIR" ComponentGroupName="Interop_Dll" AutogenerateGuids="true" SuppressFragments="true" SuppressRootDirectory="true" ToolPath="$(WixToolPath)" PreprocessorVariable="var.InteropBinDir" />

Once I do a build, it locks my dll and subsequent builds fail with:

Error   6   Unable to copy file "obj\x86\Debug\Interop.dll" to "bin\x86\Debug\dll". The process cannot access the file 'bin\x86\Debug\Interop.dll' because it is being used by another process. Interop

until I restart Visual Studio.

How can I stop the Wix task from causing this problem?

like image 598
Jeff Avatar asked Feb 27 '12 20:02

Jeff


1 Answers

It seems that this property for the heat task solves your problem:

RunAsSeparateProcess="true"

I had the same problem with HeatDirectory tasks, and it worked for me. Solution was taken from http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Locked-DLL-files-when-using-WiX-HeatDirectory-MSBuild-tasks-td6015042.html

like image 122
mortomanos Avatar answered Oct 17 '22 08:10

mortomanos