Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Build/BackEnd/Components/Logging/TargetLoggingContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ internal ProjectTargetInstance Target
/// </summary>
internal void LogTargetBatchFinished(string projectFullPath, bool success, IEnumerable<TaskItem> targetOutputs)
{
ErrorUtilities.VerifyThrow(IsValid, "Should be valid");
this.CheckValidity();

TargetOutputItemsInstanceEnumeratorProxy targetOutputWrapper = null;

Expand All @@ -110,7 +110,7 @@ internal void LogTargetBatchFinished(string projectFullPath, bool success, IEnum
/// </summary>
internal TaskLoggingContext LogTaskBatchStarted(string projectFullPath, ProjectTargetInstanceChild task, string taskAssemblyLocation)
{
ErrorUtilities.VerifyThrow(IsValid, "Should be valid");
this.CheckValidity();

return new TaskLoggingContext(this, projectFullPath, task, taskAssemblyLocation);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ private void CurrentDomainOnAssemblyLoad(object? sender, AssemblyLoadEventArgs a
if (_loggingContext?.BuildEventContext != null)
{
buildArgs.BuildEventContext = _loggingContext.BuildEventContext;
_loggingContext.LogBuildEvent(buildArgs);
// bypass the logging context validity check: it's possible that the load happened
// on a thread unrelated to the context we're tracking loads in
_loggingContext.LoggingService.LogBuildEvent(buildArgs);
}
_loggingService?.LogBuildEvent(buildArgs);
}
Expand Down