Project reference in ASP.NET 5

Introduction

Visual Studio Code global.json project reference sectionNew type of project for ASP.NET 5 control their references through project.json file. This blurs boundary between NuGet reference, some framework reference, project reference and COM reference that exists in classic projects. It’s very convenient but what if you would like to step through & debug external source code?

Project reference

Solution is to create or edit global.json file in your solution. The projects value tells DNU where to find your source code. You may add there relative or non relative paths. For example:

Remember – DNU will use only those projects which project.json is one level below folders you have pointed (eg. src\MyProject\project.json, c:\\sources\\Configuration\\src\\Microsoft.Extensions.Configuration\\project.json).
If DNU previously downloaded project into cache you will have to run dnu restore and dnu build again to make sure you pick up proper code.

Further reading

* ASP.NET 5 documentation

Leave a Reply