Syncing Visual Studio Database Project With Entity Framework

Or: Quirks of Using Entity Designer Database Generation Power Pack

If you’re searching for a way to synchronise a “Visual Studio Database Project” (also known as “SQL Server Database Project” or “TSData Project”) with an Entity Framework model, you’ve probably already encountered the “Entity Designer Database Generation Power Pack”.

With model first development, the most basic use case is to synchronise the database project with the model. If you are trying to achieve this, you need to be aware of conventions that have been baked into the tool:

  1. Your “.edmx” file must have the same name as the “.dbproj” (i.e. database project name).
    • It is just the file name of the model that is important.
    • Neither the “Namespace” or “Entity Container Name” properties of the model need to match the file name. In fact, you will not be able to use names containing full-stops/periods (“.”) in these properties, but you may well require that for the file name if you’ve named your database project in this fashion.
    • It is just the file name of the database project that is important too. The name of the
  2. Your database project must lie in the root of the solution structure. i.e. do not put your database project in a solution folder.

Footnote

There won’t be any more development of the “Entity Designer Database Generation Power Pack”, as the functionality is being provided as part of the “SQL Server Developer Tools”, code named Juneau. This would be the better toolset to use to satisfy this use case.

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s