diff --git a/src/Build/Logging/BinaryLogger/BuildEventArgsReader.cs b/src/Build/Logging/BinaryLogger/BuildEventArgsReader.cs index 3c3e2a2faee..38e391565de 100644 --- a/src/Build/Logging/BinaryLogger/BuildEventArgsReader.cs +++ b/src/Build/Logging/BinaryLogger/BuildEventArgsReader.cs @@ -642,7 +642,7 @@ private BuildEventArgs ReadBuildErrorEventArgs() fields.Arguments) { ProjectFile = fields.ProjectFile, - ExtendedMetadata = fields.Extended.ExtendedMetadata, + ExtendedMetadata = fields.Extended.ExtendedMetadataAsDictionary, ExtendedData = fields.Extended.ExtendedData, }; } @@ -694,7 +694,7 @@ private BuildEventArgs ReadBuildWarningEventArgs() fields.Arguments) { ProjectFile = fields.ProjectFile, - ExtendedMetadata = fields.Extended.ExtendedMetadata, + ExtendedMetadata = fields.Extended.ExtendedMetadataAsDictionary, ExtendedData = fields.Extended.ExtendedData, }; } @@ -747,7 +747,7 @@ private BuildEventArgs ReadBuildMessageEventArgs() fields.Arguments) { ProjectFile = fields.ProjectFile, - ExtendedMetadata = fields.Extended?.ExtendedMetadata, + ExtendedMetadata = fields.Extended?.ExtendedMetadataAsDictionary, ExtendedData = fields.Extended?.ExtendedData, }; } @@ -836,7 +836,7 @@ private BuildEventArgs ReadCriticalBuildMessageEventArgs() fields.Arguments) { ProjectFile = fields.ProjectFile, - ExtendedMetadata = fields.Extended?.ExtendedMetadata, + ExtendedMetadata = fields.Extended?.ExtendedMetadataAsDictionary, ExtendedData = fields.Extended?.ExtendedData, }; } diff --git a/src/Build/Logging/BinaryLogger/ExtendedDataFields.cs b/src/Build/Logging/BinaryLogger/ExtendedDataFields.cs index 2a227e9d69c..12912cc3e70 100644 --- a/src/Build/Logging/BinaryLogger/ExtendedDataFields.cs +++ b/src/Build/Logging/BinaryLogger/ExtendedDataFields.cs @@ -17,4 +17,14 @@ public ExtendedDataFields(string extendedType, IDictionary? ext public string ExtendedType { get; } public IDictionary? ExtendedMetadata { get; } public string? ExtendedData { get; } + + /// + /// We need to this for Extended event args have Dictionary as ExtendedMetadata. + /// + public Dictionary? ExtendedMetadataAsDictionary => + ExtendedMetadata == null ? + null : + ExtendedMetadata is Dictionary asDictionary ? + asDictionary : + new Dictionary(ExtendedMetadata); } diff --git a/src/Framework/ExtendedBuildErrorEventArgs.cs b/src/Framework/ExtendedBuildErrorEventArgs.cs index e5830592b6c..85d10939236 100644 --- a/src/Framework/ExtendedBuildErrorEventArgs.cs +++ b/src/Framework/ExtendedBuildErrorEventArgs.cs @@ -18,7 +18,7 @@ public sealed class ExtendedBuildErrorEventArgs : BuildErrorEventArgs, IExtended public string ExtendedType { get; set; } /// - public IDictionary? ExtendedMetadata { get; set; } + public Dictionary? ExtendedMetadata { get; set; } /// public string? ExtendedData { get; set; } diff --git a/src/Framework/ExtendedBuildMessageEventArgs.cs b/src/Framework/ExtendedBuildMessageEventArgs.cs index 6330a502050..53ec510c8da 100644 --- a/src/Framework/ExtendedBuildMessageEventArgs.cs +++ b/src/Framework/ExtendedBuildMessageEventArgs.cs @@ -18,7 +18,7 @@ public sealed class ExtendedBuildMessageEventArgs : BuildMessageEventArgs, IExte public string ExtendedType { get; set; } /// - public IDictionary? ExtendedMetadata { get; set; } + public Dictionary? ExtendedMetadata { get; set; } /// public string? ExtendedData { get; set; } diff --git a/src/Framework/ExtendedBuildWarningEventArgs.cs b/src/Framework/ExtendedBuildWarningEventArgs.cs index 88eaf08af0d..9481d2bfbdc 100644 --- a/src/Framework/ExtendedBuildWarningEventArgs.cs +++ b/src/Framework/ExtendedBuildWarningEventArgs.cs @@ -18,7 +18,7 @@ public sealed class ExtendedBuildWarningEventArgs : BuildWarningEventArgs, IExte public string ExtendedType { get; set; } /// - public IDictionary? ExtendedMetadata { get; set; } + public Dictionary? ExtendedMetadata { get; set; } /// public string? ExtendedData { get; set; } diff --git a/src/Framework/ExtendedCriticalBuildMessageEventArgs.cs b/src/Framework/ExtendedCriticalBuildMessageEventArgs.cs index 8b16acdb3be..3897a1de6e6 100644 --- a/src/Framework/ExtendedCriticalBuildMessageEventArgs.cs +++ b/src/Framework/ExtendedCriticalBuildMessageEventArgs.cs @@ -18,7 +18,7 @@ public sealed class ExtendedCriticalBuildMessageEventArgs : CriticalBuildMessage public string ExtendedType { get; set; } /// - public IDictionary? ExtendedMetadata { get; set; } + public Dictionary? ExtendedMetadata { get; set; } /// public string? ExtendedData { get; set; } diff --git a/src/Framework/ExtendedCustomBuildEventArgs.cs b/src/Framework/ExtendedCustomBuildEventArgs.cs index 8a20c512923..0669c025843 100644 --- a/src/Framework/ExtendedCustomBuildEventArgs.cs +++ b/src/Framework/ExtendedCustomBuildEventArgs.cs @@ -18,7 +18,7 @@ public sealed class ExtendedCustomBuildEventArgs : CustomBuildEventArgs, IExtend public string ExtendedType { get; set; } /// - public IDictionary? ExtendedMetadata { get; set; } + public Dictionary? ExtendedMetadata { get; set; } /// public string? ExtendedData { get; set; } diff --git a/src/Framework/IExtendedBuildEventArgs.cs b/src/Framework/IExtendedBuildEventArgs.cs index 83b4c3ba555..0c73ddb914f 100644 --- a/src/Framework/IExtendedBuildEventArgs.cs +++ b/src/Framework/IExtendedBuildEventArgs.cs @@ -22,7 +22,7 @@ public interface IExtendedBuildEventArgs /// - data which needed in custom code to properly routing this message without interpreting/deserializing . /// - simple extended data can be transferred in form of dictionary key-value per one extended property. /// - IDictionary? ExtendedMetadata { get; set; } + Dictionary? ExtendedMetadata { get; set; } /// /// Transparent data as string.