3

In my project.json, I need to refer to a library that I'm using during development, but don't want included in the project output. This is common for things like static analyzers and other tools.

Before project.json, this was handled by a metadata tag in the package .nuspec file. But, this no longer works (as far as I know) for projects following the new JSON standard.

How do I declare a development-only dependency in the new standard?

Nate Barbettini
  • 51,256
  • 26
  • 134
  • 147

2 Answers2

3

As of 1.0.0-rc1, the correct syntax is:

"dependencies": {
    "HelloShared": { 
        "version": "0.1-beta-*",
        "type": "build"
    }
},

This declares HelloShared as a build (development-only) dependency of the current project.

I found this example in dnx/samples/HelloWorld/project.json on Github.

Nate Barbettini
  • 51,256
  • 26
  • 134
  • 147
0

Project.json has a publishOptions:exclude section.

Danny van der Kraan
  • 5,344
  • 6
  • 31
  • 41