WindowsAppSDK: The "ExpandPriContent" task failed unexpectedly. Cannot access a disposed object.
Describe the bug
I’m often experiencing the following bug when compiling. Usually it works, but once hitting this, I have to restart Visual Studio. Looks to be a failure in the telemetry code, preventing me from compiling. I don’t have a consistent repro, but have observed it with both v1.0.0 and v1.1.4:
1>------ Build started: Project: Toolkit.SampleApp.Maui, Configuration: Debug Any CPU ------
1>Skipping analyzers to speed up the build. You can execute 'Build' or 'Rebuild' command to run analyzers.
1>C:\Users\mort5161\.nuget\packages\microsoft.windowsappsdk\1.0.0\build\MrtCore.PriGen.targets(891,5): error MSB4018: The "ExpandPriContent" task failed unexpectedly.
1>C:\Users\mort5161\.nuget\packages\microsoft.windowsappsdk\1.0.0\build\MrtCore.PriGen.targets(891,5): error MSB4018: System.ObjectDisposedException: Cannot access a disposed object.
1>C:\Users\mort5161\.nuget\packages\microsoft.windowsappsdk\1.0.0\build\MrtCore.PriGen.targets(891,5): error MSB4018: Object name: 'it is not allowed to use disposed Microsoft.VisualStudio.Telemetry.TelemetrySession object.'.
1>C:\Users\mort5161\.nuget\packages\microsoft.windowsappsdk\1.0.0\build\MrtCore.PriGen.targets(891,5): error MSB4018: at Microsoft.VisualStudio.Telemetry.TelemetryDisposableObject.RequiresNotDisposed()
1>C:\Users\mort5161\.nuget\packages\microsoft.windowsappsdk\1.0.0\build\MrtCore.PriGen.targets(891,5): error MSB4018: at Microsoft.VisualStudio.Telemetry.TelemetrySession.SerializeSettings()
1>C:\Users\mort5161\.nuget\packages\microsoft.windowsappsdk\1.0.0\build\MrtCore.PriGen.targets(891,5): error MSB4018: at Microsoft.Build.AppxPackage.Telemetry.Get(IBuildEngine4 buildEngine, String vsTelemetrySession)
1>C:\Users\mort5161\.nuget\packages\microsoft.windowsappsdk\1.0.0\build\MrtCore.PriGen.targets(891,5): error MSB4018: at Microsoft.Build.AppxPackage.AppxPackagingTaskHelper..ctor(IBuildEngine4 buildEngine, TaskLoggingHelper logger, Action execute, Func`2 exceptionHandler, Action cleanup, Func`1 manifestFileNameGetter, String vsTelemetrySession)
1>C:\Users\mort5161\.nuget\packages\microsoft.windowsappsdk\1.0.0\build\MrtCore.PriGen.targets(891,5): error MSB4018: at Microsoft.Build.AppxPackage.AppxPackagingToolTaskBase.Execute()
1>C:\Users\mort5161\.nuget\packages\microsoft.windowsappsdk\1.0.0\build\MrtCore.PriGen.targets(891,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
1>C:\Users\mort5161\.nuget\packages\microsoft.windowsappsdk\1.0.0\build\MrtCore.PriGen.targets(891,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
1>Done building project "Esri.ArcGISRuntime.Toolkit.WinUI.csproj" -- FAILED.
Steps to reproduce the bug
No specific repro. Happens after building a maui app over and over. I’ve observed it on two different PCs, one running Win10 and the other Win11. VS version was 17.3.1 on both.
Expected behavior
No response
Screenshots
No response
NuGet package version
1.1.4
Packaging type
Packaged (MSIX)
Windows version
Windows 11 version 21H2 (22000)
IDE
Visual Studio 2022
Additional context
Visual Studio 17.3.1. Looks very similar to Xamarin telemetry issue (that was supposed to be fixed in 17.3.1 but I’m still occasionally observing that one too). See https://developercommunity.visualstudio.com/t/Unexpecter-error-of-task-Xamarin-Teleme/10096527
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 3
- Comments: 18 (9 by maintainers)
We have root caused this issue to a bug in the MSIX packaging support logic in Windows App SDK and will have a fix available soon. There is no workaround.
ITNOA
@rohanp-msft please reopen this issue
I do not think this issue is resolved
@soroshsabz The owners have changed (see the current Assignees of this issue). I notified them when you commented. @loneursid can provide the triage results.