I am testing our application to use a SQL Server Compact 4.0 database. The application uses the database if it is there or builds it using Entity Framework 4.3 Migrations when it is absent.
However, when I delete the file when the program is idle and then perform an action that will cause database reads I get a File not found
error. This is hardly a real world scenario, but I do want to understand what is going on.
It seems that somewhere at the background the framework is keeping track of the fact that there has already been a check on whether the database needed to be created. I am not sure if I like that if that indeed is the case.
So, why is the database created when it is first accessed, but not recreated while the program runs? ( I understand there will be many good reasons for this, but I want to know where the implementation lies).