Visual Studio 开源控件扩展 NuGet 常用命令及常用组件

转自:http://blog.feshine.net/technology/1199.html


Visual Studio 开源控件扩展 NuGet 常用命令,整理如下:

—————————————————————————————————-

获取列表

Get-Package -ListAvailable

添加组件

Install-Package 组件名

添加特定版本组件

Install-Package 组件名 -Version 版本号

移除组件

Uninstall-Package 组件名

强制移除组件

Uninstall-Package 组件名 ‑Force

升级组件

Update-Package 组件名

 

 

Visual Studio 开源控件扩展 NuGet 常用组件安装命令,整理如下:

—————————————————————————————————-

1、jQuery 安装命令

1.1-jQuery(最新版本)
Install-Package jQuery

1.2-jQuery Visual Studio 2010(智能感知)
Install-Package jQuery.vsdoc

1.3-jQuery Validation(验证)
Install-Package jQuery.Validation

1.4-jquery.datatables(数据表)
Install-Package jquery.datatables

1.5-jQuery UI(合并版本)
Install-Package jQuery.UI.Combined

1.6-jQuery UI i18n(语言包)
Install-Package jQuery.UI.i18n

2、mvc 安装命令

2.1-T4MVC
Install-Package T4MVC
2.2-MvcContrib
Install-Package MvcContrib

2.3-MvcContrib.Mvc3-ci
Install-Package MvcContrib.Mvc3-ci

2.4-MvcContrib.Mvc3.FluentHtml-ci
Install-Package MvcContrib.Mvc3.FluentHtml-ci

2.5-MvcContrib.Mvc3.TestHelper-ci
Install-Package MvcContrib.Mvc3.TestHelper-ci

2.6-MvcSiteMapProvider-MVC3
Install-Package MvcSiteMapProvider-MVC3

2.7-AddMvc3ToWebForms
Install-Package AddMvc3ToWebForms

3、EntityFramework 安装命令

3.1-EntityFramework – 4.1.10331.0
Install-Package EntityFramework

3.2-EFCodeFirst
Install-Package EFCodeFirst

3.3-EFCodeFirst.Sample
Install-Package EFCodeFirst.Sample

3.4-DynamicData.EFCodeFirstProvider
Install-Package DynamicData.EFCodeFirstProvider

4、表格分页 安装命令

4.1-Table Pager
Install-Package TablePager

4.2-PagedList
Install-Package PagedList

4.3-PagedList.Mvc
Install-Package PagedList.Mvc

4.4-MvcPager

