Using and debugging external source packages in an ASP. NET 5 Project

Source: Internet
Author: User

(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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.