title: How can I do an Entity Framework Core project and add a Migration in Visual Studio 2015 from nuget prompt?
body: <p>In Visual Studio 2015, I created an ASP.net Core project (formerly called ASP.NET 5). The template for the project  creates an MS SQL localdb for persistence, along with entity framework, and some authentication tables.</p>
  
  <p>After I figured out how to browse the localdb database that was created for this project, I decided to try modifying a model object and attempting a Code First Migration with ASP.NET MVC Web Site template sample application. It uses EF to provide login persistence to a localdb.  I tried using the </p>
  
  <p>The demo app already includes a Migrations folder.  But if you type <code>add-migration SomeNameHere</code> into the Package manager console, or <code>enable-migrations</code> it seems that it is not possible to work with the ER Migrations with the sample projects.</p>
  
  <p>I added a string property to the <code>IdentityModel.cs</code> unit, and I tried to manually add it by hand to the <code>0000...IdentitySchema.cs</code> file, but obviously I don't know how to do that correctly, as when I run the application, I got some errors, shown below.  I believe I need to basically have the Entity Framework code-first tool generate some skeleton .cs unit that's going to go into the Migrations folder.  </p>
  
  <p>The usual things people suggest to do now are:</p>
  
  <ul>
  <li>Make sure you ran as administator. (Done)</li>
  <li>Make sure you uninstall the Entity Framework and Reinstall it into the Solution you want it active in(Done)</li>
  </ul>
  
  <p>Reinstallation looked like this from package manager console: </p>
  
  <pre><code>PM&gt; Uninstall-Package EntityFramework
  Uninstalling NuGet package EntityFramework.7.0.0-beta4.
  Successfully uninstalled 'EntityFramework.7.0.0-beta4' from WebApplicationDNX.
  PM&gt; Install-Package EntityFramework -IncludePrerelease
  Installing NuGet package EntityFramework.7.0.0-beta4.
  Successfully installed 'EntityFramework.7.0.0-beta4' to WebApplicationDNX.
  PM&gt; 
  </code></pre>
  
  <p>Here I believe I'm making a mistake because I'm trying to run a command like add-migration and I'm unable to do it. It turns out this was never supported for me to try stuff like this:</p>
  
  <pre><code>PM&gt; add-migration DummyMigrate
  add-migration : The term 'add-migration' is not recognized as the name of a cmdlet, function, script file, or operable program. .... 
  PM&gt; enable-migration
  enable-migration : The term 'enable-migration' is not recognized as the name of a cmdlet, function, script file, or operable program. 
  ...
  </code></pre>
  
  <p>Is it possible to get an entity framework migration to work from Visual Studio 2015, from an <code>ASP.NET 5 Preview Templates -&gt; Web Site</code> template based application?</p>
  
  <p>(updates 1 to 4 removed as they are for useless historical betas)</p>
  
  <p>Update 5: In asp.net core 1.0.0-RC2 the dnx tool has gone away, replaced by dotnet, but the underlying principle that the <code>dotnet ef</code> command <em>must be run from your project source directory</em> not from your solution directory, and to do so, you should probably use an external command prompt or use PowerShell Tools for Visual Studio, not the nuget command line prompt.</p>
  
  <pre><code>   solution-dir           project-source-dir
           |                       |
  d:\dev\AspNetCoreWebAp\src\AspNetCoreWebAp&gt;dotnet ef
  Project AspNetCoreWebAp (.NETCoreApp,Version=v1.0) will be compiled because expected outputs are missing
  Compiling AspNetCoreWebAp for .NETCoreApp,Version=v1.0
  Compilation succeeded.
      0 Warning(s)
      0 Error(s)
  Time elapsed 00:00:03.0846647
  
                       _/\__
                 ---==/    \\
           ___  ___   |.    \|\
          | __|| __|  |  )   \\\
          | _| | _|   \_/ |  //|\\
          |___||_|       /   \\\/\\
  Entity Framework .NET Core CLI Commands 1.0.0-preview1-20901
  Usage: dotnet ef [options] [command]
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/beIwB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/beIwB.png" alt="enter image description here"></a></p>