Zeus82
Zeus82

Reputation: 6385

.net core project dependencies - yellow triangle

My .Net Core project has a yellow triangle on dependencies, but when I open it up, none of the child entries have a yellow triangle. When I hover over dependencies, I don't see any tooltip telling me what's wrong. How can I check to see what is causing this yellow triangle to show up?

I did what @oandreeeee suggested and increased the log level of my build and I noticed this:

C:\Program Files\dotnet\sdk\2.2.104\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(41,5): message NETSDK1041: Encountered conflict between
'Reference:C:\Users\dev\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.ComponentModel.Composition.dll' and 
'Reference:C:\Users\dev\.nuget\packages\system.componentmodel.composition\4.5.0\ref\netstandard2.0\System.ComponentModel.Composition.dll'.  NETSDK1034: Choosing 
'Reference:C:\Users\dev\.nuget\packages\system.componentmodel.composition\4.5.0\ref\netstandard2.0\System.ComponentModel.Composition.dll' because file version '4.6.26515.6' is greater than '4.6.26419.2'.

This is my .csproj file:

<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
    <WarningsAsErrors />
</PropertyGroup>

<ItemGroup>
    <PackageReference Include="Microsoft.Windows.Compatibility" Version="2.0.1" />
    <PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
    <PackageReference Include="System.Threading.Tasks.Dataflow" Version="4.9.0" />
</ItemGroup>

</Project>

Where is that reference to System.ComponentModel.Composition.dll coming from?

enter image description here

Upvotes: 2

Views: 6157

Answers (3)

Yalın Meri&#231;
Yalın Meri&#231;

Reputation: 1

That may happen when your solution has a recursive reference to a top-level project which has a different version. You need to make sure that all references down to the bottom most level have same versions. Let me give an example based on my experience today:

I have a solution which uses NuGet packages created using their independent solutions. Sometimes to be able to debug, I remove the NuGet package references from the top-level project and add project references to the NuGet package projects instead. In my case two project references were showing the yellow warning icon. When I checked I found out that one of other projects was referencing to older releases of these NuGets. Removed the NuGet references and added project references to the projects of these two NuGets to resolve the issue. The bottom line is when you build the solution, VS needs the versions of all referenced projects/dlls/NuGets be same for all projects, including recursive references.

Upvotes: 0

andre
andre

Reputation: 113

You can do two simple things to help you.

The simple one is to check you Error List window in Visual Studio (don't forget to enable the visibility of the Warning messages).

Link for official documentation

In a more complex way, as Richard Fuller said, you can check the Build output window. To do this, you can also change the Log Level of the build in order to get more details.

Check more information about log level HERE

Upvotes: 0

Richard Fuller
Richard Fuller

Reputation: 474

I sometimes get a yellow triangle for no reason. Expand the NuGet/Projects/SDK elements and try find if there's an element with another triangle and an error message. You can also check the build output for warnings. In either case, there might be none and it's a display glitch.

Upvotes: 2

Related Questions