Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual studio 2013 yellow warning on all references in project

I have a C# project with target framework set to .NET 4.5. For some strange reason, all references are marked with the yellow warning triangle as shown below. I have tried unloading and reloading the project. I even tried manually re-adding one of the system references to no avail.

enter image description here

The warnings I get are:

Warning 13 The referenced component 'AutoMapper' could not be found. Services.Contracts Warning 14 The referenced component 'AutoMapper.Net4' could not be found. Services.Contracts Warning 15 The referenced component 'log4net' could not be found. Services.Contracts Warning 16 The referenced component 'Mindscape.LightSpeed' could not be found. Services.Contracts Warning 17 The referenced component 'Mindscape.LightSpeed.Linq' could not be found. Services.Contracts Warning 18 The referenced component 'System' could not be found. Services.Contracts Warning 19 The referenced component 'System.Core' could not be found. Services.Contracts Warning 25 The referenced component 'System.Data' could not be found. Services.Contracts Warning 24 The referenced component 'System.Data.DataSetExtensions' could not be found. Services.Contracts Warning 20 The referenced component 'System.Runtime.Serialization' could not be found. Services.Contracts Warning 21 The referenced component 'System.ServiceModel' could not be found. Services.Contracts Warning 22 The referenced component 'System.ServiceModel.Web' could not be found. Services.Contracts Warning 26 The referenced component 'System.Xml' could not be found. Services.Contracts Warning 23 The referenced component 'System.Xml.Linq' could not be found. Services.Contracts

What happened and how do I fix this?

like image 246
Klaus Nji Avatar asked Jun 14 '15 19:06

Klaus Nji


1 Answers

I had the same problem and I removed the following entry from the .csproj file and it fixed the problem for me.

<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">  
  <PropertyGroup>
    <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
  </PropertyGroup>
  <Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>
like image 78
Richard Houltz Avatar answered Oct 26 '22 09:10

Richard Houltz