问题
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?
回答1:
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.
回答2:
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
来源:https://stackoverflow.com/questions/54185914/net-core-project-dependencies-yellow-triangle