all groups > visual studio .net ide > march 2004 >
You're in the

visual studio .net ide

group:

ignoring results of Pre-Build Event



ignoring results of Pre-Build Event goose23 NO[at]SPAM spu.edu
3/31/2004 1:34:32 PM
visual studio .net 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?

RE: ignoring results of Pre-Build Event sumas NO[at]SPAM online.microsoft.com
4/12/2004 10:39:03 PM
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.
Thanks
Sumas[MS]

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
[quoted text, click to view]

RE: ignoring results of Pre-Build Event agaisi1 NO[at]SPAM -NOSPAM-yahoo.com
6/16/2004 5:22:04 PM
I had a similar problem and solved it by placing exit /b 0 at end of pre-build event. Remember that the pre-build event translates into a .bat file so anything you would put in a .bat could be put in the pre-build event.

SO, my prebuild looks like this:
call "%VS71COMNTOOLS%vsvars32.bat"
regsvcs.exe /u $(TargetFileName)
EXIT /B 0


---
Posted using Wimdows.net NntpNews Component -

AddThis Social Bookmark Button