Skip to content

Conversation

@jonathanpeppers
Copy link
Member

Context: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1585820
Context: https://github.com/xamarin/XamarinVS/pull/13271

Many of our MSBuild tests fail with:

error MSB4018: The "XamarinTelemetry" task failed unexpectedly.
error MSB4018: System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.
error MSB4018: File name: 'Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'
error MSB4018:    at Microsoft.VisualStudio.Telemetry.TelemetrySessionSettings.GetFaultEventBucketFilterJson(List`1 bucketFilters)
error MSB4018:    at Microsoft.VisualStudio.Telemetry.TelemetrySessionSettings.ToString()
error MSB4018:    at Microsoft.VisualStudio.Telemetry.TelemetrySession.SerializeSettings()
error MSB4018:    at Xamarin.Common.Tasks.Telemetry.GetSession(IBuildEngine4 buildEngine, String vsTelemetrySession) in D:\a\_work\1\s\src\MSBuild\Xamarin.Common.Tasks\Telemetry.cs:line 62
error MSB4018:    at Xamarin.Common.Tasks.XamarinTelemetry.Execute() in D:\a\_work\1\s\src\MSBuild\Xamarin.Common.Tasks\XamarinTelemetry.cs:line 31
error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
error MSB4018: WRN: Assembly binding logging is turned OFF.
error MSB4018: To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
error MSB4018: Note: There is some performance penalty associated with assembly bind failure logging.
error MSB4018: To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

It appears there is a fix in XamarinVS for this.

In order to get our CI working, it appears we can set
%_WriteTelemetryProperties% to false for now to workaround it:

https://github.com/xamarin/XamarinVS/blob/d31703e0163cd3db24e874146c41988f64fac737/src/MSBuild/Xamarin/Xamarin.Sdk.targets#L82

Context: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1585820
Context: xamarin/XamarinVS#13271

Many of our MSBuild tests fail with:

    error MSB4018: The "XamarinTelemetry" task failed unexpectedly.
    error MSB4018: System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.
    error MSB4018: File name: 'Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'
    error MSB4018:    at Microsoft.VisualStudio.Telemetry.TelemetrySessionSettings.GetFaultEventBucketFilterJson(List`1 bucketFilters)
    error MSB4018:    at Microsoft.VisualStudio.Telemetry.TelemetrySessionSettings.ToString()
    error MSB4018:    at Microsoft.VisualStudio.Telemetry.TelemetrySession.SerializeSettings()
    error MSB4018:    at Xamarin.Common.Tasks.Telemetry.GetSession(IBuildEngine4 buildEngine, String vsTelemetrySession) in D:\a\_work\1\s\src\MSBuild\Xamarin.Common.Tasks\Telemetry.cs:line 62
    error MSB4018:    at Xamarin.Common.Tasks.XamarinTelemetry.Execute() in D:\a\_work\1\s\src\MSBuild\Xamarin.Common.Tasks\XamarinTelemetry.cs:line 31
    error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
    error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
    error MSB4018: WRN: Assembly binding logging is turned OFF.
    error MSB4018: To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
    error MSB4018: Note: There is some performance penalty associated with assembly bind failure logging.
    error MSB4018: To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

It appears there is a fix in XamarinVS for this.

In order to get our CI working, it appears we can set
`%_WriteTelemetryProperties%` to `false` for now to workaround it:

https://github.com/xamarin/XamarinVS/blob/d31703e0163cd3db24e874146c41988f64fac737/src/MSBuild/Xamarin/Xamarin.Sdk.targets#L82
@jonathanpeppers
Copy link
Member Author

These already looks "greener" than main:

image

The one lane that failed hit:

Workload installation failed: Response status code does not indicate success: 500 (Internal Server Error - Maximum waiter thread limit 500 is reached. Throwing exception to avoid thread exhaustion. (DevOps Activity ID: FFAB1B6F-B2B6-4E00-A443-C1582D614E72)).

@jonathanpeppers jonathanpeppers marked this pull request as ready for review August 17, 2022 17:05
@jonpryor jonpryor merged commit f9dc964 into dotnet:main Aug 17, 2022
@jonathanpeppers jonathanpeppers deleted the XamarinTelemetry branch August 17, 2022 18:29
jonathanpeppers added a commit that referenced this pull request Aug 17, 2022
Context: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1585820
Context: xamarin/XamarinVS#13271

Visual Studio 17.3.0 introduced a new
[`_WriteTelemetryProperties`][0] target into `Xamarin.Sdk.targets`:

	<Target Name="_WriteTelemetryProperties"
	        DependsOnTargets="_CollectAndroidTelemetryProperties;_CollectIOSTelemetryProperties"
	        AfterTargets="Build"
	        Condition="'$(_WriteTelemetryProperties)' != 'false'">

Unfortunately, this new target uses a new `<XamarinTelemetry/>` task
which fails on CI, which impacts many of our MSBuild unit tests:

	error MSB4018: The "XamarinTelemetry" task failed unexpectedly.
	error MSB4018: System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.
	error MSB4018: File name: 'Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'
	error MSB4018:    at Microsoft.VisualStudio.Telemetry.TelemetrySessionSettings.GetFaultEventBucketFilterJson(List`1 bucketFilters)
	error MSB4018:    at Microsoft.VisualStudio.Telemetry.TelemetrySessionSettings.ToString()
	error MSB4018:    at Microsoft.VisualStudio.Telemetry.TelemetrySession.SerializeSettings()
	error MSB4018:    at Xamarin.Common.Tasks.Telemetry.GetSession(IBuildEngine4 buildEngine, String vsTelemetrySession) in D:\a\_work\1\s\src\MSBuild\Xamarin.Common.Tasks\Telemetry.cs:line 62
	error MSB4018:    at Xamarin.Common.Tasks.XamarinTelemetry.Execute() in D:\a\_work\1\s\src\MSBuild\Xamarin.Common.Tasks\XamarinTelemetry.cs:line 31
	error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
	error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
	error MSB4018: WRN: Assembly binding logging is turned OFF.
	error MSB4018: To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
	error MSB4018: Note: There is some performance penalty associated with assembly bind failure logging.
	error MSB4018: To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

It appears that this will be fixed in Visual Studio 17.3.1.

In the meantime, fix our CI by *disabling* telemetry, by setting the
`%_WriteTelemetryProperties%` env var to `false`.
@AmrAlSayed0
Copy link

I think the issue comes from the fact that there is no Newtonsoft.Json with the version 13.0.0.0. The closest version on NuGet is 13.0.1.

@jonathanpeppers
Copy link
Member Author

jonathanpeppers commented Aug 17, 2022 via email

@github-actions github-actions bot locked and limited conversation to collaborators Jan 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants