My C# project references three files from a third-party SDK. By default, these files are written to the target build folder when I compile. But I don’t want them there (for complicated and irrelevant reasons). So I wrote a post build event to delete the DLLs after compilation:
<<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="cd "$(TargetDir)"
del MapInfo.RasterEngine.*.dll" />
</Target>
This worked fine for a long time until I got a new laptop. On the new laptop, the compilation removes the files, but when I press F5 to run the code in the debugger, the files reappear (and my program throws an exception because ).
I have a workaround, so I am not looking for an alternative solution. I simply want to know why this is happening. Has anyone seen this before or can explain it?