VS中程序包管理器控制台的使用

数字孪生驱动的城市地下管网智能运维与应急处置决策支持系统 上海市城市数字化中心的数据实践显示,通过关联分析管网材质与故障率的关系,将铸铁管更换周期从15年优化至8年(李敏,2021)。环境效益方面,上海市通过优化管网运行参数,年减少碳排放1.8万吨,相当于种植36万棵乔木。数字孪生与物理设备的双向交互采用OPC UA协议实现,某次天津管网渗漏事件中,系统通过实时数据反馈,指导现场人员调整注浆方案,将修复时间从48小时压缩至16小时。虚拟指挥沙盘支持多视角协同,深圳水务系统的实践表明,通过AR可视化技术,跨部门会议效率提升60%,方案决策时间缩短40%。 阅读详情

Managing Packages Using the Package Manager Console

This topic describes how to find, install, remove, and update NuGet packages using PowerShell commands. You can also work with packages using the Manage NuGet Packages dialog box. For more information, see Manage NuGet Packages Using the Package Manager dialog.

Using PowerShell commands is required if you want to install a package without having a solution open. It's also required in some cases for packages that create commands that you can access only by using PowerShell.

Finding a Package

From the Tools menu, select Library Package Manager and then click Package Manager Console.

Package Manager Console in menu

The Package Manager Console window is displayed.

Package Manager Console

The two drop-down lists set default values that let you omit parameters from the commands you enter in the window:

  • In the Package source list, select the default source (NuGet package feed) that you want your commands to use. Typically you will leave this as its default value of NuGet official package source. For more information about alternative feeds, see Hosting Your Own NuGet Feeds.
  • In the Default project list, select the default project that you want your commands to work with. (The default value will be the first project in the solution, not necessarily the one you have selected in Solution Explorer when you open the window.)

When you enter commands, you can override these defaults. In the Package Manager Console window, enter Get-Package -ListAvailable at the prompt to see a list of all packages that are available in the selected package source. Starting NuGet 3.0 Beta or higher, Get-Package also takes a -PageSize switch, which enables paging support for listing available packages from a package source.

Get-Package -ListAvailable command

For the default package source, that command is going to list thousands of packages. It makes better sense to specify a filter.

For example, to find the logging package ELMAH, enter Get-Package -ListAvailable -Filter elmah (the name of the package) or Get-Package -Filter Logging -ListAvailable (a keyword in the package description). Starting NuGet client 3.0 Beta or higher, these Get-Package commands can be replaced by Find-Package elmah orFind-Package Logging.

Get-Package command with filter

For more options that you can specify with the Get-Package and Find-Packagecommand, enter Get-Help Get-Package and Get-Help Find-Package, or seePackage Manager Console Powershell Reference.

Installing a Package

After you have found a package that you want to install, use the Install-Packagecommand with the name of the package. For example, enter the command Install-Package elmah as shown in the following example:

Install-Package command

Refer here for a complete list of PowerShell Reference on Install

NuGet retrieves the package from the specified package source and installs it in the project that is selected in the Default project drop-down list (unless you specify a different project in the command). Files are copied to the solution, references might be added to the project, the project app.config or web.config file might be updated, etc.

If the package you are installing is dependent on other packages, NuGet installs them also if they are not already installed.

If the package requires license acceptance, you will not be prompted in a dialog box. Instead, a message states that your use of the library constitutes license acceptance.

License acceptance text in Package Manager Console

In Solution Explorer, you can see references that Visual Studio has added for the installed library or libraries.

Elmah reference in Solution Explorer

If your app.config or web.config file required changes, those have been applied. The following example shows some of the changes for ELMAH.

Web.config changes for elmah

A new folder named packages is created in your solution folder. (If your project does not have a solution folder, the packages folder is created in the project folder.)

packages folder

The packages folder contains a subfolder for each installed package. This subfolder contains the files installed by the package. It also contains the package file itself (the .nupkg file, which is a .zip file that contains all of the files included in the package).

elmah folder in packages folder

You can now use the library in your project. IntelliSense works when you enter code, and library features such as the ELMAH logging information page work when you run the project.

elmah IntelliSense

elmah Error Log page

Extending The Package Manager Console With Packages

