(This article also published in my public number "dotnet daily Essence article", Welcome to the right QR code to pay attention to. )
Preface: Because project dependencies are referenced through "packages" in ASP. NET 5, it is possible to use and debug external code, such as the DNX runtime.
. One additional benefit of NET open source is that the library reference to ASP. 5 is more flexible, not only to reference a compiled package from NuGet, but also to reference the local source code. As long as the local source code conforms to the packaging rules, that is, the source code root folder "src" contains the project subfolder, the project directory contains the Project.json file, then the project reference to these source code is similar to referencing the package downloaded from NuGet.
Rick Strahl in this article to refer to "Microsoft.Framework.OptionsModel" to solve a bug in the DNX runtime, for example, to explain how to reference and debug the external source code package. The approximate steps are as follows:
1, download (clone) The source code that needs to be debugged. This step needs to be noted that the currently dependent version is selected correctly. For example, the current DNX use is beta4, then the source code to switch to this tag.
2. Connect the downloaded source code to the project. is to modify the Global.json file in the root of the solution and add the external source code folder to "Projects" as shown in:
3. Add a reference to the source code package. To debug external source code, you also need to explicitly add this package dependency in your project, as follows:
"Dependencies": { "MICROSOFT.ASPNET.MVC""6.0.0-beta4", ... "Microsoft.Framework.OptionsModel" "1.0.0-beta4" },
After that, Visual Studio automatically adds the project where the source code resides as an existing project.
4, open the external source code, find the place where you want to debug, add a breakpoint to start debugging.
A more detailed explanation can be "read the original".
Original address: Http://weblog.west-wind.com/posts/2015/Jun/09/Using-and-Debugging-External-Source-Code-Packages-in-ASPNET-5
Using and debugging external source packages in an ASP. NET 5 Project