Pergunta

I recently switched a windows forms application to use SQL Compact 4 database and Entity Framework. I handle the updates to the application through the application (no windows services). When an update is sent out to the device, all data is cleared (the data directory is deleted) and the exe gets replaced with a new exe.

This works fine except the next time the application is launched, Windows pops up with a message "Please Wait While Windows Configures 'Application Name'". Windows then proceeds to add back the database file automatically and set my exe back to the previous version.

Why is Windows adding the old database file and reverting my exe? How do I stop this from happening?

screenshot

Foi útil?

Solução

It appears that adding the database to the program data folder in the installer project caused this. Removing the file from there and programmatically adding the database file there resolved this issue.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top