title: dnx build - type or namespace not found. Missing reference?
body: <p>I have made an empty asp.net web app with the new dnu/dnx/vscode combo of utilities.</p>
  
  <p>It's working fine until I try to add 3.party libraries.</p>
  
  <p>I have tried to add MongoDB with the following cmd:</p>
  
  <pre><code> dnu install MongoDb.Driver
   dnu restore
  </code></pre>
  
  <p>This adds the mongodb dependency to my project.json file:</p>
  
  <pre><code>{
    "webroot": "wwwroot",
    "version": "1.0.0-*",
    "dependencies": {
      "Microsoft.AspNet.Mvc": "6.0.0-beta4",
      "Microsoft.AspNet.Server.IIS": "1.0.0-beta4",
      "Microsoft.AspNet.Server.WebListener": "1.0.0-beta4",
      "Microsoft.AspNet.StaticFiles": "1.0.0-beta4",
      "Kestrel": "1.0.0-beta4",
      "Microsoft.Framework.ConfigurationModel.Json": "1.0.0-beta4",
      "MongoDb.Driver": "2.0.0"
    },
    ...
  </code></pre>
  
  <p>but when I try to actually reference mongo, things fail:</p>
  
  <pre><code>using MongoDB.Bson;
  </code></pre>
  
  <p>VSCode gives me intellisense to add this namespace, but it adds a red squiggle under <code>MongoDB</code> and a green one under <code>Bson</code>.</p>
  
  <p>when I try to build the project with</p>
  
  <pre><code>dnu build
  </code></pre>
  
  <p>it fails with the message</p>
  
  <pre><code>C:\source\.....cs(2,7): error CS0246: The type or namespace name 'MongoDB' could not be found (are you missing a using directive or an assembly reference?)
  </code></pre>
  
  <p><strong>What am I missing here?</strong> </p>
  
  <p>My <code>project.json</code> file is totally untouched - except for the added mongo dependency:</p>
  
  <pre><code>{
    "webroot": "wwwroot",
    "version": "1.0.0-*",
    "dependencies": {
      "Microsoft.AspNet.Mvc": "6.0.0-beta4",
      "Microsoft.AspNet.Server.IIS": "1.0.0-beta4",
      "Microsoft.AspNet.Server.WebListener": "1.0.0-beta4",
      "Microsoft.AspNet.StaticFiles": "1.0.0-beta4",
      "Kestrel": "1.0.0-beta4",
      "Microsoft.Framework.ConfigurationModel.Json": "1.0.0-beta4",
      "MongoDb.Driver": "2.0.0"
    },
    "commands": {
      "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000",
      "kestrel": "Microsoft.AspNet.Hosting --server Kestrel --server.urls http://localhost:5001"
    },
    "frameworks": {
      "dnx451": {},
      "dnxcore50": {}
    },
    "exclude": [
      "wwwroot",
      "node_modules",
      "bower_components"
    ],
    "publishExclude": [
      "node_modules",
      "bower_components",
      "**.xproj",
      "**.user",
      "**.vspscc"
    ]
  }
  </code></pre>