问题
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?
回答1:
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
来源:https://stackoverflow.com/questions/9471849/wix-heatfile-task-locks-dll