Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
97c2800
Update to .NET 8 Preview 4
adityapatwardhan May 23, 2023
67932a9
Fix warnings by SYSLIB0051
adityapatwardhan May 23, 2023
2e2e028
Fix warnings by SYSLIB0050
adityapatwardhan May 23, 2023
eed2bc9
Fix warnings by SYSLIB0051
adityapatwardhan May 23, 2023
8786663
Fix warnings by SYSLIB0051
adityapatwardhan May 23, 2023
e34218b
Fix tests to reflect removal of serializable attribute
adityapatwardhan May 23, 2023
e823564
Fix BOM
adityapatwardhan May 23, 2023
39b861b
CR feedback
adityapatwardhan May 24, 2023
e1fd200
CR feedback 2
adityapatwardhan May 24, 2023
e113e0e
CR feedback
adityapatwardhan Jun 12, 2023
16bfe48
Resolve conflict
adityapatwardhan Jun 12, 2023
a8b6240
Merge branch 'master' into updateNET8p4
adityapatwardhan Jun 12, 2023
a44b326
Remove obsolete attribute
adityapatwardhan Jun 12, 2023
acfafbb
Couple of more missed cases
adityapatwardhan Jun 12, 2023
3195f28
CR feedback
adityapatwardhan Jun 16, 2023
5558f84
Merge branch 'master' into updateNET8p4
adityapatwardhan Jun 16, 2023
8d4dc91
update BOM
adityapatwardhan Jun 17, 2023
dfe5b7d
Merge branch 'updateNET8p4' of https://github.com/adityapatwardhan/Po…
adityapatwardhan Jun 17, 2023
ebe457e
update BOM
adityapatwardhan Jun 17, 2023
519f49b
CR feeback
adityapatwardhan Jun 20, 2023
b3263d9
More CR feedback
adityapatwardhan Jun 20, 2023
3cb4fdd
Remove ISerializable from ScriptBlock
adityapatwardhan Jun 21, 2023
9d18dae
Fix build
adityapatwardhan Jun 21, 2023
772360e
Remove all [Serializable] attributes
adityapatwardhan Jun 21, 2023
a8644b1
Update StateDescriptor.cs
daxian-dbw Jun 21, 2023
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
6 changes: 3 additions & 3 deletions DotnetRuntimeMetadata.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"sdk": {
"channel": "8.0.1xx-preview3",
"channel": "8.0.1xx-preview4",
"quality": "daily",
"qualityFallback": "preview",
"packageVersionPattern": "8.0.0-preview.3",
"packageVersionPattern": "8.0.0-preview.4",
"sdkImageVersion": "8.0.100",
"nextChannel": "8.0.1xx-preview3",
"nextChannel": "8.0.1xx-preview4",
"azureFeed": "",
"sdkImageOverride": ""
},
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "8.0.100-preview.3.23178.7"
"version": "8.0.100-preview.4.23260.5"
}
}
2 changes: 1 addition & 1 deletion nuget.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration>
<packageSources>
<clear />
<add key="dotnet" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/8.0.100-preview.2.23157.25-shipping/nuget/v2" />
<add key="dotnet" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v2" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
<disabledPackageSources>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ namespace Microsoft.Management.UI.Internal
/// Base proxy class for other classes which wish to have save and restore functionality.
/// </summary>
/// <typeparam name="T">There are no restrictions on T.</typeparam>
[Serializable]
[SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
public abstract class StateDescriptor<T>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ namespace Microsoft.Management.UI.Internal
/// <typeparam name="T">
/// The generic parameter.
/// </typeparam>
[Serializable]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
public abstract class ComparableValueFilterRule<T> : FilterRule where T : IComparable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ namespace Microsoft.Management.UI.Internal
/// <typeparam name="T">
/// The generic parameter.
/// </typeparam>
[Serializable]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
public class DoesNotEqualFilterRule<T> : EqualsFilterRule<T> where T : IComparable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ namespace Microsoft.Management.UI.Internal
/// <typeparam name="T">
/// The generic parameter.
/// </typeparam>
[Serializable]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
public class EqualsFilterRule<T> : SingleValueComparableValueFilterRule<T> where T : IComparable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ namespace Microsoft.Management.UI.Internal
/// <summary>
/// The base class for all filtering rules.
/// </summary>
[Serializable]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
public abstract class FilterRule : IEvaluate
{
Expand Down Expand Up @@ -39,11 +38,6 @@ public string DisplayName
/// </summary>
protected FilterRule()
{
// HACK : Is there a way to statically enforce this? No... not ISerializable...
if (!this.GetType().IsSerializable)
{
throw new InvalidOperationException("FilterRules must be serializable.");
}
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,7 @@ public static class FilterRuleExtensions
/// </returns>
public static FilterRule DeepCopy(this FilterRule rule)
{
ArgumentNullException.ThrowIfNull(rule);

Debug.Assert(rule.GetType().IsSerializable, "rule is serializable");

BinaryFormatter formatter = new BinaryFormatter(null, new StreamingContext(StreamingContextStates.Clone));
MemoryStream ms = new MemoryStream();

FilterRule copy = null;
try
{
#pragma warning disable SYSLIB0011
formatter.Serialize(ms, rule);
#pragma warning restore SYSLIB0011

ms.Position = 0;
#pragma warning disable SYSLIB0011
copy = (FilterRule)formatter.Deserialize(ms);
#pragma warning restore SYSLIB0011
}
finally
{
ms.Close();
}

return copy;
throw new NotSupportedException();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace Microsoft.Management.UI.Internal
/// <typeparam name="T">
/// The generic parameter.
/// </typeparam>
[Serializable]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
public class IsBetweenFilterRule<T> : ComparableValueFilterRule<T> where T : IComparable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ namespace Microsoft.Management.UI.Internal
/// The IsEmptyFilterRule evaluates an item to determine whether it
/// is empty or not.
/// </summary>
[Serializable]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
public class IsEmptyFilterRule : FilterRule
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ namespace Microsoft.Management.UI.Internal
/// <typeparam name="T">
/// The generic parameter.
/// </typeparam>
[Serializable]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
public class IsGreaterThanFilterRule<T> : SingleValueComparableValueFilterRule<T> where T : IComparable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ namespace Microsoft.Management.UI.Internal
/// <typeparam name="T">
/// The generic parameter.
/// </typeparam>
[Serializable]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
public class IsLessThanFilterRule<T> : SingleValueComparableValueFilterRule<T> where T : IComparable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ namespace Microsoft.Management.UI.Internal
/// The IsNotEmptyFilterRule evaluates an item to determine whether it
/// is empty or not.
/// </summary>
[Serializable]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
public class IsNotEmptyFilterRule : IsEmptyFilterRule
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ namespace Microsoft.Management.UI.Internal
/// <summary>
/// The IsNotEmptyValidationRule checks a value to see if a value is not empty.
/// </summary>
[Serializable]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
public class IsNotEmptyValidationRule : DataErrorInfoValidationRule
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ namespace Microsoft.Management.UI.Internal
/// <summary>
/// Represents a filter rule that searches for text within properties on an object.
/// </summary>
[Serializable]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
public class PropertiesTextContainsFilterRule : TextFilterRule
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace Microsoft.Management.UI.Internal
/// <typeparam name="T">
/// The generic parameter.
/// </typeparam>
[Serializable]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
public class PropertyValueSelectorFilterRule<T> : SelectorFilterRule where T : IComparable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ namespace Microsoft.Management.UI.Internal
/// <summary>
/// The SelectorFilterRule represents a rule composed of other rules.
/// </summary>
[Serializable]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
public class SelectorFilterRule : FilterRule
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ namespace Microsoft.Management.UI.Internal
/// that take a single input and evaluate against IComparable values.
/// </summary>
/// <typeparam name="T">The generic parameter.</typeparam>
[Serializable]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
public abstract class SingleValueComparableValueFilterRule<T> : ComparableValueFilterRule<T> where T : IComparable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace Microsoft.Management.UI.Internal
/// The TextContainsFilterRule class evaluates a string item to
/// check if it is contains the rule's value within it.
/// </summary>
[Serializable]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
public class TextContainsFilterRule : TextFilterRule
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ namespace Microsoft.Management.UI.Internal
/// The TextDoesNotContainFilterRule class evaluates a string item to
/// check if it is does not contain the rule's value within it.
/// </summary>
[Serializable]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
public class TextDoesNotContainFilterRule : TextContainsFilterRule
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ namespace Microsoft.Management.UI.Internal
/// The TextDoesNotEqualFilterRule class evaluates a string item to
/// check if it is not equal to the rule's value.
/// </summary>
[Serializable]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
public class TextDoesNotEqualFilterRule : TextEqualsFilterRule
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace Microsoft.Management.UI.Internal
/// The TextEndsWithFilterRule class evaluates a string item to
/// check if it ends with the rule's value.
/// </summary>
[Serializable]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
public class TextEndsWithFilterRule : TextFilterRule
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace Microsoft.Management.UI.Internal
/// The TextEqualsFilterRule class evaluates a string item to
/// check if it is equal to the rule's value.
/// </summary>
[Serializable]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
public class TextEqualsFilterRule : TextFilterRule
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ namespace Microsoft.Management.UI.Internal
/// The TextFilterRule class supports derived rules by offering services for
/// evaluating string operations.
/// </summary>
[Serializable]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
public abstract class TextFilterRule : SingleValueComparableValueFilterRule<string>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace Microsoft.Management.UI.Internal
/// The TextStartsWithFilterRule class evaluates a string item to
/// check if it starts with the rule's value.
/// </summary>
[Serializable]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
public class TextStartsWithFilterRule : TextFilterRule
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ namespace Microsoft.Management.UI.Internal
/// <typeparam name="T">
/// The generic parameter.
/// </typeparam>
[Serializable]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
public class ValidatingSelectorValue<T> : ValidatingValueBase
{
Expand Down Expand Up @@ -131,11 +130,6 @@ public IValueConverter DisplayNameConverter

set
{
if (value != null && !value.GetType().IsSerializable)
{
throw new ArgumentException("The DisplayNameConverter must be serializable.", "value");
}

this.displayNameConverter = value;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ namespace Microsoft.Management.UI.Internal
/// <typeparam name="T">
/// The generic parameter.
/// </typeparam>
[Serializable]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
public class ValidatingValue<T> : ValidatingValueBase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace Microsoft.Management.UI.Internal
/// The ValidatingValueBase class provides basic services for base
/// classes to support validation via the IDataErrorInfo interface.
/// </summary>
[Serializable]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
public abstract class ValidatingValueBase : IDataErrorInfo, INotifyPropertyChanged
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ namespace Microsoft.Management.UI.Internal
/// <summary>
/// Provides a way to create a custom rule in order to check the validity of user input.
/// </summary>
[Serializable]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
public abstract class DataErrorInfoValidationRule
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ namespace Microsoft.Management.UI.Internal
/// The FilterRuleToDisplayNameConverter is responsible for converting
/// a FilterRule value to its DisplayName.
/// </summary>
[Serializable]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
public class FilterRuleToDisplayNameConverter : IValueConverter
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace Microsoft.Management.UI.Internal
/// <summary>
/// Allows the state of the ManagementList to be saved and restored.
/// </summary>
[Serializable]
[SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
public class ManagementListStateDescriptor : StateDescriptor<ManagementList>
{
Expand Down Expand Up @@ -465,7 +464,6 @@ private static void SetColumnWidth(GridViewColumn ilc, double width)

#region Helper Classes

[Serializable]
internal class ColumnStateDescriptor
{
private int index;
Expand Down Expand Up @@ -510,7 +508,6 @@ public double Width
}
}

[Serializable]
internal class RuleStateDescriptor
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<ItemGroup>
<ProjectReference Include="..\System.Management.Automation\System.Management.Automation.csproj" />
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="8.0.0-preview.3.23174.8" />
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="8.0.0-preview.4.23259.5" />
</ItemGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

<ItemGroup>
<!-- the following package(s) are from https://github.com/dotnet/corefx -->
<PackageReference Include="System.ServiceProcess.ServiceController" Version="8.0.0-preview.3.23174.8" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="8.0.0-preview.4.23259.5" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace Microsoft.PowerShell.Cmdletization.Cim
/// <summary>
/// Represents an error during execution of a CIM job.
/// </summary>
[Serializable]
public class CimJobException : SystemException, IContainsErrorRecord
{
#region Standard constructors and methods required for all exceptions
Expand Down Expand Up @@ -50,26 +49,12 @@ public CimJobException(string message, Exception inner) : base(message, inner)
/// </summary>
/// <param name="info">The <see cref="SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param>
[Obsolete("Legacy serialization support is deprecated since .NET 8", DiagnosticId = "SYSLIB0051")]
protected CimJobException(
SerializationInfo info,
StreamingContext context) : base(info, context)
StreamingContext context)
{
ArgumentNullException.ThrowIfNull(info);

_errorRecord = (ErrorRecord)info.GetValue("errorRecord", typeof(ErrorRecord));
}

/// <summary>
/// Sets the SerializationInfo with information about the exception.
/// </summary>
/// <param name="info">The <see cref="SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param>
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
ArgumentNullException.ThrowIfNull(info);

base.GetObjectData(info, context);
info.AddValue("errorRecord", _errorRecord);
throw new NotSupportedException();
}

#endregion
Expand Down
Loading