Power Tools: EF "Reverse Engineer Code First" tool should add reference to EF package if not installed


Ported from Dev11 TFS bug 446140.

After creating a new empty console application (C#), if the EF power tools are installed in the machine the "Entity Framework --> Reverse Engineer Code First" option is available. If we use it, it will add the appropriate classes to the project, but since it doesn't have the reference to the EF assemblies, it won't build.

We should either have the tool also add the reference (or package reference), or disable the option in the context menu if the required assemblies are not referenced.

  1. Install the EF Power Tools
  2. Create a C# console application
  3. Create a DB with one table (e.g., sqlexpress, localdb, etc)
  4. Right-click on the project, select Entity Framework --> "Reverse Engineer Code First"
  5. Select the database created on step 2, click ok
  6. Build the project
Expected: project builds fine
Actual: many errors due to missing EF references
Closed Feb 27, 2013 at 11:26 PM by RoMiller
Fixed and verified as part of Power Tools Beta 3


BriceLambson wrote Dec 13, 2012 at 8:39 PM

This was implemented in Beta 2, but it looks like NuGet has since been updated in a way that prevents it from working.

BriceLambson wrote Dec 13, 2012 at 9:03 PM

Fixed in changeset 5195fea6e558

mgirgin wrote Jan 18, 2013 at 10:09 PM

Moved Release to EF6