Some packages install new commands that you can use in the Package Manager Consolewindow. One example of such a package is MvcScaffolding, which creates commands you can use to generate ASP.NET MVC controllers and views. The following illustration shows that installing MvcScaffolding creates a new command Scaffold, complete with tab expansion.

Installing and using MvcScaffold

Removing a Package

From the Tools menu, select Library Package Manager and then click Package Manager Console. If you do not already know the name of the package you want to remove, enterGet-Package at the prompt without any flags to see a list of all of the packages that are currently installed.

Package Manager Console showing installed packages

To remove a package, use the Uninstall-Package command with the name of the package. For example, use the Uninstall-Package elmah command as shown in the following example:

uninstall package command

For more options that you can specify with the uninstall-package command, enterget-help uninstall-package or see Package Manager Console Powershell Reference.

The following package elements are removed:

  • References in the project. In Solution Explorer, you no longer see the library in theReferences folder or the bin folder. (You might have to build the project to see it removed from the bin folder.)
  • Files in the solution folder. The folder for the package you removed is deleted from the packages folder. If it is the only package you had installed, the packages folder is also deleted.)
  • Any changes that were made to your app.config or web.config file are undone.

If other packages were installed because they were dependencies of the package that you removed, and if no other packages remain that are dependent on the dependency packages, the dependency packages are also removed.

Refer here for a complete list of PowerShell Reference on Uninstall

Updating a Package

From the Tools menu, select Library Package Manager and then click Package Manager Console. To check if there are newer versions available for any installed packages, enterGet-Package -updates at the prompt.

Get-Package command

To update a package, enter Update-Package with the package ID. For example, enter the command Update-Package jQuery. For more options that you can use with theUpdate-Package command, enter get-help Update-Package or see here.

update-package command

Refer here for a complete list of PowerShell Reference on Update

Setting up a NuGet Powershell Profile

For customizing your PowerShell console, click here



转载自:https://docs.nuget.org/consume/Package-Manager-Console

【图论】系列(七)图论的中心性度量方法及重要性评价指标 图论中的中心性度量方法是用来衡量图中各个节点(或顶点)相对重要性的指标。 阅读详情

相关推荐

从零到一:使用阿里云百炼搭建企业级 AI Agent 完全实战手册(2026超详细版)

本文是一份企业级AI Agent构建手册,主要面向企业技术负责人、AI产品经理和后端开发工程师。手册详细介绍了如何在阿里云百炼平台上搭建企业智能体应用的全流程,包括环境准备、知识库构建、智能体创建、工具集成、工作流编排等核心环节。重点内容包括: 准备工作:阿里云账号注册、百炼服务开通、免费额度领取、API Key管理 知识库构建:文档格式要求、内容优化原则、RAG系统搭建 智能体开发:Agent创建、工具集成、复杂业务工作流设计 生产部署:多渠道接入、监控运维、安全治理 成本控制:Token预算管理、选型决

u010323587的专栏 1093

vs2022 程序包管理器控制台中文乱码

解决程序包管理器控制台中文乱码,数据库迁移命令

qq_22325259的博客 1873

Upwork入门指南:如何创建吸引人的个人资料

本文详细介绍了如何在Upwork上创建并优化个人资料,帮助自由职业者吸引更多客户。内容包括: 注册与验证:从注册账号到邮箱验证的完整步骤。 个人资料填写:如何撰写吸引人的标题、简介,选择技能标签,以及设置专业头像和费率。 作品集与优化:上传高质量作品集,提升搜索排名和客户信任度。 常见问题解答:解决新手常见问题,如无工作经验或审核不通过。 通过本文的指导,你将学会打造一个专业且高效的个人资料,为在Upwork上获得更多机会奠定基础。

qq_61813593的博客 3519

VS2013中Nuget程序包管理器控制台使用入门(一)-准备环境(原创)

准备环境: 1.打开VS2013IDE集成开发环境。 2.新建一个Asp.net Mvc的项目,比如命名为:MvcApplication1 3.打开 菜单"工具"->"库程序包管理器"->"程序包管理器控制台",然后在VS工作区域的右下方会出现一个”程序包管理器控制台“命令操作台。 4.在命令行状态下,出现命令提示符:PM>,在这里,你就可以输入Cml...

weixin_30455067的博客 594

