microsoft / ApplicationInsights-aspnetcore

ASP.NET Core web applications monitoring
313 stars 123 forks source link

Conflicts Between Versions Using Asp.Net Core 3.0 #987

Closed andrejohansson closed 5 years ago

andrejohansson commented 5 years ago

Repro Steps

I am trying to follow the aspnetcore 3.0 migration guide, and I'm down to two warnings when building and I'm fairly sure these are caused by this package. Issue #932 states that version 2.8.0 should fully support aspnet core 3.0 but it seems some reference is of/not updated. Or I have some other configuration wrong in my project file.

Actual Behavior

The conflicts I get is are:

Severity    Code    Description Project File    Line    Suppression State
Warning MSB3277 Found conflicts between different versions of "System.Diagnostics.PerformanceCounter" that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed. Rduce.Pixon.Api C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets   2106    
Warning MSB3277 Found conflicts between different versions of "System.IO.FileSystem.AccessControl" that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed.    Rduce.Pixon.Api C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets   2106    

And the detailed diagnostic logs for each of them are:

There was a conflict between "System.IO.FileSystem.AccessControl, Version=4.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "System.IO.FileSystem.AccessControl, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
2>        "System.IO.FileSystem.AccessControl, Version=4.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was chosen because it was primary and "System.IO.FileSystem.AccessControl, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was not.
2>        References which depend on "System.IO.FileSystem.AccessControl, Version=4.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [C:\Users\AndréJohansson\.nuget\packages\system.io.filesystem.accesscontrol\4.5.0\ref\netstandard2.0\System.IO.FileSystem.AccessControl.dll].
2>            C:\Users\AndréJohansson\.nuget\packages\system.io.filesystem.accesscontrol\4.5.0\ref\netstandard2.0\System.IO.FileSystem.AccessControl.dll
2>              Project file item includes which caused reference "C:\Users\AndréJohansson\.nuget\packages\system.io.filesystem.accesscontrol\4.5.0\ref\netstandard2.0\System.IO.FileSystem.AccessControl.dll".
2>                C:\Users\AndréJohansson\.nuget\packages\system.io.filesystem.accesscontrol\4.5.0\ref\netstandard2.0\System.IO.FileSystem.AccessControl.dll
2>        References which depend on "System.IO.FileSystem.AccessControl, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [].
2>            C:\Users\AndréJohansson\.nuget\packages\microsoft.applicationinsights.windowsserver.telemetrychannel\2.11.0\lib\netstandard2.0\Microsoft.AI.ServerTelemetryChannel.dll
2>              Project file item includes which caused reference "C:\Users\AndréJohansson\.nuget\packages\microsoft.applicationinsights.windowsserver.telemetrychannel\2.11.0\lib\netstandard2.0\Microsoft.AI.ServerTelemetryChannel.dll".
2>                C:\Users\AndréJohansson\.nuget\packages\microsoft.applicationinsights.windowsserver.telemetrychannel\2.11.0\lib\netstandard2.0\Microsoft.AI.ServerTelemetryChannel.dll
2>                C:\Users\AndréJohansson\.nuget\packages\microsoft.applicationinsights.aspnetcore\2.8.0\lib\netstandard2.0\Microsoft.ApplicationInsights.AspNetCore.dll
2>                C:\Users\AndréJohansson\.nuget\packages\microsoft.applicationinsights.snapshotcollector\1.3.5\lib\netcoreapp2.0\Microsoft.ApplicationInsights.SnapshotCollector.dll
2>            C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\3.0.0\ref\netcoreapp3.0\mscorlib.dll
2>              Project file item includes which caused reference "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\3.0.0\ref\netcoreapp3.0\mscorlib.dll".
2>                C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\3.0.0\ref\netcoreapp3.0\mscorlib.dll
2>    There was a conflict between "System.Diagnostics.PerformanceCounter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" and "System.Diagnostics.PerformanceCounter, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51".
2>        "System.Diagnostics.PerformanceCounter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" was chosen because it was primary and "System.Diagnostics.PerformanceCounter, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" was not.
2>        References which depend on "System.Diagnostics.PerformanceCounter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" [C:\Users\AndréJohansson\.nuget\packages\system.diagnostics.performancecounter\4.5.0\ref\netstandard2.0\System.Diagnostics.PerformanceCounter.dll].
2>            C:\Users\AndréJohansson\.nuget\packages\system.diagnostics.performancecounter\4.5.0\ref\netstandard2.0\System.Diagnostics.PerformanceCounter.dll
2>              Project file item includes which caused reference "C:\Users\AndréJohansson\.nuget\packages\system.diagnostics.performancecounter\4.5.0\ref\netstandard2.0\System.Diagnostics.PerformanceCounter.dll".
2>                C:\Users\AndréJohansson\.nuget\packages\system.diagnostics.performancecounter\4.5.0\ref\netstandard2.0\System.Diagnostics.PerformanceCounter.dll
2>        References which depend on "System.Diagnostics.PerformanceCounter, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" [].
2>            C:\Users\AndréJohansson\.nuget\packages\microsoft.applicationinsights.perfcountercollector\2.11.0\lib\netstandard2.0\Microsoft.AI.PerfCounterCollector.dll
2>              Project file item includes which caused reference "C:\Users\AndréJohansson\.nuget\packages\microsoft.applicationinsights.perfcountercollector\2.11.0\lib\netstandard2.0\Microsoft.AI.PerfCounterCollector.dll".
2>                C:\Users\AndréJohansson\.nuget\packages\microsoft.applicationinsights.perfcountercollector\2.11.0\lib\netstandard2.0\Microsoft.AI.PerfCounterCollector.dll
2>                C:\Users\AndréJohansson\.nuget\packages\microsoft.applicationinsights.aspnetcore\2.8.0\lib\netstandard2.0\Microsoft.ApplicationInsights.AspNetCore.dll
2>                C:\Users\AndréJohansson\.nuget\packages\microsoft.applicationinsights.snapshotcollector\1.3.5\lib\netcoreapp2.0\Microsoft.ApplicationInsights.SnapshotCollector.dll
2>            C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\3.0.0\ref\netcoreapp3.0\System.Core.dll
2>              Project file item includes which caused reference "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\3.0.0\ref\netcoreapp3.0\System.Core.dll".
2>                C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\3.0.0\ref\netcoreapp3.0\System.Core.dll
2>            C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\3.0.0\ref\netcoreapp3.0\System.dll
2>              Project file item includes which caused reference "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\3.0.0\ref\netcoreapp3.0\System.dll".
2>                C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\3.0.0\ref\netcoreapp3.0\System.dll

Expected Behavior

No warnings when I build.

Version Info

SDK Version (version of https://www.nuget.org/packages/Microsoft.ApplicationInsights.AspNetCore) : 2.8.0 .NET Core Version (TargetFramework in your .csproj file) : netcoreapp3.0
How Application was onboarded with SDK(Installed Nugets/VisualStudio/Azure WebAppExtension) : Installed Nugets OS : Windows 10 Hosting Info (IIS/Azure Web Apps/Running From Visual Studio etc) : Azure Web App (Linux Docker)

cijothomas commented 5 years ago

I tried an app with System.Diagnostic.performance counter, and added applicationinsights. I dont see this warning generated.

Can you share a repro app for us to investigate more?

andrejohansson commented 5 years ago

@cijothomas when I started to create the repro app I noticed I had:

<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>

in my csproj...removing this helped and the warning disappeared.