2

I am facing with the below mentioned error when I open unity c# script in visual studio code and not visual studio.

I have found a similar problem in stackoverflow but that was for Visual Studio and the solution for it required visual studio. But I am facing this problem in visual studio code.

Please help, I don't want to use visual studio as it is very heavy.

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1656,5): Error: 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.

Thank you.

Programmer
  • 121,791
  • 22
  • 236
  • 328
Shepherd_of_fire
  • 101
  • 3
  • 10
  • so you are just opening a .cs file? – lockstock May 23 '18 at 08:41
  • yes, made a c# script file using unity and opened it using visual code – Shepherd_of_fire May 23 '18 at 09:15
  • You have to download "NuGet Package Manager" from the first part of my answer which doesn't require installing Visual Studio. If that doesn't work then you have no option but to install Visual Studio, follow that tutorial delete the Visual Studio folders you don't need anymore – Programmer May 24 '18 at 00:20
  • Yes, I did install the Nuget Package manager through Visual codes's package manager.But it did nothing. The thing is that, it used to work very well before. It used to load the project files without any errors. This happened suddenly, one morning. Any ways I guess I have to use visual studio. Thank you for your time. – Shepherd_of_fire May 24 '18 at 06:09

0 Answers0