WhatsApp网页版扫码分析

扫码登录本质上是WhatsApp的多设备登录,设备之间可以独立运行,那么当我们首次通过WhatsApp扫码登录二维码时,到底发生了那些事情?交换了那些数据?

SocialMarketing的博客 5230

基于TL431与MOSFET的高效过压保护电路设计详解

本文详细解析了基于TL431与MOSFET的高效过压保护电路设计。通过TL431精准监测电压,驱动MOSFET作为主开关,实现快速可靠的电源保护。文章涵盖电路原理、参数计算、性能优化及实战调试要点,为电子设备提供了一套经典且成本低廉的过压保护解决方案。

weixin_29215391的博客 775

VS程序包管理器控制台指令

PM> Update-Package  -ProjectName 'CMS.Update(这里是项目名)'   -Reinstall Newtonsoft.Json(这里包名)

我是孤单的飞鸟 4134

【WRF-Chem教程-附录B】使用 MOZART 与WRF-Chem

使用MOZART与WRF-Chem

WW、forever的博客 242

Package Manager Console的使用

Find-Package PM> Find-Package autofac https://docs.microsoft.com/en-us/nuget/tools/ps-ref-find-package Id Versions Description -- -------- ...

weixin_30375247的博客 1608

PyTorch深度学习实战(24)——使用U-Net架构进行图像分割

图像分割 (Image segmentation) 是计算机视觉领域中的一个重要任务,旨在将图像划分为具有语义信息的不同区域或对象。与目标检测任务不同,图像分割要求像素级别的精确定位和分类,将每个像素标记为属于哪个类别或属于哪个区域。在本节中,我们将介绍图像分割的基本概念,并训练一个基于 U-Net 架构的图像分割模型。

盼小辉丶的博客 1万+

物理AI:连接数字智能与物理世界的下一代人工智能范式

物理AI正在推动人工智能从纯数字领域向物理世界扩展,实现比特到原子的智能跃迁。与传统AI相比,物理AI具有三大核心差异:1)在物理环境中运行;2)处理多模态传感器输入;3)产生可改变物理状态的输出。其技术栈包含感知层(多模态融合)、决策层(边缘计算)、执行层(运动控制)和连接层(5G/6G通信)。关键技术挑战包括:实时多传感器融合、物理约束下的决策规划、以及高精度执行控制。物理AI的发展面临实时性保障、安全验证等核心挑战,但其在机器人、自动驾驶等领域的应用潜力巨大,正成为智能技术落地的关键突破口。

fudaihb的博客 1712

C# NuGet包管理命令

NuGet Package Manager Console 内置于 Visual Studio 在 Windows 2012 和更高版本。(不包含在 Visual Studio 用于 Mac 或 Visual Studio Code。) 控制台,你可以使用NuGet PowerShell 命令若要查找,安装、 卸载和更新 NuGet 程序包。使用控制台是在包管理器 UI 不提...

weixin_30730053的博客 1411

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

VS2013中Nuget程序包管理器控制台使用入门(一)-准备环境

准备环境: 1.打开VS2013IDE集成开发环境。 2.新建一个Asp.net Mvc的项目,比如命名为:MvcApplication1 3.打开 菜单"工具"->"库程序包管理器"->"程序包管理器控制台",然后在VS工作区域的右下方会出现一个”程序包管理器控制台“命令操作台。   4.在命令行状态下,出现命令提示符:PM>,在这里,你就可以输入Cmlle

imxiangzi的专栏 4930

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

vs2017 打开包管理器 (程序包管理控制台)

工具=》NuGet 包管理器=》程序包管理器控制台 转载于:https://www.cnblogs.com/xuhongcai/p/6884947.html

diaopu0702的博客 2707

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

vs2017中 如何使用npm命令

如图,工具-nugut包管理器-程序包管理器控制台,就是了

weixin_42524279的博客 6697

VS2013中Nuget程序包管理器控制台使用入门(三)-项目实战(原创)

VS2013中Nuget程序包管理器控制台使用入门(三)-项目实战 1.给指定项目安装Newtonsoft.Json ,Version 4.5.11 PM> Install-Package Newtonsoft.Json -Version 4.5.11 -Project mvcapplication1 2.卸载Newtonsoft.Json PM> Insta...

