I am afraid that you can not make VS build system ignore prebuild event but as a workaround, you can make your pre build event run a scrip that checks for those files
before trying to delete, this way , if a file does not exist, then pre build event does not try to delete it.
This posting is provided "AS IS" with no warranties, and confers no rights.
>From: goose23@spu.edu (Matthew Peltzer)
>Newsgroups: microsoft.public.vsnet.ide
>Subject: ignoring results of Pre-Build Event
>Date: 31 Mar 2004 13:34:32 -0800
>Organization:
http://groups.google.com >Lines: 19
>Message-ID: <75a1cd5a.0403311334.356f90a@posting.google.com>
>NNTP-Posting-Host: 209.161.7.211
>Content-Type: text/plain; charset=ISO-8859-1
>Content-Transfer-Encoding: 8bit
>X-Trace: posting.google.com 1080768873 21229 127.0.0.1 (31 Mar 2004 21:34:33 GMT)
>X-Complaints-To: groups-abuse@google.com
>NNTP-Posting-Date: Wed, 31 Mar 2004 21:34:33 +0000 (UTC)
>Path: cpmsftngxa06.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!news.glorb.com!
postnews2.google.com!not-for-mail
>Xref: cpmsftngxa06.phx.gbl microsoft.public.vsnet.ide:11617
>X-Tomcat-NG: microsoft.public.vsnet.ide
>
>Greetings,
>
>I have a project that has a number of dlls and a single exe (which
>loads the libraries at runtime with LoadLibrary) as outputs. In the
>dlls' Post-Build Event I copy each dll to a 'stage' location, which is
>the working directory for the exe during debugging.
>
>I would like to have a Pre-Build Event for each dll that deletes the
>dll from the stage area so as to avoid debugging with old code. 'del
>$stagepath\$(TargetFileName)' works only if the dll exists in the
>stage area, otherwise the compiler tells me:
>error PRJ0019: A tool returned an error code from "Performing
>Pre-Build Event..."
>
>Is there any way in the IDE to ignore the result of the 'del' command?
> Is there another way to have this command always return a success
>status?
>
>--mpeltzer, goose23@spu.edu
>