为什么我无法从.NET项目中删除nuget包?

时间:2022-09-03 23:22:59

I received the following task

我收到了以下任务

  1. Remove the nuget packages from MyProject (check other webapps):
  2. 从MyProject中删除nuget包(检查其他webapps):

AspNetSprites-Core

AspNetSprites核心

AspNetSprites-WebFormsControl

AspNetSprites-WebFormsControl

Since I am not too fluent in .NET-specific technicalities, I have been searching for a while to find these. I have been using Visual Studio 2015 to search for these and found them under packages in the project's file tree. After removing them and removing the following line from web.config:

由于我不太熟悉.NET特定的技术,我一直在寻找这些。我一直在使用Visual Studio 2015来搜索这些内容,并在项目文件树中的包下找到它们。删除它们并从web.config中删除以下行:

    <add assembly="Microsoft.Web.Samples.ImageSprite" namespace="Microsoft.Web.Samples" tagPrefix="asp" />

I expected to successfully remove these from the project, but after I built the project the files reappeared under packages. What could be the cause of this behavior?

我希望从项目中成功删除它们,但在我构建项目后,文件重新出现在包下。可能是这种行为的原因是什么?

1 个解决方案

#1


1  

Since they are NuGet packages you should just be able to go to tools->NuGet Package Manager -> Manage NuGet packages for solution.

由于它们是NuGet包,您应该能够使用工具 - > NuGet包管理器 - >管理NuGet包以获得解决方案。

This will list all the installed packages for the project and you can uninstall them from here.

这将列出项目的所有已安装软件包,您可以从此处卸载它们。

EDIT: Alternative solution from OP That seems like a solution, but I already found out another one. I needed to remove the corresponding lines from packages.config

编辑:OP的替代解决方案这似乎是一个解决方案,但我已经找到了另一个解决方案。我需要从packages.config中删除相应的行

#1


1  

Since they are NuGet packages you should just be able to go to tools->NuGet Package Manager -> Manage NuGet packages for solution.

由于它们是NuGet包,您应该能够使用工具 - > NuGet包管理器 - >管理NuGet包以获得解决方案。

This will list all the installed packages for the project and you can uninstall them from here.

这将列出项目的所有已安装软件包,您可以从此处卸载它们。

EDIT: Alternative solution from OP That seems like a solution, but I already found out another one. I needed to remove the corresponding lines from packages.config

编辑:OP的替代解决方案这似乎是一个解决方案,但我已经找到了另一个解决方案。我需要从packages.config中删除相应的行