weixin_30340775的博客 422

VS2013中Nuget程序包管理器控制台使用入门(二)-如何使用Nuget提供的帮助(原创)...

如何使用Nuget提供的帮助? 1.从get-help Nuget开始,键入“get-help NuGet”以查看所有可用的 NuGet 命令。 用法: PM> get-help Nuget 主题 about_NuGet简短说明 提供有关 NuGet 程序包管理器命令的信息。 详细说明 本主题介绍 NuGet 程序包管理器命令。NuGe...

weixin_30243533的博客 487

VS2012使用程序包管理器控制台主机安装依赖时出错解决方法

Install-Package : 元素 命名空间“http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd”中的“metadata”。的子元素 命名空间“http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd”中的“frameworkAssemblies”。应为可能元素的列表: 命名空间“http://打开扩展和更新,先卸载现有的NuGet,然后重新下载一个最新版本。

qq_68768688的博客 277

VS2022包显示黄色感叹号

vs->工具->NuGet包管理器->程序包管理控制台。

啸啸说的博客 450

NPOI安装

方法1. 用nuget命令安装npoi引用 步骤:工具-NuGet包管理器- 程序包管理器控制台 命令:install- package npoi -version 2.4.0 方法2:直接引入程序包 步骤:对着解决方案右键,选择“管理NuGet程序包”,点击“浏览”,搜索“npoi”,点击安装 额外补充:还原NuGet程序包 从NuGet中引入的程序包存放在项目解决方案目录下...

无心的爱的专栏 4924

asp.net MVC Code First模式在 vs 程序包管理器控制台执行的数据迁移更新语句

//更新本地数据库  update-database -Force -ConnectionString "Data Source=localhost;Initial Catalog= 数据库名 ;Integrated Security=True;Max Pool Size=512;Min Pool Size=5;Connection Lifetime=15;connect timeout = 1

sxf359的博客 1986

init.ps1 cannot be loaded because running scripts is disabled on this system问题的解决

vs2017 程序包管理器控制台出现红色错误提示: File F:\web code\CustomerManagementSystem\packages\EntityFramework.6.1.3\tools\init.ps1 cannot be loaded because running scripts is disabled on this system. File F:\web c

sxf359的博客 7323

VS2022添加.Net 4.5支持

VS2022升级后不再支持.Net 4.0/4.5项目框架,一共找到两张解决办法: 1:下载VS2019安装程序,单独安装.Net 4.5组件 2:视图>其他窗口>程序包管理器控制台 .Net 4.0:Install-Package Microsoft.NETFramework.ReferenceAssemblies.net40 -Version 1.0.2 .Net 4.5:Install-Package Microsoft.NETFramework.ReferenceAsse

cai58201827的专栏 2471

VS2022安装.NET Framework4.5

Visual Studio 2022 安装.NET Framework4.5及以下目标包_netframework45怎么安装csdn-优快云博客VS2022默认不提供低版本的.NET Framework4.5,因此在创建.NET Framework项目时,找不到.NET Framework4.5或其他低版本框架的选项。

wsxhfa的专栏 3880

最近在用VS2013去生成独立EXE文件的时候报错:"Fody is only supported on MSBuild 16 and above. Current version: 15."

最近在用VS2013去生成独立EXE文件的时候报错:"Fody is only supported on MSBuild 16 and above. Current version: 15." 报错原因:因为VS2013版本过旧,现在Fody到5.0+,Costura.Fody到4.0+,不支持低版本VS。据说是有意为之,希望大家都使用最新的VS。 解决方法:卸载掉项目中的Fody和Costu...

秋天的晴 4461

vs2012找不到system web optimization命名空间

今天新装了vs2012,安装完成后,创建了一个mvc4应用程序,创建生成出现了几个错误。通过错误我们的解决方案就是去找引用不到的路径,如何在vs2012中实现呢? 在工具栏中找工具--库程序包管理器---程序包管理器控制台 完成后下方会出现一个控制台框。在控制台中输入Install-Package Microsoft.AspNet.Web.Optimization 回车,即可将未引用的程...

weixin_30556161的博客 134
上一篇: Android : adb 使用
下一篇: VS中程序包管理器的使用
doris_d
博客等级 码龄12年 79粉丝 126原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值