views:

24

answers:

1

I have a SQL Server CE Database file that gets re-deployed every time I run. This makes testing difficult.

The only way I have found that allows me to get around it is to open the database file on the device using Query Analyzer. My best guess is that this locks the file.

Opening the db (and putting in the password) takes some time (it will frequently disconnect due to my application).

I would love a quick any easy way to lock this file so I will not re-deploy every time I run from Visual Studio? (just when I want it to). Anyone have a good idea on how to do this on windows mobile?

A: 

Are you saying the database file itself is part of your project and it's Build Action is set to "Content"? If so, change the "Copy to Output Directory" property to "Do not Copy". You can then switch it on the occasions when you do want it deployed.

ctacke
This would work except that I could not check it in like that or my automated build would fail. Eventually I would accidentally check it in. (I have tried before and I checked it in after a while.)
Vaccano
In this case I'd add a separate project for the solution called something like "static_files" or whatever. Add the database file to it. Then add a new configuration specifically for your automated build. Turn on deploy for the project for that configuration, turn it off for your standard debug configuration.
ctacke