03.11.2016 Views

Beginning ASP.NET 4.5 in CSharp and VB Opsylum

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

An Introduction to jQuery x 389<br />

You can f<strong>in</strong>d the full documentation on the Manage NuGet Packages dialog box <strong>in</strong> the documentation<br />

section of the NuGet website at http://bit.ly/q2PiyM.<br />

Besides us<strong>in</strong>g this dialog box, you can also manage packages us<strong>in</strong>g the Package Manager Console.<br />

Us<strong>in</strong>g the Package Manager Console<br />

The Package Manager Console enables you to manage your packages from a comm<strong>and</strong>-l<strong>in</strong>e <strong>in</strong>terface.<br />

This is not as user-friendly as us<strong>in</strong>g the dialog box, but once you get the hang of us<strong>in</strong>g NuGet you’ll<br />

f<strong>in</strong>d that the console can be really useful. Us<strong>in</strong>g the console you can access the same features as with<br />

the dialog box <strong>and</strong> more. Figure 11-2 shows the Package Manager Console, which you can access<br />

from the ma<strong>in</strong> menu by choos<strong>in</strong>g Tools Í Library Package Manager Í Package Manager Console.<br />

FIGURE 11-2<br />

NOTE NuGet is updated quite often (you’ll be notifi ed by Visual Studio when a<br />

new release is available) so your version number may be slightly different. That<br />

doesn’t matter for the functionality described <strong>in</strong> this book.<br />

This comm<strong>and</strong>-l<strong>in</strong>e w<strong>in</strong>dow supports a number of comm<strong>and</strong>s that help you manage packages. To<br />

get a list of the available ma<strong>in</strong> comm<strong>and</strong>s, type Get-Help NuGet <strong>and</strong> press Enter. You’ll see a list of<br />

comm<strong>and</strong>s appear that you can execute at the console. The console has IntelliSense as well to help<br />

you complete the comm<strong>and</strong>s by press<strong>in</strong>g the Tab key. In the example of the Help comm<strong>and</strong>, simply<br />

type Get followed by the Tab key to get a list with all comm<strong>and</strong>s that start with Get. You can<br />

then select the comm<strong>and</strong> from the list <strong>and</strong> complete it by press<strong>in</strong>g Tab aga<strong>in</strong> or by press<strong>in</strong>g Enter.<br />

Because many comm<strong>and</strong>s start with Get, <strong>in</strong> this case it’s probably quicker to type Get-H <strong>and</strong> then<br />

press Tab, or to type the complete comm<strong>and</strong> yourself. However, for longer <strong>and</strong> more unique comm<strong>and</strong><br />

names, us<strong>in</strong>g the Tab key can be a great time saver.<br />

Probably the most popular comm<strong>and</strong>s are Get-Package <strong>and</strong> Install-Package. Us<strong>in</strong>g Get-Package<br />

you can list the packages that are currently <strong>in</strong>stalled <strong>in</strong> your site. To see the list, just type the comm<strong>and</strong><br />

<strong>and</strong> hit Enter. If you try this now, your list will be empty because you haven’t <strong>in</strong>stalled any<br />

packages yet. By us<strong>in</strong>g Get-Package -ListAvailable you can see a complete list of all available<br />

packages. Because thous<strong>and</strong>s of them exist (<strong>and</strong> the list is grow<strong>in</strong>g), you want to filter the list us<strong>in</strong>g<br />

-Filter, like this:<br />

Get-Package -ListAvailable -Filter jQuery

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!