Skip to content

Update NuGet packages and Windows SDK props #1047

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</Choose>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.146" PrivateAssets="All" />
<PackageReference Include="Nerdbank.GitVersioning" Version="3.7.115" PrivateAssets="All" IsImplicitlyReferenced="true" />
</ItemGroup>

<Choose>
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "9.0.100",
"version": "9.0.102",
"rollForward": "latestFeature",
"allowPrerelease": false
}
Expand Down
4 changes: 2 additions & 2 deletions src/CommunityToolkit.HighPerformance/Buffers/StringPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ public FixedSizePriorityMap(int capacity)
/// <summary>
/// Gets an <see cref="object"/> that can be used to synchronize access to the current instance.
/// </summary>
public object SyncRoot
public readonly object SyncRoot
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => this.buckets;
Expand Down Expand Up @@ -749,7 +749,7 @@ private void UpdateTimestamp(ref int heapIndex)
/// a given number of nodes, those are all contiguous from the start of the array.
/// </summary>
[MethodImpl(MethodImplOptions.NoInlining)]
private void UpdateAllTimestamps()
private readonly void UpdateAllTimestamps()
{
int count = this.count;
ref HeapEntry heapEntriesRef = ref this.heapEntries.DangerousGetReference();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ private void Add(int value)
/// Gets the resulting hashcode from the current instance.
/// </summary>
/// <returns>The resulting hashcode from the current instance.</returns>
public int ToHashCode()
public readonly int ToHashCode()
{
uint length = this.length;
uint position = length % 4;
Expand Down Expand Up @@ -165,12 +165,12 @@ public int ToHashCode()
/// <inheritdoc/>
[Obsolete("HashCode is a mutable struct and should not be compared with other HashCodes. Use ToHashCode to retrieve the computed hash code.", error: true)]
[EditorBrowsable(EditorBrowsableState.Never)]
public override int GetHashCode() => throw new NotSupportedException();
public override readonly int GetHashCode() => throw new NotSupportedException();

/// <inheritdoc/>
[Obsolete("HashCode is a mutable struct and should not be compared with other HashCodes.", error: true)]
[EditorBrowsable(EditorBrowsableState.Never)]
public override bool Equals(object? obj) => throw new NotSupportedException();
public override readonly bool Equals(object? obj) => throw new NotSupportedException();

/// <summary>
/// Rotates the specified value left by the specified number of bits.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
- The recommended Windows SDK package for UWP projects using the .NET 9 SDK (with UWP XAML projections).
- The recommended Windows SDK package for WindowsAppSDK projects (ie. without UWP XAML projections).
-->
<_MvvmToolkitWindowsSdkPackageMinBuild>38</_MvvmToolkitWindowsSdkPackageMinBuild>
<_MvvmToolkitWindowsSdkPackageRecommendedUwpBuild>54</_MvvmToolkitWindowsSdkPackageRecommendedUwpBuild>
<_MvvmToolkitWindowsSdkPackageRecommendedWindowsAppSDKBuild>53</_MvvmToolkitWindowsSdkPackageRecommendedWindowsAppSDKBuild>
<_MvvmToolkitWindowsSdkPackageMinBuild>56</_MvvmToolkitWindowsSdkPackageMinBuild>
<_MvvmToolkitWindowsSdkPackageRecommendedUwpBuild>57</_MvvmToolkitWindowsSdkPackageRecommendedUwpBuild>
<_MvvmToolkitWindowsSdkPackageRecommendedWindowsAppSDKBuild>56</_MvvmToolkitWindowsSdkPackageRecommendedWindowsAppSDKBuild>

<!-- Switch on the recommended one based on configuration -->
<_MvvmToolkitWindowsSdkPackageRecommendedBuild>$(_MvvmToolkitWindowsSdkPackageMinBuild)</_MvvmToolkitWindowsSdkPackageRecommendedBuild>
Expand Down Expand Up @@ -82,7 +82,7 @@
Condition="'@(_MvvmToolkitCompatibleWindowsSdkPackages)' == ''"
Code="MVVMTKCFG0003"
HelpLink="https://aka.ms/mvvmtoolkit/errors/mvvmtkcfg0003"
Text="This version of the MVVM Toolkit requires 'Microsoft.Windows.SDK.NET.Ref' version '$(_MvvmToolkitWindowsSdkPackageRequired)' or later. Please update to .NET SDK 8.0.109, 8.0.305 or 8.0.402 (or later). Alternatively, use a temporary 'Microsoft.Windows.SDK.NET.Ref' reference, which can be done by setting the 'WindowsSdkPackageVersion' property in your .csproj file. For your project configuration, it is recommended to set the package version to '$(_MvvmToolkitWindowsSdkPackageRecommended)'." />
Text="This version of the MVVM Toolkit requires 'Microsoft.Windows.SDK.NET.Ref' version '$(_MvvmToolkitWindowsSdkPackageRequired)' or later. Please update the .NET SDK in use to 8.0.405 (or later) or 9.0.102 (or later). Alternatively, use a temporary 'Microsoft.Windows.SDK.NET.Ref' reference, which can be done by setting the 'WindowsSdkPackageVersion' property in your .csproj file. For your project configuration, it is recommended to set the package version to '$(_MvvmToolkitWindowsSdkPackageRecommended)'." />
</Target>

</Project>
6 changes: 3 additions & 3 deletions src/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
because we need the source generators in CsWinRT to generate the supporting interop code for AOT).
-->
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0-windows10.0.17763.0'))">
<WindowsSdkPackageVersion>10.0.17763.53</WindowsSdkPackageVersion>
<WindowsSdkPackageVersion>10.0.17763.56</WindowsSdkPackageVersion>

<!--
We're only referencing CsWinRT for the source generators, we don't need to read any WinRT metadata.
Expand Down Expand Up @@ -42,7 +42,7 @@

<!-- .NET Standard 2.0 doesn't have the Span<T> and IAsyncEnumerable<T> types -->
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.1" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Memory" Version="4.6.0" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.0" />
Expand All @@ -61,7 +61,7 @@

<!-- Reference CsWinRT when targeting Windows, to get the latest source generators -->
<ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0-windows10.0.17763.0'))">
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.1.6" PrivateAssets="all" />
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.2.0" PrivateAssets="all" />
</ItemGroup>

<!-- Reference the various multi-targeted versions of the source generator project (one per Roslyn version), and the code fixer -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@
// See the LICENSE file in the project root for more information.

using System;

// This file has two types which implement interfaces that can be projected to WInRT, ie.
// 'Observable<TMessage>.Recipient' and 'Observable<TMessage, TToken>.Recipient', which
// implement 'IDisposable' (which is projected to 'IClosable'). These types are not meant
// to be used in interop scenarios (including in eg. bindings), as they're only meant to
// be used by code behind interacting with System.Reactive APIs. As such, we skip marking
// them partial, as we don't need CCW vtables to be generated for them.
#pragma warning disable CsWinRT1028
#if NET8_0_OR_GREATER && WINDOWS
using WinRT;
#endif

namespace CommunityToolkit.Mvvm.Messaging;

Expand Down Expand Up @@ -81,6 +76,9 @@ public IDisposable Subscribe(IObserver<TMessage> observer)
/// <summary>
/// An <see cref="IRecipient{TMessage}"/> implementation for <see cref="Observable{TMessage}"/>.
/// </summary>
#if NET8_0_OR_GREATER && WINDOWS
[WinRTExposedType(typeof(WinRTManagedOnlyTypeDetails))]
#endif
private sealed class Recipient : IRecipient<TMessage>, IDisposable
{
/// <summary>
Expand Down Expand Up @@ -159,6 +157,9 @@ public IDisposable Subscribe(IObserver<TMessage> observer)
/// <summary>
/// An <see cref="IRecipient{TMessage}"/> implementation for <see cref="Observable{TMessage, TToken}"/>.
/// </summary>
#if NET8_0_OR_GREATER && WINDOWS
[WinRTExposedType(typeof(WinRTManagedOnlyTypeDetails))]
#endif
private sealed class Recipient : IRecipient<TMessage>, IDisposable
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static ArrayPoolBufferWriter<T> Create()
/// <summary>
/// Gets a <see cref="ReadOnlySpan{T}"/> with the current items.
/// </summary>
public ReadOnlySpan<T> Span
public readonly ReadOnlySpan<T> Span
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => this.span.Slice(0, this.index);
Expand Down Expand Up @@ -116,7 +116,7 @@ private void ResizeBufferAndAdd(T item)
}

/// <inheritdoc cref="IDisposable.Dispose"/>
public void Dispose()
public readonly void Dispose()
{
Array.Clear(this.array, 0, this.index);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ public bool MoveNext()
/// Gets the current key.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public TKey GetKey()
public readonly TKey GetKey()
{
return this.entries[this.index - 1].Key;
}
Expand All @@ -329,7 +329,7 @@ public TKey GetKey()
/// Gets the current value.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public TValue GetValue()
public readonly TValue GetValue()
{
return this.entries[this.index - 1].Value!;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ public Enumerator(ConditionalWeakTable2<TKey, TValue> owner)
}

/// <inheritdoc cref="IDisposable.Dispose"/>
public void Dispose()
public readonly void Dispose()
{
this.enumerator.Dispose();
}

/// <inheritdoc cref="Collections.IEnumerator.MoveNext"/>
public bool MoveNext()
public readonly bool MoveNext()
{
return this.enumerator.MoveNext();
}
Expand All @@ -87,7 +87,7 @@ public bool MoveNext()
/// Gets the current key.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public TKey GetKey()
public readonly TKey GetKey()
{
return this.enumerator.Current.Key;
}
Expand All @@ -96,7 +96,7 @@ public TKey GetKey()
/// Gets the current value.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public TValue GetValue()
public readonly TValue GetValue()
{
return this.enumerator.Current.Value;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public bool MoveNext()
/// Gets the current key.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public TKey GetKey()
public readonly TKey GetKey()
{
return this.key!;
}
Expand All @@ -257,7 +257,7 @@ public TKey GetKey()
/// Gets the current value.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public TValue GetValue()
public readonly TValue GetValue()
{
return this.value!;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public Enumerator(ConditionalWeakTable2<TKey, TValue> owner)
}

/// <inheritdoc cref="IDisposable.Dispose"/>
public void Dispose()
public readonly void Dispose()
{
}

Expand Down Expand Up @@ -189,7 +189,7 @@ public bool MoveNext()
/// Gets the current key.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public TKey GetKey()
public readonly TKey GetKey()
{
return this.key!;
}
Expand All @@ -198,7 +198,7 @@ public TKey GetKey()
/// Gets the current value.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public TValue GetValue()
public readonly TValue GetValue()
{
return this.value!;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MSTest.TestAdapter" Version="3.6.4" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.4" />
<PackageReference Include="MSTest.TestAdapter" Version="3.7.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.7.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MSTest.TestAdapter" Version="3.6.4" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.4" />
<PackageReference Include="MSTest.TestAdapter" Version="3.7.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.7.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MSTest.TestAdapter" Version="3.6.4" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.4" />
<PackageReference Include="MSTest.TestAdapter" Version="3.7.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.7.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ internal struct TestStruct : IEquatable<TestStruct>
public string Text;

/// <inheritdoc/>
public bool Equals(TestStruct other)
public readonly bool Equals(TestStruct other)
{
return
this.Number == other.Number &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ internal struct TestStruct : IEquatable<TestStruct>
public string Text;

/// <inheritdoc/>
public bool Equals(TestStruct other)
public readonly bool Equals(TestStruct other)
{
return
this.Number == other.Number &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MSTest.TestAdapter" Version="3.6.4" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.4" />
<PackageReference Include="MSTest.TestAdapter" Version="3.7.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.7.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MSTest.TestAdapter" Version="3.6.4" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.4" />
<PackageReference Include="MSTest.TestAdapter" Version="3.7.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.7.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

<ItemGroup>
<PackageReference Include="Dbs.Signed3.Nito.AsyncEx.Context" Version="5.0.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.4" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.4" />
<PackageReference Include="MSTest.TestAdapter" Version="3.7.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.7.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="System.Reactive" Version="6.0.1" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
<PackageReference Include="System.Text.Json" Version="9.0.1" />
</ItemGroup>

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

<ItemGroup>
<PackageReference Include="Dbs.Signed3.Nito.AsyncEx.Context" Version="5.0.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.4" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.4" />
<PackageReference Include="MSTest.TestAdapter" Version="3.7.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.7.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="System.Reactive" Version="6.0.1" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
<PackageReference Include="System.Text.Json" Version="9.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@

<ItemGroup>
<PackageReference Include="Dbs.Signed3.Nito.AsyncEx.Context" Version="5.0.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.4" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.4" />
<PackageReference Include="MSTest.TestAdapter" Version="3.7.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.7.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="System.Reactive" Version="6.0.1" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
<PackageReference Include="System.Text.Json" Version="9.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing" Version="1.1.2" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.4" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.4" />
<PackageReference Include="MSTest.TestAdapter" Version="3.7.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.7.3" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading
Loading