Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Looking in <code>EntityFramework.psm1</code> it is merely a scripting facade for the EntityFramework.PowerShell.dll. The actual add-migrations functionality is implemented in the <code>System.Data.Entity.Migrations.AddMigrationCommand</code> class in that assembly.</p> <p>Looking at the source, it gets the currently active project (I assume that's the project that's selected in the powershell console) through this line:</p> <pre><code>get { return (Project)_domain.GetData("project"); } </code></pre> <p><code>Project</code> is <code>EnvDTE.Project</code> which (if I google correctly) is a way to interface with the IDE. Some further source reading reveals that files are added to the project by interfacing with the IDE.</p> <p><strike>To me it looks like the scaffolding code is too heavily integrated with the Visual Studio to be possible to run outside of Visual Studio as part of a command line build.</strike></p> <h3>Edit</h3> <p>I'm getting back to this and figured out that it might be possible. There's another SO question that describes how to use EnvDTE outside of visual studio, e.g. from command line apps:</p> <p><a href="https://stackoverflow.com/questions/16994899/open-dte-solution-from-another-program-not-add-in">Open DTE solution from another program (not add-in)</a></p> <p>So it might indeed be possible to write an own .exe wrapper around the <code>EntityFramework.PowerShell.dll</code> if the app domain is prepared with the proper EnvDTE objects before calling the <code>AddMigrationCommand</code> class. To do that you would have to analyze the Entity Framework source code to know how to fool the scaffolding code to beleive it runs inside of Visual Studio.</p> <p>So, in the end: It might be possible - but it will be a non trivial project to write your own tool for it.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload