Pages

Wednesday, October 26, 2016

.NET Core - how to add project reference

Well, in prev. version of .NET adding a new project reference is quite straightforward, however in .NET Core is still a challenge (thanks to the missing tools). So, let's see how to reference your custom Foo.Lib into your Foo.Web project.


  1. Open project.json in Foo.Web
  2. Find frameworks tag
  3. Add a new tag "dependencies"
  4. Extend with your Foo.Lib under dependencies.


It should look like something similar:

"frameworks": {
    "netcoreapp1.0": {
      "dependencies": {
        "Foo.Lib": "1.0.0-*",        
      },
      "imports": [
        "dotnet5.6",
        "portable-net45+win8"
      ]
    }
  },

Recompile your whole solution and now you can use your lib in the web project.

No comments:

Post a Comment