Closed anttikes closed 3 years ago
There is a setting in VS 2019 to enable .NET 6 preview.. @TimothyMothra should know more.
Hi @anttikes, Sorry you're having issues. Here's some things you can try. Please let me know if you make any progress.
Feel free to use the master
branch which has v2.18. This will let you avoid the .NET 6 stuff for now.
We're currently working on v2.19 in the develop
branch and testing .NET 6 support (.NET 6 is releasing in November).
It's possible this is causing some conflicts in your environment.
You can install the developer SDK here: https://dotnet.microsoft.com/download/dotnet/6.0
And in Visual Studio, you'll need to enable "previews" from the screenshot @cijothomas shared.
Be aware; I've had to switch the preview setting off when working on other projects because it caused some compiler issues in non-net6 projects.
Regarding solutions,
If you're still having issues with the ApplicationInsights-dotnet/WEB/Src/Microsoft.ApplicationInsights.Web.sln
,
try ApplicationInsights-dotnet/BASE/Microsoft.ApplicationInsights.sln
.
This is a smaller solution with base-most SDK.
If this doesn't compile, nothing else will. So this is a good place to start.
Regarding nuget,
It's weird to me that you're getting errors with nuget restore.
You could try the dotnet restore
command and see if you get a smaller list of errors.
We might find something actionable this way.
Lastly, here's my output for dotnet --info
dotnet --info
.NET SDK (reflecting any global.json):
Version: 6.0.100-preview.7.21379.14
Commit: 22d70b47bc
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19043
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.100-preview.7.21379.14\
Host (useful for support):
Version: 6.0.0-preview.7.21377.19
Commit: 91ba01788d
.NET SDKs installed:
3.1.413 [C:\Program Files\dotnet\sdk]
5.0.303 [C:\Program Files\dotnet\sdk]
5.0.401 [C:\Program Files\dotnet\sdk]
6.0.100-preview.7.21379.14 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.19 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0-preview.7.21378.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.19 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0-preview.7.21377.19 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.19 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.0-preview.7.21378.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
Thanks @TimothyMothra and @cijothomas for your tips.
I ran the following commands in order to checkout the master branch:
git clean -fdx
git checkout master
git pull
After performing these commands, I can restore the solution from the command line by issuing dotnet restore Everything.sln
. I do not need to install .NET Core 6.0 SDK or anything.
However, attempting to open either "Microsoft.ApplicationInsights.Web.sln" or the "Microsoft.ApplicationInsights.sln" in Visual Studio 2019 I am greeted with the same phenomenon: the forever loop in the restore, and the ever-increasing number of errors in Error List.
With the "Microsoft.ApplicationInsights.sln", the top Error List candidates look similar as before:
If I manually go and remove the "Product.props" import from all the .csproj files then the error list starts to clear up:
After all "Product.props" have been removed, the forever-loop stops and the errors are cleared. Now, if I restore this line to one of the project files, I get the following in the Package Manager's output:
Error occurred while restoring NuGet packages: Invalid restore input. The original target frameworks value must match the aliases. Original target frameworks: net46;netcoreapp2.1;netcoreapp3.1, aliases: net46;netcoreapp2.1. Input files: BASE\Test\Microsoft.ApplicationInsights.Test\Standalone\Microsoft.ApplicationInsights.Isolated.Tests.csproj.
Failed to restore BASE\Test\ServerTelemetryChannel.Test\TelemetryChannel.Nuget.Tests\TelemetryChannel.Nuget.Tests.csproj (in 63 ms).
Failed to restore BASE\src\ServerTelemetryChannel\TelemetryChannel.csproj (in 63 ms).
Failed to restore BASE\Test\Microsoft.ApplicationInsights.Test\Standalone\Microsoft.ApplicationInsights.Isolated.Tests.csproj (in 330 ms).
Failed to restore BASE\Test\ServerTelemetryChannel.Test\TelemetryChannel.Tests\TelemetryChannel.Tests.csproj (in 330 ms).
Failed to restore BASE\Test\Microsoft.ApplicationInsights.Test\Microsoft.ApplicationInsights.Tests\Microsoft.ApplicationInsights.Tests.csproj (in 425 ms).
NuGet package restore failed. Please see Error List window for detailed warnings and errors.
Time Elapsed: 00:00:00.5488958
========== Finished ==========
If I restore more than one line back, then the forever-loop resumes again and the Error List starts to build up.
The conclusion is that there's something in the "Product.props" that now messes up Visual Studio 2019. When this error occurs, I can see the following error on top of Visual Studio IDE:
The stack trace is as follows:
System.ObjectDisposedException : Cannot access a disposed object.
Object name: 'Microsoft.ServiceHub.Framework.ServiceBrokerClient'.
at Microsoft.Verify.NotDisposed(IDisposableObservable disposedValue,String message)
at async Microsoft.ServiceHub.Framework.ServiceBrokerClient.GetProxyAsync[T](<Unknown Parameters>)
at System.Threading.Tasks.ValueTask`1.get_Result()
at async Microsoft.CodeAnalysis.Remote.BrokeredServiceConnection`1.RentServiceAsync[TService](<Unknown Parameters>)
at System.Threading.Tasks.ValueTask`1.get_Result()
at async Microsoft.CodeAnalysis.Remote.BrokeredServiceConnection`1.TryInvokeAsync[TService](<Unknown Parameters>)
After the Error List cleared and the forever-loop stopped I tried building the base solution. It failed with the following errors:
System.ObjectDisposedException : Cannot access a disposed object.
Object name: 'Microsoft.ServiceHub.Framework.ServiceBrokerClient'.
at Microsoft.Verify.NotDisposed(IDisposableObservable disposedValue,String message)
at async Microsoft.ServiceHub.Framework.ServiceBrokerClient.GetProxyAsync[T](<Unknown Parameters>)
at System.Threading.Tasks.ValueTask`1.get_Result()
at async Microsoft.CodeAnalysis.Remote.BrokeredServiceConnection`1.RentServiceAsync[TService](<Unknown Parameters>)
at System.Threading.Tasks.ValueTask`1.get_Result()
at async Microsoft.CodeAnalysis.Remote.BrokeredServiceConnection`1.TryInvokeAsync[TService](<Unknown Parameters>)
And the Error List output:
And the full build log:
Rebuild started...
Restored C:\Work\ApplicationInsights-dotnet\BASE\src\ServerTelemetryChannel\TelemetryChannel.csproj (in 66 ms).
Restored C:\Work\ApplicationInsights-dotnet\BASE\src\Microsoft.ApplicationInsights\Microsoft.ApplicationInsights.csproj (in 64 ms).
Restored C:\Work\ApplicationInsights-dotnet\BASE\Test\ServerTelemetryChannel.Test\TelemetryChannel.Nuget.Tests\TelemetryChannel.Nuget.Tests.csproj (in 67 ms).
Restored C:\Work\ApplicationInsights-dotnet\BASE\Test\Microsoft.ApplicationInsights.Test\ApplicationInsightsTypes\ApplicationInsightsTypes.csproj (in 127 ms).
Restored C:\Work\ApplicationInsights-dotnet\BASE\Test\ServerTelemetryChannel.Test\TelemetryChannel.Tests\TelemetryChannel.Tests.csproj (in 319 ms).
Restored C:\Work\ApplicationInsights-dotnet\BASE\Test\Microsoft.ApplicationInsights.Test\Standalone\Microsoft.ApplicationInsights.Isolated.Tests.csproj (in 321 ms).
1>------ Rebuild All started: Project: Microsoft.ApplicationInsights (Microsoft.ApplicationInsights\Microsoft.ApplicationInsights), Configuration: Debug Any CPU ------
2>------ Rebuild All started: Project: ApplicationInsightsTypes, Configuration: Debug Any CPU ------
Restored C:\Work\ApplicationInsights-dotnet\BASE\Test\Microsoft.ApplicationInsights.Test\Microsoft.ApplicationInsights.Tests\Microsoft.ApplicationInsights.Tests.csproj (in 410 ms).
2>ApplicationInsightsTypes -> C:\Work\bin\Debug\test\ApplicationInsightsTypes\net452\ApplicationInsightsTypes.dll
2>Directory.Build.props: Internal_Logging is set to false.
2>ApplicationInsightsTypes -> C:\Work\bin\Debug\test\ApplicationInsightsTypes\netstandard2.0\ApplicationInsightsTypes.dll
2>Directory.Build.props: Internal_Logging is set to false.
2>Directory.Build.props: Internal_Logging is set to false.
1>Microsoft.ApplicationInsights -> C:\Work\bin\Debug\test\Microsoft.ApplicationInsights\net46\Microsoft.ApplicationInsights.dll
1>Microsoft.ApplicationInsights -> C:\Work\bin\Debug\test\Microsoft.ApplicationInsights\net452\Microsoft.ApplicationInsights.dll
1>Microsoft.ApplicationInsights -> C:\Work\bin\Debug\test\Microsoft.ApplicationInsights\netstandard2.0\Microsoft.ApplicationInsights.dll
1>Compiling Manifest C:\Work\bin\Debug\ETW\net452\Microsoft.ApplicationInsights.Microsoft-ApplicationInsights-Core.etwManifest.man to ETW binary form.
1>Compiling Manifest C:\Work\bin\Debug\ETW\net46\Microsoft.ApplicationInsights.Microsoft-ApplicationInsights-Core.etwManifest.man to ETW binary form.
1>Compiling Manifest C:\Work\bin\Debug\ETW\netstandard2.0\Microsoft.ApplicationInsights.Microsoft-ApplicationInsights-Core.etwManifest.man to ETW binary form.
1>Creating Manifest DLL to hold binary Manifest at C:\Work\bin\Debug\ETW\net452\Microsoft.ApplicationInsights.Microsoft-ApplicationInsights-Core.etwManifest.dll.
1>Creating Manifest DLL to hold binary Manifest at C:\Work\bin\Debug\ETW\net46\Microsoft.ApplicationInsights.Microsoft-ApplicationInsights-Core.etwManifest.dll.
1>Creating Manifest DLL to hold binary Manifest at C:\Work\bin\Debug\ETW\netstandard2.0\Microsoft.ApplicationInsights.Microsoft-ApplicationInsights-Core.etwManifest.dll.
1>Directory.Build.props: Internal_Logging is set to false.
1>Directory.Build.props: Internal_Logging is set to false.
1>Directory.Build.props: Internal_Logging is set to false.
1>Directory.Build.props: Internal_Logging is set to false.
3>------ Rebuild All started: Project: TelemetryChannel, Configuration: Debug Any CPU ------
4>------ Rebuild All started: Project: Microsoft.ApplicationInsights.Isolated.Tests, Configuration: Debug Any CPU ------
4>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
4>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.ComponentModel.Composition". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
4>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.Management". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
4>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.Net". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
4>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.Numerics". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
4>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.Runtime.Serialization". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
4>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.Xml.Linq". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
4>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3243: No way to resolve conflict between "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "System". Choosing "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily.
4>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3243: No way to resolve conflict between "System.Net, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "System.Net". Choosing "System.Net, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" arbitrarily.
4>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3243: No way to resolve conflict between "System.Numerics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "System.Numerics". Choosing "System.Numerics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily.
4>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3243: No way to resolve conflict between "System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "System.Runtime.Serialization". Choosing "System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily.
4>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3243: No way to resolve conflict between "System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "System.Xml.Linq". Choosing "System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily.
3>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets(71,5): error :
3>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets(71,5): error : Process is terminated due to StackOverflowException.
3>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets(71,5): error :
3>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets(71,5): error : Process is terminated due to StackOverflowException.
4>CSC : warning CS8002: Referenced assembly 'Microsoft.ApplicationInsights, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have a strong name.
4>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.ComponentModel.Composition". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
4>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.Management". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
4>Microsoft.ApplicationInsights.Isolated.Tests -> C:\Work\bin\Debug\test\Microsoft.ApplicationInsights.Isolated.Tests\netcoreapp3.1\Microsoft.ApplicationInsights.Isolated.Tests.dll
4>FilesToSign: C:\Work\bin\Debug\test\Microsoft.ApplicationInsights.Isolated.Tests\netcoreapp3.1\Microsoft.ApplicationInsights.Isolated.Tests.dll; Microsoft400; MsSharedLib72
4>Directory.Build.props: Internal_Logging is set to false.
4>Done building project "Microsoft.ApplicationInsights.Isolated.Tests.csproj".
4>CSC : warning CS8002: Referenced assembly 'Microsoft.ApplicationInsights, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have a strong name.
4>Microsoft.ApplicationInsights.Isolated.Tests -> C:\Work\bin\Debug\test\Microsoft.ApplicationInsights.Isolated.Tests\netcoreapp2.1\Microsoft.ApplicationInsights.Isolated.Tests.dll
4>FilesToSign: C:\Work\bin\Debug\test\Microsoft.ApplicationInsights.Isolated.Tests\netcoreapp2.1\Microsoft.ApplicationInsights.Isolated.Tests.dll; Microsoft400; MsSharedLib72
4>Directory.Build.props: Internal_Logging is set to false.
4>Done building project "Microsoft.ApplicationInsights.Isolated.Tests.csproj".
3>Done building project "TelemetryChannel.csproj" -- FAILED.
5>------ Rebuild All started: Project: TelemetryChannel.Nuget.Tests, Configuration: Debug Any CPU ------
6>------ Rebuild All started: Project: Microsoft.ApplicationInsights.Tests (Microsoft.ApplicationInsights.Tests\Microsoft.ApplicationInsights.Tests), Configuration: Debug Any CPU ------
7>------ Rebuild All started: Project: TelemetryChannel.Tests, Configuration: Debug Any CPU ------
4>CSC : warning CS8002: Referenced assembly 'Microsoft.ApplicationInsights, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have a strong name.
4>Microsoft.ApplicationInsights.Isolated.Tests -> C:\Work\bin\Debug\test\Microsoft.ApplicationInsights.Isolated.Tests\net46\Microsoft.ApplicationInsights.Isolated.Tests.dll
4>FilesToSign: C:\Work\bin\Debug\test\Microsoft.ApplicationInsights.Isolated.Tests\net46\Microsoft.ApplicationInsights.Isolated.Tests.dll; Microsoft400; MsSharedLib72
4>Directory.Build.props: Internal_Logging is set to false.
4>Done building project "Microsoft.ApplicationInsights.Isolated.Tests.csproj".
4>Directory.Build.props: Internal_Logging is set to false.
6>CSC : error CS0006: Metadata file 'C:\Work\bin\Debug\test\TelemetryChannel\net452\Microsoft.AI.ServerTelemetryChannel.dll' could not be found
6>Done building project "Microsoft.ApplicationInsights.Tests.csproj" -- FAILED.
6>CSC : error CS0006: Metadata file 'C:\Work\bin\Debug\test\TelemetryChannel\net452\Microsoft.AI.ServerTelemetryChannel.dll' could not be found
6>Done building project "Microsoft.ApplicationInsights.Tests.csproj" -- FAILED.
6>CSC : error CS0006: Metadata file 'C:\Work\bin\Debug\test\TelemetryChannel\netstandard2.0\Microsoft.AI.ServerTelemetryChannel.dll' could not be found
6>Done building project "Microsoft.ApplicationInsights.Tests.csproj" -- FAILED.
5>CSC : error CS0006: Metadata file 'C:\Work\bin\Debug\test\TelemetryChannel\net452\Microsoft.AI.ServerTelemetryChannel.dll' could not be found
5>Done building project "TelemetryChannel.Nuget.Tests.csproj" -- FAILED.
6>CSC : error CS0006: Metadata file 'C:\Work\bin\Debug\test\TelemetryChannel\netstandard2.0\Microsoft.AI.ServerTelemetryChannel.dll' could not be found
6>Done building project "Microsoft.ApplicationInsights.Tests.csproj" -- FAILED.
6>CSC : error CS0006: Metadata file 'C:\Work\bin\Debug\test\TelemetryChannel\netstandard2.0\Microsoft.AI.ServerTelemetryChannel.dll' could not be found
6>Done building project "Microsoft.ApplicationInsights.Tests.csproj" -- FAILED.
6>CSC : error CS0006: Metadata file 'C:\Work\bin\Debug\test\TelemetryChannel\net452\Microsoft.AI.ServerTelemetryChannel.dll' could not be found
6>Done building project "Microsoft.ApplicationInsights.Tests.csproj" -- FAILED.
7>CSC : error CS0006: Metadata file 'C:\Work\bin\Debug\test\TelemetryChannel\net452\Microsoft.AI.ServerTelemetryChannel.dll' could not be found
7>Done building project "TelemetryChannel.Tests.csproj" -- FAILED.
7>CSC : error CS0006: Metadata file 'C:\Work\bin\Debug\test\TelemetryChannel\netstandard2.0\Microsoft.AI.ServerTelemetryChannel.dll' could not be found
7>Done building project "TelemetryChannel.Tests.csproj" -- FAILED.
7>CSC : error CS0006: Metadata file 'C:\Work\bin\Debug\test\TelemetryChannel\netstandard2.0\Microsoft.AI.ServerTelemetryChannel.dll' could not be found
7>Done building project "TelemetryChannel.Tests.csproj" -- FAILED.
========== Rebuild All: 3 succeeded, 4 failed, 0 skipped ==========
I'll just point out that I do not need to build the solution. I just want to browse the source code so I understand what switch I need to modify, and what interface I need to implement in our own solution in order to accomplish what I need in the end.
What I need to accomplish is a matter for another ticket though. Let's keep this ticket focused on this problem and nothing else.
Does running this command work for you: dotnet build Everything.sln
?
This generated exactly 44 warnings and 0 errors for me (i'm slowly working on these warnings).
If this works in your environment, this would confirm that the project is fine, and the problem is with Visual Studio.
I use Visual Studio 2019 myself (16.11.4). I recently reinstalled my dev machine and I can confirm that the only external dependencies are the .NET SDKs.
Reviewing your log...
4>CSC : warning CS8002: Referenced assembly 'Microsoft.ApplicationInsights, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have a strong name.
The strong name properties come from the Product.props
> _Common.props
> _Signing.props
so I think you can ignore that.
Microsoft.CSharp.Core.targets(71,5): error : Process is terminated due to StackOverflowException.
I found this exact error here: https://github.com/dotnet/roslyn/issues/49966 The Roslyn team discusses that some Analyzers could be at fault. You can remove our project's Analyzers by deleting these lines: https://github.com/microsoft/ApplicationInsights-dotnet/blob/deb11f3505be54a3a0376d64665fa7113a2e4da1/.props/Product.props#L14-L32
Thinking about what might unblock you, In Visual Studio you can unload the Test projects to focus on the sdk projects.
After cleaning the repo, and ensuring that "master" is still checked out, I tried running dotnet build Everything.sln
. The result was 3 warnings and 4 errors:
dotnet build Everything.sln
Microsoft (R) Build Engine version 16.11.0+0538acc04 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
Restored C:\Work\ApplicationInsights-dotnet\BASE\Test\ServerTelemetryChannel.Test\TelemetryChannel.Nuget.Tests\TelemetryChannel.Nuget.Tests.csproj (in 246 ms).
Restored C:\Work\ApplicationInsights-dotnet\LOGGING\test\Xdt.Tests\Xdt.Tests.csproj (in 246 ms).
Restored C:\Work\ApplicationInsights-dotnet\LOGGING\src\EtwCollector\EtwCollector.csproj (in 246 ms).
Restored C:\Work\ApplicationInsights-dotnet\LOGGING\src\NLogTarget\NLogTarget.csproj (in 257 ms).
Restored C:\Work\ApplicationInsights-dotnet\LOGGING\src\DiagnosticSourceListener\DiagnosticSourceListener.csproj (in 256 ms).
Restored C:\Work\ApplicationInsights-dotnet\WEB\Src\Web\Web\Web.csproj (in 14 ms).
Restored C:\Work\ApplicationInsights-dotnet\LOGGING\src\ILogger\ILogger.csproj (in 20 ms).
Restored C:\Work\ApplicationInsights-dotnet\LOGGING\src\EventSourceListener\EventSourceListener.csproj (in 18 ms).
Restored C:\Work\ApplicationInsights-dotnet\LOGGING\src\Log4NetAppender\Log4NetAppender.csproj (in 52 ms).
Restored C:\Work\ApplicationInsights-dotnet\LOGGING\src\TraceListener\TraceListener.csproj (in 354 ms).
Restored C:\Work\ApplicationInsights-dotnet\WEB\Src\Web\Web.Tests\Web.Tests.csproj (in 67 ms).
Restored C:\Work\ApplicationInsights-dotnet\NETCORE\src\Microsoft.ApplicationInsights.WorkerService\Microsoft.ApplicationInsights.WorkerService.csproj (in 489 ms).
Restored C:\Work\ApplicationInsights-dotnet\WEB\Src\WindowsServer\WindowsServer\WindowsServer.csproj (in 212 ms).
Restored C:\Work\ApplicationInsights-dotnet\NETCORE\src\Microsoft.ApplicationInsights.AspNetCore\Microsoft.ApplicationInsights.AspNetCore.csproj (in 523 ms).
Restored C:\Work\ApplicationInsights-dotnet\WEB\Src\HostingStartup\HostingStartup\HostingStartup.csproj (in 27 ms).
Restored C:\Work\ApplicationInsights-dotnet\WEB\Src\HostingStartup\HostingStartup.Tests\HostingStartup.Tests.csproj (in 39 ms).
Restored C:\Work\ApplicationInsights-dotnet\WEB\Src\EventCounterCollector\EventCounterCollector\EventCounterCollector.csproj (in 30 ms).
Restored C:\Work\ApplicationInsights-dotnet\WEB\Src\PerformanceCollector\PerformanceCollector\Perf.csproj (in 241 ms).
Restored C:\Work\ApplicationInsights-dotnet\LOGGING\test\DiagnosticSourceListener.Tests\DiagnosticSourceListener.Tests.csproj (in 716 ms).
Restored C:\Work\ApplicationInsights-dotnet\LOGGING\test\EtwCollector.Tests\EtwCollector.Tests.csproj (in 24 ms).
Restored C:\Work\ApplicationInsights-dotnet\BASE\Test\ServerTelemetryChannel.Test\TelemetryChannel.Tests\TelemetryChannel.Tests.csproj (in 794 ms).
Restored C:\Work\ApplicationInsights-dotnet\NETCORE\test\Microsoft.ApplicationInsights.WorkerService.Tests\Microsoft.ApplicationInsights.WorkerService.Tests.csproj (in 466 ms).
Restored C:\Work\ApplicationInsights-dotnet\BASE\Test\Microsoft.ApplicationInsights.Test\Standalone\Microsoft.ApplicationInsights.Isolated.Tests.csproj (in 828 ms).
Restored C:\Work\ApplicationInsights-dotnet\WEB\Src\PerformanceCollector\Perf.Tests\Perf.Tests.csproj (in 335 ms).
Restored C:\Work\ApplicationInsights-dotnet\LOGGING\test\EventSourceListener.Tests\EventSourceListener.Tests.csproj (in 273 ms).
Restored C:\Work\ApplicationInsights-dotnet\LOGGING\test\ILogger.Tests\ILogger.Tests.csproj (in 282 ms).
Restored C:\Work\ApplicationInsights-dotnet\WEB\Src\DependencyCollector\DependencyCollector\DependencyCollector.csproj (in 70 ms).
Restored C:\Work\ApplicationInsights-dotnet\WEB\Src\WindowsServer\WindowsServer.Tests\WindowsServer.Tests.csproj (in 687 ms).
Restored C:\Work\ApplicationInsights-dotnet\NETCORE\test\ApplicationInsightsTypes\ApplicationInsightsTypes.csproj (in 181 ms).
Restored C:\Work\ApplicationInsights-dotnet\BASE\Test\Microsoft.ApplicationInsights.Test\Microsoft.ApplicationInsights.Tests\Microsoft.ApplicationInsights.Tests.csproj (in 1,03 sec).
Restored C:\Work\ApplicationInsights-dotnet\BASE\src\Microsoft.ApplicationInsights\Microsoft.ApplicationInsights.csproj (in 37 ms).
Restored C:\Work\ApplicationInsights-dotnet\WEB\Src\EventCounterCollector\EventCounterCollector.Tests\EventCounterCollector.Tests.csproj (in 289 ms).
Restored C:\Work\ApplicationInsights-dotnet\BASE\src\ServerTelemetryChannel\TelemetryChannel.csproj (in 79 ms).
Restored C:\Work\ApplicationInsights-dotnet\NETCORE\test\Microsoft.ApplicationInsights.AspNetCore.Tests\Microsoft.ApplicationInsights.AspNetCore.Tests.csproj (in 830 ms).
Restored C:\Work\ApplicationInsights-dotnet\BASE\Test\Microsoft.ApplicationInsights.Test\ApplicationInsightsTypes\ApplicationInsightsTypes.csproj (in 124 ms).
Restored C:\Work\ApplicationInsights-dotnet\LOGGING\test\TraceListener.Tests\TraceListener.Tests.csproj (in 315 ms).
Restored C:\Work\ApplicationInsights-dotnet\LOGGING\test\NLogTarget.Tests\NLogTarget.Tests.csproj (in 315 ms).
Restored C:\Work\ApplicationInsights-dotnet\LOGGING\test\Log4NetAppender.Tests\Log4NetAppender.Tests.csproj (in 270 ms).
Restored C:\Work\ApplicationInsights-dotnet\WEB\Src\DependencyCollector\DependencyCollector.Tests\DependencyCollector.Tests.csproj (in 383 ms).
Restored C:\Work\ApplicationInsights-dotnet\NETCORE\test\FunctionalTests.Utils\FunctionalTests.Utils.csproj (in 557 ms).
Restored C:\Work\ApplicationInsights-dotnet\NETCORE\test\FunctionalTests.WebApi.Tests\FunctionalTests.WebApi.Tests.csproj (in 1,39 sec).
Restored C:\Work\ApplicationInsights-dotnet\NETCORE\test\FunctionalTests.MVC.Tests\FunctionalTests.MVC.Tests.csproj (in 1,04 sec).
2 of 44 projects are up-to-date for restore.
C:\Work\obj\Debug\Microsoft.ApplicationInsights\netstandard2.0\Microsoft.ApplicationInsights.AssemblyInfo.cs(17,59): warning CS7035: The specified version string does not conform to the recommended format - major.minor.build.revision [C:\Work\ApplicationInsights-dotnet\BASE\src\Microsoft.ApplicationInsights\Microsoft.ApplicationInsights.csproj]
C:\Work\obj\Debug\Microsoft.ApplicationInsights\net46\Microsoft.ApplicationInsights.AssemblyInfo.cs(17,59): warning CS7035: The specified version string does not conform to the recommended format - major.minor.build.revision [C:\Work\ApplicationInsights-dotnet\BASE\src\Microsoft.ApplicationInsights\Microsoft.ApplicationInsights.csproj]
C:\Work\obj\Debug\Microsoft.ApplicationInsights\net46\Microsoft.ApplicationInsights.AssemblyInfo.cs(21,55): error CS7034: The specified version string does not conform to the required format - major[.minor[.build[.revision]]] [C:\Work\ApplicationInsights-dotnet\BASE\src\Microsoft.ApplicationInsights\Microsoft.ApplicationInsights.csproj]
C:\Work\obj\Debug\Microsoft.ApplicationInsights\netstandard2.0\Microsoft.ApplicationInsights.AssemblyInfo.cs(21,55): error CS7034: The specified version string does not conform to the required format - major[.minor[.build[.revision]]] [C:\Work\ApplicationInsights-dotnet\BASE\src\Microsoft.ApplicationInsights\Microsoft.ApplicationInsights.csproj]
C:\Work\obj\Debug\Microsoft.ApplicationInsights\net452\Microsoft.ApplicationInsights.AssemblyInfo.cs(17,59): warning CS7035: The specified version string does not conform to the recommended format - major.minor.build.revision [C:\Work\ApplicationInsights-dotnet\BASE\src\Microsoft.ApplicationInsights\Microsoft.ApplicationInsights.csproj]
C:\Work\obj\Debug\Microsoft.ApplicationInsights\net452\Microsoft.ApplicationInsights.AssemblyInfo.cs(21,55): error CS7034: The specified version string does not conform to the required format - major[.minor[.build[.revision]]] [C:\Work\ApplicationInsights-dotnet\BASE\src\Microsoft.ApplicationInsights\Microsoft.ApplicationInsights.csproj]
CSC : error CS2012: Cannot open 'C:\Work\obj\Debug\ApplicationInsightsTypes\netstandard2.0\ApplicationInsightsTypes.dll' for writing -- 'The process cannot access the file 'C:\Work\obj\Debug\ApplicationInsightsTypes\netstandard2.0\ApplicationInsightsTypes.dll' because it is being used by another process.' [C:\Work\ApplicationInsights-dotnet\BASE\Test\Microsoft.ApplicationInsights.Test\ApplicationInsightsTypes\ApplicationInsightsTypes.csproj]
ApplicationInsightsTypes -> C:\Work\bin\Debug\Test\Microsoft.ApplicationInsights.Test\ApplicationInsightsTypes\net452\ApplicationInsightsTypes.dll
FilesToSign: C:\Work\bin\Debug\Test\Microsoft.ApplicationInsights.Test\ApplicationInsightsTypes\net452\ApplicationInsightsTypes.dll; Microsoft400; MsSharedLib72
Directory.Build.props: Internal_Logging is set to false.
ApplicationInsightsTypes -> C:\Work\bin\Debug\test\ApplicationInsightsTypes\net461\ApplicationInsightsTypes.dll
Directory.Build.props: Internal_Logging is set to false.
ApplicationInsightsTypes -> C:\Work\bin\Debug\test\ApplicationInsightsTypes\netstandard2.0\ApplicationInsightsTypes.dll
Directory.Build.props: Internal_Logging is set to false.
Directory.Build.props: Internal_Logging is set to false.
Build FAILED.
C:\Work\obj\Debug\Microsoft.ApplicationInsights\netstandard2.0\Microsoft.ApplicationInsights.AssemblyInfo.cs(17,59): warning CS7035: The specified version string does not conform to the recommended format - major.minor.build.revision [C:\Work\ApplicationInsights-dotnet\BASE\src\Microsoft.ApplicationInsights\Microsoft.ApplicationInsights.csproj]
C:\Work\obj\Debug\Microsoft.ApplicationInsights\net46\Microsoft.ApplicationInsights.AssemblyInfo.cs(17,59): warning CS7035: The specified version string does not conform to the recommended format - major.minor.build.revision [C:\Work\ApplicationInsights-dotnet\BASE\src\Microsoft.ApplicationInsights\Microsoft.ApplicationInsights.csproj]
C:\Work\obj\Debug\Microsoft.ApplicationInsights\net452\Microsoft.ApplicationInsights.AssemblyInfo.cs(17,59): warning CS7035: The specified version string does not conform to the recommended format - major.minor.build.revision [C:\Work\ApplicationInsights-dotnet\BASE\src\Microsoft.ApplicationInsights\Microsoft.ApplicationInsights.csproj]
C:\Work\obj\Debug\Microsoft.ApplicationInsights\net46\Microsoft.ApplicationInsights.AssemblyInfo.cs(21,55): error CS7034: The specified version string does not conform to the required format - major[.minor[.build[.revision]]] [C:\Work\ApplicationInsights-dotnet\BASE\src\Microsoft.ApplicationInsights\Microsoft.ApplicationInsights.csproj]
C:\Work\obj\Debug\Microsoft.ApplicationInsights\netstandard2.0\Microsoft.ApplicationInsights.AssemblyInfo.cs(21,55): error CS7034: The specified version string does not conform to the required format - major[.minor[.build[.revision]]] [C:\Work\ApplicationInsights-dotnet\BASE\src\Microsoft.ApplicationInsights\Microsoft.ApplicationInsights.csproj]
C:\Work\obj\Debug\Microsoft.ApplicationInsights\net452\Microsoft.ApplicationInsights.AssemblyInfo.cs(21,55): error CS7034: The specified version string does not conform to the required format - major[.minor[.build[.revision]]] [C:\Work\ApplicationInsights-dotnet\BASE\src\Microsoft.ApplicationInsights\Microsoft.ApplicationInsights.csproj]
CSC : error CS2012: Cannot open 'C:\Work\obj\Debug\ApplicationInsightsTypes\netstandard2.0\ApplicationInsightsTypes.dll' for writing -- 'The process cannot access the file 'C:\Work\obj\Debug\ApplicationInsightsTypes\netstandard2.0\ApplicationInsightsTypes.dll' because it is being used by another process.' [C:\Work\ApplicationInsights-dotnet\BASE\Test\Microsoft.ApplicationInsights.Test\ApplicationInsightsTypes\ApplicationInsightsTypes.csproj]
3 Warning(s)
4 Error(s)
Time Elapsed 00:00:05.95
After removing the analyzer rows from Product.props, the command-line build yields similar results but the last error "The process cannot access the file" is not there. Situation in Visual Studio 2019 has not changed, it is still stuck in a forever-loop.
Prompted by your tip regarding analyzers, I tried removing the SonarLint extension that we use. This removal had no effect; after restart the "Microsoft.ApplicationInsights.sln" is still stuck in the same forever loop.
I tried unloading all test projects from "Microsoft.ApplicationInsights.sln". This had no effect, the restore is still stuck in the same loop, with the following errors:
I'm searching those Nuget Errors... I can't find anything reletad to NU1105. I found some conversations around NU1201 dating back to 2017; reference nuget restore fails for Net Standard SDK projects.
What version of Nuget do you have in your environment?
When I run dotnet nuget --help
I get NuGet Command Line 6.0.0.243
Looking at your cli build errors:
error CS7034: The specified version string does not conform to the required format
This is the exact error that another customer referenced in #2178. We never found the root cause for this. To work around this, disable the generated build numbers at this line: https://github.com/microsoft/ApplicationInsights-dotnet/blob/deb11f3505be54a3a0376d64665fa7113a2e4da1/.props/_GlobalStaticVersion.props#L39
- <AssemblyVersion>$(VersionPrefix).$(BuildNumber)</AssemblyVersion>
+ <AssemblyVersion>$(VersionPrefix)</AssemblyVersion>
CSC : error CS2012: Cannot open 'C:\Work\obj\Debug\ApplicationInsightsTypes\netstandard2.0\ApplicationInsightsTypes.dll' for writing -- 'The process cannot access the file 'C:\Work\obj\Debug\ApplicationInsightsTypes\netstandard2.0\ApplicationInsightsTypes.dll' because it is being used by another process.' [C:\Work\ApplicationInsights-dotnet\BASE\Test\Microsoft.ApplicationInsights.Test\ApplicationInsightsTypes\ApplicationInsightsTypes.csproj]
This is a consequence of our custom output directories. By default, csprojs have nested "bin" and "obj" directories. But we change that to root because it simplifies our release scripts. I've never seen this error in cli, but I see it about once a week in Visual Studio. I think VS still creates these nested directories and then holds a lock on them. (I've spent a lot of time on this one issue but have found a solution yet.) Manually deleting these directories, or restarting your process will release the lock and then the build should work.
I'm sorry you're having these issues. Thank you for sharing.
The command dotnet nuget --help
reports NuGet Command Line 5.11.0.10
. I have no idea how to upgrade that. I've ran the command in the folder where I've checked out the source code.
This is a consequence of our custom output directories. By default, csprojs have nested "bin" and "obj" directories. But we change that to root because it simplifies our release scripts.
This is surely something that should be mentioned in the build instructions. From a technical standpoint this is an "out-of-tree" build operation, and thus it should be documented. If someone were to check out Application Insights into a folder which already contained "bin" and "obj" for other purposes than AI itself then the combined result could lead to problems. One potential solution is to just create an extra directory in AI git repo to represent "the root folder".
I thank you @TimothyMothra for all your help so far. Unfortunately all these errors and obstacles have now discouraged me from attempting to further dive into the AI SDK to understand how I need to modify the DependencyCollector module so it no longer automatically logs http/https calls. Instead, I have opted to just disable the module altogether and write custom operation boundaries around the various Azure SDK features that we use such as CosmosDB, ServiceBus, Blob Storage etc. I have found that I need to use specific hard-coded "type" properties for the telemetry in order to make them appear as-if they came from the AI SDK itself. That's a burden I am willing to accept.
I'll probably close this report soon. Despite of that, and since this problem reproduces reliably on my workstation, I can still run various commands and and tests if that will provide insight for you into what might cause this problem, so as to assist you in finding the root cause.
Describe the bug
This is related to the following issue: https://github.com/microsoft/ApplicationInsights-dotnet/issues/2178 but describes a slightly different scenario. The linked issue has sidetracked into something related to version numbers and I can't even get that far.
After cloning the repository, I am trying to open the Microsoft.ApplicationInsights.Web solution. The solution can be opened but seems to stuck in some kind of a forever-loop while restoring NuGet dependencies. This causes the error list to build up, and in the end contains over two thousand error rows.
From the default Output log, the following messages can be observed (drive and directory redacted for security reasons)
This seems to be somehow related to an error in one or more of the project files. The following error is the most consistent one, and is always shown at the top of the Error List:
To Reproduce
Operating environment:
Output from
dotnet --info
when executed at the repository root folder:Note that running
dotnet restore Everything.sln
shows that the .NET Core 6.0 SDK is apparently required but it is not possible to install this SDK for Visual Studio 2019: