Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find reference System

So I use Visual Studio 2017 and everything worked ok. But then I updated to 15.6.0 and suddenly nothing is working anymore.

All the references like Systme.* or Microsoft.* are with a yellow warning sign...

At every project - even new ones- I keep getting the same type of erros after (re)building:

The "ResolveAssemblyReference" task could not be initialized with its input parameters

The "ResolveAssemblyReference" task could not be initialized with its input parameters      

The "FindDependenciesOfExternallyResolvedReferences" parameter is not supported by the "ResolveAssemblyReference" task. Verify the parameter exists on the task, and it is a settable public instance property          

This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them

I have tried reinstalling Visual Studio 2017, reinstalling .NET Framework, but I still get these type of errors on every C# project...

Is there any solution, next to completely reinstalling Windows?

like image 896
Mason Avatar asked Mar 07 '18 15:03

Mason


People also ask

How do I fix missing references in Visual Studio?

To fix a broken project reference by correcting the reference path. In Solution Explorer, right-click your project node, and then select Properties. The Project Designer appears. If you're using Visual Basic, select the References page, and then click the Reference Paths button.

How do I add a reference in Visual Studio 2013?

To add a reference, right click on the References or Dependencies node in Solution Explorer and choose Add Reference. You can also right-click on the project node and select Add > Reference.


1 Answers

Community edit (Nick's comment below - an important warning):

It is dangerous and totally unsupported to overwrite parts of MSBuild 15.6 with parts of MSBuild 15.5. All sorts of other things could break.


Finally fixed it!

This file got corrupted somehow through the update to 15.6.0:

C:\Program Files (x86)\Microsoft Visual Studio\2017\EnterpriseWMSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets

or

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets

Replace that file with the previous version, and that fixed all the errors!

Get the previous version from a co-worker who hasn't updated their Visual Studio yet.

like image 165
Mason Avatar answered Oct 22 '22 04:10

Mason