Thursday, August 21, 2014

How to add Reference to Class Library or framework reference in MVC 6

when we implmented application with Visual Studio 2003-2013, We can easily add the reference to

by right click on the selected reference folder






then we can browse to the specific folder to find the reference that we need. the specific class library will be added to the bin folder.

however i found that there is no Add Refernece item menu, after i right click on the reference folder



 






here is the description from MSDN for the project.Json

"Project.json is used by the ASP.NET vNext. This file is where you’ll find items like dependencies (for example NuGet packages or framework references for your project), a list of available build configurations, and a list of commands which can be invoked from the command line."

if you need any class library or DLL reference, you just need to update the Dependencies Section in the project.Json.

here is the picture show the project.json and reference before i added any new reference.




I added a System.Text.Encoding framework reference to the project.json file, and it appears in the reference folder immediately (i had highlighted it in blue color).



 the syntax of adding the new reference in the project.json


 first is the name of class, then it is the version number. there is a semi colum in between
 "System.Text.Encoding": "4.0.20.0". Each item is separated by a comma in the Dependencies section.







No comments:

Post a Comment