Q1 - When doing a compile/debug is VS supposed to delete existing files in the bin\debug area? (for VS2008)
if no then can I ask please:
Q2 - My winforms checks for existance of a sqlite.db3 file and creates it if it needs to (programmatically). If the behavior I wanted was that each Compile/Debug I do is for the target Debug area to be clear, so that the program would exercise the code that builds the database file, how would I organise this?
thanks
Simply add a PreBuild event.
Edited to add:
Well... looks like someone wants it all chewed up and ready to swallow. Okie dokie!
Navigate to
a. Compile
tab and click on the Build Events
button if a VB project
b. Build Events
tab if it's a C# project
in the pre-build event command line
type:
IF EXIST "$(TargetDir)\sqlite.db3" DEL "$(TargetDir)\sqlite.db3"
That should do it.
Next time, fiddle a little longer...
"Clean" will only delete files that Visual Studio is explicitly copying to the target directory (your executable, dependent dlls, and those files marked with appropriate "Copy to Output Directory" values).
You might create a pre-build or post-build task to delete the file in question. Something like del $(TargetDir)\sqlite.db3
. See the "Build Events" tab in your project properties for these events.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With