我怎样才能在asp.net 5项目中添加本地的dll

问题描述:

我试图做一个ASP.NET 5个网站,使用Visual Studio 2015年preVIEW,我想在本地文件系统中添加DLL到ASP.NET项目5。但我无法找到这个选项,它是不再可能添加本地的dll?如果是,为什么?

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?

如果您有项目code比你可以到Bar.xproj添加Foo.csproj作为参考,但不是直接的,看下面的说明。它可以在不上传在Beta8包来完成,但它不是简单,因为它应该是。如果你只有Foo.dll有一个暗示此处的斌语法(包装一个dll)

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. 去得Foo.csproj文件夹,键入: DNV包装Foo.csproj

  2. 现在应该已经生成了一些文件,对我来说是美孚/包装/美孚/ project.json 。转到在Visual Studio解决方案,添加 - >现有项目 - > project.json

  3. 现在,你有一些更多的文件,包括 Foo.xproj 这是在Visual Studio解决方案可用,但它并没有建立。

  4. 在富DIR
  5. 开启cmd并执行 DNV恢复

  6. 4后),没有出错完成和Foo.xproj可以建立你现在可以去Bar.xproj并添加Foo.xproj作为参考。

  7. 在酒吧目录
  8. 开启cmd并执行 DNV恢复

  9. 现在,你可以建立Bar.xproj

  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.