How to reference an ASP.NET 5 project from another project?

I have a web application project created from ASP.NET 5 Preview Templates in VS2015. It runs on dnx 1.0.0-beta7, but I use the full .NET platform, not the .NET Core.

As part of the same solution, I have a NUnit class library project, but when I try to add a web project as a link here, Visual Studio says: "Link to" ... "cannot be added."

Is there a workaround for this? Or what is the preferred way to unit test ASP.NET vNext applications?

+4
source share
2 answers

- , - ASP.NET 5 . :

Solution
|-- Web
|   |-- project.json
|-- Tests
|   |-- project.json

, Roslyn .

, Tests - Tests\project.json:

{
    "webroot": "wwwroot",
    "version": "1.0.0-*",

    "dependencies": {
        "Web": "1.0.0-*"
    },

    "frameworks": {
        "dnx451": { },
        "dnxcore50": { }
    }
}

, global.json , .

Solution
|-- global.json
|-- Web
|   |-- project.json
|-- Tests
|   |-- project.json

global.json :

{
    "sources": ["Web", "Tests"]
}

" " Visual Studio 2015

ASP.NET 5 Web Visual Studio 2015 :

<ProjectName> .

, , , DNX, . , ASP.NET Class Library (Package), .

+2

, "", .

, "Project Reference" (, ), " "... ​​".

, " ", DLL ( bin ), "wrap".

DLL " ", !

"" , / , .

0

Source: https://habr.com/ru/post/1609791/


All Articles