Referencing Library in ASP.NET Core 1.0 (vNext)

后端 未结 3 2211
离开以前
离开以前 2021-02-19 11:44

I am learning ASP.NET Core 1.0 (vNext). With that in mind, I have a solution that is structured like this:

MySolution
  src
    MyLibrary
      MyClass.cs
               


        
3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-19 12:28

    Are you using Visual Studio 2015 RC? If so then follow these steps:

    1. Expand your web project in the Solution Explorer
    2. Right click on References
    3. Click on Add Reference... from the context menu
    4. Select Projects from the Reference Manager
    5. Tick the checkbox next to MyLibrary
    6. Click OK
    7. Profit

    If you are not using visual studio then this can be achieved by updated the project.json file in your web project.

    If you created a "vNext class library project" then add this to the dependencies property on the json object:

    "dependencies": {
          "MyLibrary": "1.0.0-*"
       }
    

提交回复
热议问题