diff --git a/src/Squirrel/Squirrel.csproj b/src/Squirrel/Squirrel.csproj
index 9d88e91f9..fd7ab6c5b 100644
--- a/src/Squirrel/Squirrel.csproj
+++ b/src/Squirrel/Squirrel.csproj
@@ -105,10 +105,12 @@
- cd "$(TargetDir)"
-"$(SolutionDir)packages\ILRepack.1.26.0\tools\ILRepack.exe" /internalize /out:$(TargetFileName).tmp $(TargetFileName) Mono.Cecil.dll NuGet.Core.dll
-del "$(TargetFileName)"
-ren "$(TargetFileName).tmp" "$(TargetFileName)"
+
+ cd "$(TargetDir)"
+ ren "$(TargetFileName)" "$(TargetFileName).tmp.dll"
+ "$(SolutionDir)packages\ILRepack.1.26.0\tools\ILRepack.exe" /internalize /out:$(TargetFileName) $(TargetFileName).tmp.dll Mono.Cecil.dll NuGet.Core.dll
+ del "$(TargetFileName).tmp.dll"
+