简体   繁体   English

混淆VS2022中的Nuget和Libman

[英]Confuse about Nuget and Libman in VS2022

I am new to .NET Core web development.我是 .NET Core web 开发的新手。

In VS2017, when I install jQuery using Nuget, a message will be shown suggesting to use Libman instead.在 VS2017 中,当我使用 Nuget 安装 jQuery 时,将显示一条消息,建议改用 Libman。

However, in VS2022 the warning message disappeared, and I can successfully install jQuery as a dependency package, not a library under \wwwroot\lib .但是,在 VS2022 中,警告消息消失了,我可以成功安装 jQuery 作为依赖项 package,而不是\wwwroot\lib下的库。

If I install jQuery using Libman in VS2022, jQuery will be installed under \wwwroot\lib as shown below:如果我在 VS2022 中使用 Libman 安装 jQuery,jQuery 将安装在\wwwroot\lib下,如下所示:

在此处输入图像描述

I would like to know:我想知道:

  1. Should I use Nuget for .net package(server-side) only?我应该仅将 Nuget 用于 .net 包(服务器端)吗?
  2. Should I use Libman for all client-side package only?我应该只对所有客户端 package 使用 Libman 吗?
  3. If no for above, what is the recommended usage and trend?如果以上没有,推荐的用法和趋势是什么?

Apologies for the late reply, assuming you're still pondering this...抱歉回复晚了,假设你还在考虑这个......

The thing is that it's preference and default beahvior, libman was created as a client-side package manager for your projects within the Visual Studio environment.问题是它的偏好和默认行为,libman 被创建为 Visual Studio 环境中项目的客户端 package 管理器。 It's intention is to handle client-side vs server side.其目的是处理客户端与服务器端。 You could technically use either one, OR, you could use another package manager such as bower, yarn, npm, etc.从技术上讲,您可以使用其中一个,或者,您可以使用另一个 package 管理器,例如 bower、yarn、npm 等。

The official documentation and use case examples for libman are listed on the github page located here: https://github.com/aspnet/LibraryManager#readme .. libman 的官方文档和用例示例列在github 页面上:https://github.com/aspnet/LibraryManager#readme ..

So, by default Visual Studio will point you in the scenario of libman, but you can use any package manager you wish.因此,默认情况下,Visual Studio 将指向您在 libman 的场景中,但您可以使用任何您希望的 package 管理器。

Hope this helped.希望这有帮助。 Definitely read the README for the project for additional scenarios.一定要阅读项目的 README 以了解其他场景。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM