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

后端 未结 2 686
太阳男子
太阳男子 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条回答
  • 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.

    0 讨论(0)
  • 2021-01-05 04:46

    You cannot add direct reference anymore, you would have to create your own nuget package containing it.

    See: http://forums.asp.net/t/2002302.aspx?Adding+a+non+nuget+reference+to+a+vNext+project

    As for the why, it is really easier to manage dependencies with nuget, download your sources anywhere, and with a single command (kpm restore) all nuget packages necessary will be downloaded.

    0 讨论(0)
提交回复
热议问题