Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 it no longer possible to add local dll? If yes, why?The add references window

like image 471
Jeffrey Zhang Avatar asked Nov 29 '14 03:11

Jeffrey Zhang


2 Answers

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.

like image 100
wbuch Avatar answered Sep 18 '22 03:09

wbuch


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.

like image 42
watbywbarif Avatar answered Sep 20 '22 03:09

watbywbarif