(暂时缺,但是建议国内同学使用,http://mvcpager.codeplex.com/)

5、压缩优化 nuGet 安装命令

5.1-YUICompressor .NET – 1.5.0.0
Install-Package YUICompressor.NET

5.2-AjaxMin
Install-Package AjaxMin

5.3-Optimization.Framework
Install-Package Optimization.Framework

5.4-UrlShortener.Helper
Install-Package UrlShortener.Helper

5.5-SharpZipLib
Install-Package SharpZipLib

5.6-SquishIt
Install-Package SquishIt

5.7-SquishIt.Contrib.Mvc
Install-Package SquishIt.Contrib.Mvc

6、ActiveMQ 安装命令

6.1-Apache.NMS – 1.4.0
Install-Package Apache.NMS

6.2-Apache.NMS.ActiveMQ – 1.4.1
Install-Package Apache.NMS.ActiveMQ

—————————————————————————————————-

 

Get‑Package

Gets the set of packages that are available from the package source. By default, this command returns installed packages.

ARGUMENT DESCRIPTION
‑SourcesourceUrlOrPath (Optional) Specifies the package source (feed). Typically this is the URL of an OData service or the path of a folder that contains a set of packages.
‑Updates (Optional) Lists packages that have an update available from the package source.
‑Remote (Optional) Lists packages that are available from the feed specified in the Package source list of the Package Manager Console window.
‑FilterfilterSpecification (Optional) Specifies a filter that is used to narrow down the list of packages returned. Filtering applies to the package ID and description.

Sample Usage

The following example shows how to list all packages in the feed that is specified in the Package Source list.

PM> Get‑Package -Remote

Install‑Package

Installs a package and its dependencies into the project or the solution. For project packages, this installs the package and applies it to a specific project. Files are copied to the project, assembly references added, theapp.config or web.config file is updated, etc.

ARGUMENT DESCRIPTION
‑Id packageName (Required) Specifies the package to install. Including the ‑Id flag is optional, because the value for this flag is always the first parameter for this command.
‑IgnoreDependencies (Optional) Specifies that only this package (not its dependencies) is installed.
‑ProjectprojectName (Optional) The project to install the package into. This option applies only to project packages. If a project is specified in the Default project list of the Package Manager Console window, this option is not required. If no default project is selected, this option is required.
‑Source sourceURL (Optional) Specifies the URL of the package to install. The default is to look in the feed to find the corresponding package URL.
‑VersionversionNumber (Optional) Specifies the version of the package to install. The default is the latest version.

Sample Usage

The following example shows how to install the package that has the ID elmah.

PM> Install‑Package elmah

The following example shows how to install a package named my.pack that is in a local directory.

PM> Install‑Package my.pack ‑Source c:\my‑packages

Uninstall‑Package

Uninstalls a package. If other packages depend on this package, the command will fail unless the ‑Forceoption is specified.

ARGUMENT DESCRIPTION
‑Id packageName (Required) Specifies the package to uninstall. Including the -Id flag is optional, because the value for this flag is always the first parameter for this command.
‑RemoveDependencies (Optional) Specifies that unused dependencies of the package are also uninstalled.
‑Force (Optional) Forces the package to uninstall even if another package depends on it.
‑VersionversionNumber (Optional) Specifies the version of the package to uninstall. The default is the latest version.
‑ProjectprojectName (Optional) Specifies the project to uninstall the package from. This applies only to project packages. If a project is specified in the Default project list of the Package Manager Console window, this option is not required.

Sample Usage

The following example shows how to remove the elmah package. The two commands are equivalent; the second command explicitly includes the Id argument.

PM> Uninstall-Package elmah
PM> Uninstall-Package ‑Id elmah

The following example shows how to remove the GuEditor package and any dependencies only if no other packages are using those dependencies or are dependent on the package being removed. If GuEditordepends on Log4Net and elmah, but another installed package depends on Log4Net, this command will fail because it cannot remove Log4Net. (It is planned that in a future release the user will be prompted to resolve this conflict.)

PM> Uninstall-Package GuEditor -RemoveDependencies

The following example shows how to remove GuEditor the package even if other installed packages are dependent on it. (If you add ‑RemoveDependencies, any dependencies of GuEditor are also removed, even if other packages are dependent on them.)

PM> Uninstall-Package GuEditor -Force

Update-Package

Updates a package and its dependencies. If the new version of the package has new dependencies, the dependency packages are also installed. If the updated version no longer depends on a package and if no other packages depend on it, the dependency package is uninstalled.

ARGUMENT DESCRIPTION
‑Id packageName (Required) Specifies the package to update. Including the ‑Id flag is optional, because the value for this flag is always the first parameter for this command.
‑UpdateDependencies (Optional) Updates all of the package’s dependencies to the latest version of each dependency.
‑ProjectprojectName (Optional) Specifies the project to install the package into. This option applies only to project packages. If a project is specified in the Default project list of thePackage Manager Console window, this option is not required. If no default project is selected, this option is required.
‑Source sourceURL (Optional) Specifies the URL of the package to install. The default is to look in the feed for the corresponding package URL.
‑VersionversionNumber (Optional) Specifies the version that the package will be upgraded to. The default is the latest version.

Sample Usage

The following example shows how to update the elmah package to the latest version.

PM> Update-Package elmah

The following example shows how to update the elmah package from a specific package source.

PM> Update-Package elmah ‑Source http://packages.example.com/packages/elmah.nupack

The following example shows how to update the elmah package to a specific version.

PM> Update-Package elmah ‑Version 1.0.1

Get-Project

Returns a reference to the DTE (Development Tools Environment) for the active or specified project.

ARGUMENT DESCRIPTION
‑Name (Optional) Specifies the project to return. The default is the active project.
‑All (Optional) Returns every project in the solution.

Sample Usage

The following example shows how to get a reference to a project named MyClassLib1.

PM> Get‑Project MyClassLib1

Add‑BindingRedirect

Examines all assemblies in the output path for a project and adds binding redirects to the application configuration (app.config) file or to the web configuration (web.config) file where required.

ARGUMENT DESCRIPTION
‑Project (Optional) Specifies the project to analyze and add binding redirects to.
‑All (Optional) Specifies every project in the solution.

Sample Usage

The following example shows how to add binding redirects to a project named MyMvcApplication1.

PM> Add‑BindingRedirects MyMvcApplication1

Open-PackagePage

Opens a browser displaying the project website specified in the packageUrl field of the package’s manifest.

ARGUMENT DESCRIPTION
‑Whatif (Optional) Prints out just the URL for the project page, without actually opening it.

Sample Usage

The following opens a package page for a given package

PM> Open-PackagePage Elmah


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值