"GetReferenceNearestTargetFrameworkTask"找不到任务 [英] The "GetReferenceNearestTargetFrameworkTask" task was not found

查看:592
本文介绍了"GetReferenceNearestTargetFrameworkTask"找不到任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在VS 2017社区中遇到自动补全问题.

I have problem with autocompletion in VS 2017 Community.

以前,我从学校获得了VS 2017 Enterprise,但密钥已过期.所以我搬到了社区.

Previously I had VS 2017 Enterprise from school, but key expired. So I moved to community.

以前,一切都很好,但现在根本不起作用.

Before, everything works great, but now it doesnt work at all.

我在这里: 在此处输入链接描述

但不起作用,因此在这里找到了另一个解决方案: 在此处输入链接描述

but doesnt work, so found another solution here: enter link description here

我明白了:

构建失败.

Build FAILED.

C:\ Program Files(x86)\ Microsoft Visual Studio \ 2017 \ Community \ MSBuild \ 15.0 \ Bin \ Microsoft.Common.CurrentVersion.targets(1601,5):错误MSB4036: 找不到"GetReferenceNearestTargetFrameworkTask"任务.检查以下内容: 1.)项目文件中任务的名称与任务类的名称相同. 2.)任务类是公共"的,并且实现了Microsoft.Build.Framework.ITask接口. 3.)在项目文件中,或在* .tasks文件中正确声明了任务 "C:\ Program Files(x86)\ Microsoft Visual Studio \ 2017 \ Community \ MSBuild \ 15.0 \ Bin"目录. 0警告 1个错误

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1601,5): error MSB4036: The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with in the project file, or in the *.tasks files located in the "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin" directory. 0 Warning(s) 1 Error(s)

经过的时间00:00:00.11

Time Elapsed 00:00:00.11

你知道下一步该怎么做吗?

Do you know what to do next?

谢谢

推荐答案

按照以下说明修复该错误.这适用于VS 2017:

Follow these to fix that error. This applies to VS 2017:

修复1 :

1 .从 2 .重新启动Visual Studio.

2.Restart Visual Studio.

如果问题仍然存在,请继续下面的

If the problem is still there, continue below

修复2 :

1 .再次下载并启动/运行Visual Studio 安装程序.

1.Download and start/run the Visual Studio Installer again.

2 .在Visual Studio 安装程序仍在运行时,转到单个组件" 选项卡

2.While the Visual Studio Installer is still running, go to the "Individual Components" tab

3 .选中代码工具" 选项下的"NuGet程序包管理器"复选框.

3.Tick the "NuGet package manager" check-box that is under "Code tools" option.

4 .单击安装"进行安装.

4.Click Install to install it.

此文件所在的屏幕截图:

Screenshot of where this is located:

那应该可以解决您在此问题中看到的错误.重新启动Visual Studio并测试自动完成功能.如果不起作用,请参阅问题的答案,因为这是一个整体不同的问题.

That should fix the error you see in this question. Restart Visual Studio and test the auto-completion function. If it's not working, see the answers from this question as that is a whole different issue.

这篇关于"GetReferenceNearestTargetFrameworkTask"找不到任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