How to make ASP.Net 5 a link A regular .Net class library that is not part of your solution

I used to ask this question and got an answer that worked. In order for ASP.Net 5 to reference the regular .NET class library for the .NET Framework 4.5, you must remove the "dnxcore50": {} 'link from the project.json file.

Great. This worked with a simple ClassLibrary project that did nothing.

Now I'm trying to do this with more complex class libraries. Class libraries that reference other NuGet packages (for example, HtmlAgilityPack) and the same method do not work.

This is very unpleasant. I'm a little dumbfounded that just a link to the class library no longer works in the new version of ASP.Net.

One of the “functions” that seems to be removed is the ability to refer to a compiled DLL for a project that is not in your solution. The Browse button has disappeared from the Add Link dialog box in an ASP.Net 5 project:

enter image description here

While the classic project has a browse button:

enter image description here

Why? How can I refer to the class library, which is located on my machine, but I do not want to include in my project?

+4
source share
1 answer

In order to reference the DLL on your computer, but not in your solution, you need to update project.json as follows :

{
    "frameworks" : 
    {
        "dnx451" : 
        {
            "bin" : { "assembly": "<path to dll>", "pdb": "<path to pdb if needed>" }
        }
    }
}

, dnx VS2015 ( , , ) Asp.net - .

+7

All Articles