Wix HeatFile任务锁定Dll

Jef*_*eff 6 wix visual-studio-2010 wix3.5

我在后期构建步骤中使用Wix HeatFile任务

<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" />
Run Code Online (Sandbox Code Playgroud)

一旦我进行构建,它会锁定我的dll,后续构建失败:

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
Run Code Online (Sandbox Code Playgroud)

直到我重新启动Visual Studio.

如何阻止Wix任务导致此问题?

小智 8

似乎这个热任务的属性解决了你的问题:

RunAsSeparateProcess="true"
Run Code Online (Sandbox Code Playgroud)

我对HeatDirectory任务有同样的问题,它对我有用.解决方案来自http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Locked-DLL-files-when-using-WiX-HeatDirectory-MSBuild-tasks-td6015042.html