Best way to add NuGet packages as project references in VS2012?

前端 未结 4 1156
夕颜
夕颜 2020-12-02 10:18

Ok. Really quick question, I\'m probably just being thick.

If you right-click on a projects \'references\' folder then \'Manage NuGet Packages\' you can then instal

4条回答
  •  伪装坚强ぢ
    2020-12-02 11:10

    Nowadays I use the Package Manager Console (View->Other Windows->Package Manager Console).

    Chances are all you'll ever need are the following two commands:

    install-package  [-version ] [-project 

    and

    update-package  [-reinstall] [-version ] [-project ]
    

    where

    • Parts within square brackets [ ] are optional.
    • 'install-package' will install to the specified project, or if not specified the one selected in the 'Default Project' drop down at the top of the command window.
    • 'update-package' will apply changes to every project unless a project is specified.
    • '-reinstall' means uninstall then install the package again at the same version number.

    At first I thought the behaviour of these commands was a little weird, but with experience I see that they are most useful like this. Although personally I would ditch the 'Default Project' drop down entirely.

提交回复
热议问题