Add existing assembly to an mvc 6 project

狂风中的少年 提交于 2019-12-19 03:59:21

问题


I'm testing Visual Studio 2015 and playing with mvc 6, all is fine, but when I try to add a reference, only proyects in the current solution are shown, I have an existing assembly already and I want to add it, but I don't see the option, how can I add a reference to a mvc 6 Project to an existing assembly?


回答1:


I think Visual studio 2015 is in preview and we can not add reference that we used to do it Visual Studio 2013.

For now onwards we add nuget package to Web Application ( ASP.net 5 or Say ASp.net MVC 6)

Now suppose you decided to build your own class library and I have successfully created library into another solution and added to my mvc 6 project.

Following are the step.

  1. Create ASP.net 5 Class Library project.
  2. Implement your functionality and I have just added few class.
  3. After this step I publish project to say location C:\published ( During publish mark option pre-compilation) Just like image below

  4. After this step if you visit location C:\published then it has path like C:\published\approot\packages.
  5. Now set following thing in Visual studio 2015 preview for package able to search.

  6. Now go to project.json file of your mvc project. Add reference to your library.

I hope this help you.



来源:https://stackoverflow.com/questions/27582305/add-existing-assembly-to-an-mvc-6-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!