How can i add local dll at the asp.net 5 project

后端 未结 2 699
太阳男子
太阳男子 2021-01-05 04:02

I am trying to make an ASP.NET 5 site use visual studio 2015 preview, and i want to add dll at local file system to the ASP.NET 5 project. But i can\'t find this option, Is

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-05 04:36

    If you have project code than you can add Foo.csproj to Bar.xproj as reference but not directly, see instructions below. It can be done without uploading packages in Beta8 but it is not simple as it should be. If you only have Foo.dll there is one hint here: Bin syntax (wrapping a dll)

    1. Go too Foo.csproj folder, type: dnv wrap Foo.csproj.
    2. You should now have some files generated, for me it was Foo/wrap/Foo/project.json. Go to your solution in Visual Studio, Add -> Existing project -> project.json.
    3. Now you have some more files, including Foo.xproj which is available in Visual Studio solution, but it does not build.
    4. Open cmd in Foo dir and execute dnv restore.
    5. After 4) completes with no error and Foo.xproj can be built you can now go to Bar.xproj and add Foo.xproj as reference.
    6. Open cmd in Bar directory and execute dnv restore.
    7. You can now build Bar.xproj

    I really hope that this will be easier in final version.

提交回复
热议问题