Can't check .mdf / .ldf in App_Data in TFS
Go to Team Explorer and find Excluded Changes and you should exclude it. Right click on the App_Data folder and enable it.
But you can revise including the database files. As development and testing progresses, every little interaction with the database causes a change, and most of it is trivial. Also, if anyone else is working on this project, they might not want your database file to overwrite them when they get the latest version.
If you are using Entity Framework Code-First, the database is automatically created when you build the project, which I believe, otherwise you just run the Update-Database command to do it. This allows each employee to have their own local database file to work with. You can also use migrations to create updates to the database structure. If you want the database to be generated with pre-populated data, you must use the Seed method.
source to share
This is a common question. As "Ty Morrow" already answered in the comment above, there is an original Seed method in the Entity Framework that ensures that all values ββare inserted. However, there are many scenarios where you also need to work with the last added / removed DB items not present in the seed method.
Please follow these steps to ensure that the data catalog file is included in the source control.
- Click App_Data strong> and in the toolbar in environment click Show all files as below screenshot
- Right click in the MDF (Data Source) file and select Include in project
- Right click again in the MDF file and select Include in Source Control
- Just Go to the file Right click in the root folder of the project directory and show the file under Source Control
source to share