title: What is deps.json, and how do I make it use relative paths?
body: <p>I'm setting up an ASP.NET Core project on TeamCity. The binaries it builds crash on startup on other machines. The error message shows that it is looking for dlls in paths that only exist on the build server. DotPeek shows that there's an embedded resource file in the .exe called <code>myproject.deps.json</code>. In the targets section there, there are references to dlls using absolute paths. This means that ASP.NET Core binaries are only ever going to run on the machine on which they were built.</p>
  
  <p>How do I fix this problem? What is this file, and how do I make it use relative paths? After some digging, it looks like the paths come from <code>project.fragment.lock.json</code>, which is a generated file. If I edit this to use relative paths, the file is just overwritten again. What generates this, and how can it be fixed, or stopped?</p>
  
  <p>For those who asked, <code>project.json</code> looks like:</p>
  
  <pre><code>{
    "dependencies": {
      "CommandLineParser": "1.9.71",
      "Microsoft.AspNetCore.Mvc": "1.0.0",
      "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
      "Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
      "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
      "Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
      "Microsoft.Extensions.Configuration.Json": "1.0.0",
      "Microsoft.Extensions.Logging": "1.0.0",
      "Microsoft.Extensions.Logging.Console": "1.0.0",
      "Microsoft.Extensions.Logging.Debug": "1.0.0",
      "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
      "System.Configuration.Abstractions": "1.0.0"
    },
  
    "tools": {
      "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
    },
  
    "frameworks": {
      "net461": {
        "dependencies": {
          "Company.Common": {
            "target": "project"
          },
          "Company.Integration": {
            "target": "project"
          },
          "Company.Functions": {
            "target": "project"
          },
          "Company.Utils": {
            "target": "project"
          }
        }
      }
    },
  
    "buildOptions": {
      "emitEntryPoint": true,
      "preserveCompilationContext": true
    },
  
    "publishOptions": {
      "include": [
        "wwwroot",
        "Views",
        "Areas/**/Views",
        "appsettings.json",
        "web.config"
      ]
    },
  
    "scripts": {
      "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
    }
  }
  </code></pre>