NuGet软件包还原IS已启用,但我收到一条错误消息,指出未启用 [英] NuGet Package restore IS enabled but I get an error saying it's not enabled
问题描述
我在解决方案中启用了nuget软件包还原.但是,当我尝试构建项目时,出现此错误:
I have nuget package restore enabled in my solution. However, when I try to build the project, I get this error:
This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.
有什么办法解决这个问题吗?
Any ideas how to fix this problem?
我尝试删除NuGet.targets和NuGet.exe文件并重新启用块金包还原.它会重新创建文件,并且出现相同的错误.
I have tried deleting my NuGet.targets and NuGet.exe file and re-enabling nugget package restore. It recreates the files and I get the same error.
推荐答案
请按照以下提到的步骤操作:
Please follow below mentioned steps:
第1步: 请右键单击解决方案以启用Nuget软件包还原[如下面的屏幕截图中所述]
Step 1: Please enable Nuget Package Restore by right clicking on solution [as mentioned in below screenshot]
步骤2:[如果通过以下步骤1无法解决问题/错误,请遵循此步骤] 如果仍然遇到问题,请在记事本中打开.csproj文件,并检查可能看起来像
Step 2: [Follow this if the issue / error is not resolved by following step 1] Still if you face the issue, please open .csproj file in notepad and check for the package path which might look like
因此,您的解决方案目录结构将类似于: \ SolutionDirectory \
So your solutions directory structure will be like: \SolutionDirectory\
包装目录 \ SolutionDirectory \ packages
Package Directory \SolutionDirectory\packages
项目目录 \ SolutionDirectory \ ProjectName \ ProjectName.csproj
Project Directory \SolutionDirectory\ProjectName\ProjectName.csproj
请打开此.csproj [在记事本中出现错误的地方,搜索包路径并将其更新为相关路径.
Please open this .csproj [in which you're getting error in notepad and search for packages path and update it to its relevant path.
例如我的.csproj包含,如果.csproj文件包含.... \ packages,则使用.. \ packages
For e.g. my .csproj contained, if .csproj file contains ....\packages then update that path with ..\packages
这篇关于NuGet软件包还原IS已启用,但我收到一条错误消息,指出未启用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!