title: Using existing database with ASP.NET 5 and EF7 (beta 7)
body: <p>I'm trying to connect to my existing database using an empty template project for ASP.NET and EF 7, beta 7. This is what my project.json looks like:</p>
  
  <pre><code>{
    "webroot": "wwwroot",
    "userSecretsId": "aspnet5-Titanes2015-409e9e37-b7bb-4185-b7aa-6dc336087524",
    "version": "1.0.0-*",
  
    "dependencies": {
      "EntityFramework.Commands": "7.0.0-beta7",
      "EntityFramework.SqlServer": "7.0.0-beta7",
      "Microsoft.AspNet.Authentication.Cookies": "1.0.0-beta7",
      "Microsoft.AspNet.Authentication.Facebook": "1.0.0-beta7",
      "Microsoft.AspNet.Authentication.Google": "1.0.0-beta7",
      "Microsoft.AspNet.Authentication.MicrosoftAccount": "1.0.0-beta7",
      "Microsoft.AspNet.Authentication.Twitter": "1.0.0-beta7",
      "Microsoft.AspNet.Diagnostics": "1.0.0-beta7",
      "Microsoft.AspNet.Diagnostics.Entity": "7.0.0-beta7",
      "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-beta7",
      "Microsoft.AspNet.Mvc": "6.0.0-beta7",
      "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-beta7",
      "Microsoft.AspNet.Server.IIS": "1.0.0-beta7",
      "Microsoft.AspNet.Server.WebListener": "1.0.0-beta7",
      "Microsoft.AspNet.StaticFiles": "1.0.0-beta7",
      "Microsoft.AspNet.Tooling.Razor": "1.0.0-beta7",
      "Microsoft.Framework.Configuration.Abstractions": "1.0.0-beta7",
      "Microsoft.Framework.Configuration.Json": "1.0.0-beta7",
      "Microsoft.Framework.Configuration.UserSecrets": "1.0.0-beta7",
      "Microsoft.Framework.Logging": "1.0.0-beta7",
      "Microsoft.Framework.Logging.Console": "1.0.0-beta7",
      "Microsoft.Framework.Logging.Debug" : "1.0.0-beta7",
      "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-beta7"
    },
  
    "commands": {
      "web": "Microsoft.AspNet.Hosting --config hosting.ini",
      "ef": "EntityFramework.Commands"
    },
  
    "frameworks": {
      "dnx451": { },
      "dnxcore50": { }
    },
  
    "exclude": [
      "wwwroot",
      "node_modules",
      "bower_components"
    ],
  
    "publishExclude": [
      "node_modules",
      "bower_components",
      "**.xproj",
      "**.user",
      "**.vspscc"
    ],
  
    "Data": {
      "DefaultConnection": {
        "ConnectionString": "Server=192.168.XX.XXX\\devsql;Database=XXXXXXX;Trusted_Connection=True;user id=XXXXXX;password=XXXXXX;MultipleActiveResultSets=true"
      }
    },
  
    "EntityFramework": {
      "ApplicationDbContext": {
        "ConnectionStringKey": "Data:DefaultConnection:ConnectionString"
      }
    },
  
    "scripts": {
      "prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ]
    }
  }
  </code></pre>
  
  <p>Now, I have looked all over Google and already checked the following questions: </p>
  
  <p><a href="https://stackoverflow.com/questions/32377834/database-first-ef7-beta7-dnx-ef-dbcontext-scaffold-command-fails">Database-first EF7-beta7 dnx ef dbcontext scaffold command fails</a></p>
  
  <p><a href="https://stackoverflow.com/questions/32741066/generating-code-from-an-existing-database-ef7">Generating code from an existing database EF7</a></p>
  
  <p>I have tried running all of the following commands, as mentioned in those posts:</p>
  
  <pre><code>dnx ef dbcontext scaffold "ConnectionString" EntityFramework.SqlServer
  dnx . ef dbcontext scaffold "&lt;connectionString&gt;"
  Scaffold-DbContext '&lt;connectionString&gt;'
  </code></pre>
  
  <p>Every single time I get the following error:</p>
  
  <blockquote>
    <p>The term 'dnx' is not recognized as the name of a cmdlet, function,<br>
    script file, or operable program. Check the spelling of the name, or
    if a path was included, verify that the path  is correct and try again</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>
  
  <p>Accessing my remote database from an empty template project should be a pretty straightforward process, but I've been fighting this for a while. Could anyone point me in the right direction?</p>