Browse Source

Merge pull request #1882 from dotnet/tooling/vs2022-net70sdk

Upgrade to supported TFMs and SDK versions
Ian Griffiths 2 years ago
parent
commit
843927d344
24 changed files with 109 additions and 149 deletions
  1. 3 3
      Rx.NET/Integration/LinuxTests/LinuxTests.csproj
  2. 3 8
      Rx.NET/Integration/WindowsDesktopTests/WindowsDesktopTests.csproj
  3. 4 0
      Rx.NET/Source/Directory.build.props
  4. 4 12
      Rx.NET/Source/Directory.build.targets
  5. 1 1
      Rx.NET/Source/facades/System.Reactive.Core/System.Reactive.Core.csproj
  6. 1 1
      Rx.NET/Source/facades/System.Reactive.Interfaces/System.Reactive.Interfaces.csproj
  7. 1 1
      Rx.NET/Source/facades/System.Reactive.Linq/System.Reactive.Linq.csproj
  8. 1 1
      Rx.NET/Source/facades/System.Reactive.PlatformServices/System.Reactive.PlatformServices.csproj
  9. 1 1
      Rx.NET/Source/facades/System.Reactive.Providers/System.Reactive.Providers.csproj
  10. 1 1
      Rx.NET/Source/facades/System.Reactive.Windows.Threading/System.Reactive.Windows.Threading.csproj
  11. 1 1
      Rx.NET/Source/facades/System.Reactive.WindowsRuntime/System.Reactive.WindowsRuntime.csproj
  12. 1 1
      Rx.NET/Source/src/Microsoft.Reactive.Testing/Microsoft.Reactive.Testing.csproj
  13. 1 1
      Rx.NET/Source/src/System.Reactive.Observable.Aliases/System.Reactive.Observable.Aliases.csproj
  14. 39 8
      Rx.NET/Source/src/System.Reactive/Internal/ReflectionUtils.cs
  15. 0 10
      Rx.NET/Source/src/System.Reactive/Linq/Observable/FromEventPattern.cs
  16. 8 49
      Rx.NET/Source/src/System.Reactive/System.Reactive.csproj
  17. 1 1
      Rx.NET/Source/src/System.Reactive/build/System.Reactive.net6.0-windows.targets
  18. 0 12
      Rx.NET/Source/src/System.Reactive/build/System.Reactive.targets
  19. 2 2
      Rx.NET/Source/tests/Tests.System.Reactive.Uwp.DeviceRunner/Package.appxmanifest
  20. 22 7
      Rx.NET/Source/tests/Tests.System.Reactive.Uwp.DeviceRunner/Tests.System.Reactive.Uwp.DeviceRunner.csproj
  21. BIN
      Rx.NET/Source/tests/Tests.System.Reactive.Uwp.DeviceRunner/Tests.System.Reactive.Uwp.DeviceRunner_TemporaryKey.pfx
  22. 1 1
      Rx.NET/Source/tests/Tests.System.Reactive/DispatcherHelpers.cs
  23. 2 2
      Rx.NET/Source/tests/Tests.System.Reactive/Tests.System.Reactive.csproj
  24. 11 25
      azure-pipelines.rx.yml

+ 3 - 3
Rx.NET/Integration/LinuxTests/LinuxTests.csproj

@@ -1,6 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk">
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
   <PropertyGroup>
-    <TargetFrameworks>netcoreapp3.1;netcoreapp2.1;net5.0</TargetFrameworks>
+    <TargetFrameworks>net6.0;net7.0</TargetFrameworks>
     <NoWarn>$(NoWarn);CS0618</NoWarn>
     <NoWarn>$(NoWarn);CS0618</NoWarn>
     <LangVersion>latest</LangVersion>
     <LangVersion>latest</LangVersion>
     <AssemblyName>Tests.System.Reactive</AssemblyName>
     <AssemblyName>Tests.System.Reactive</AssemblyName>
@@ -9,10 +9,10 @@
     <AssemblyOriginatorKeyFile>..\..\Source\ReactiveX.snk</AssemblyOriginatorKeyFile>
     <AssemblyOriginatorKeyFile>..\..\Source\ReactiveX.snk</AssemblyOriginatorKeyFile>
   </PropertyGroup>
   </PropertyGroup>
   
   
-  <PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netcoreapp2.1'">
+  <PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
     <DefineConstants>$(DefineConstants);</DefineConstants>
     <DefineConstants>$(DefineConstants);</DefineConstants>
   </PropertyGroup>
   </PropertyGroup>
-  <PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1' or '$(TargetFramework)' == 'net5.0' ">
+  <PropertyGroup Condition="'$(TargetFramework)' == 'net6.0' or '$(TargetFramework)' == 'net7.0' ">
     <DefineConstants>$(DefineConstants);LINUX</DefineConstants>
     <DefineConstants>$(DefineConstants);LINUX</DefineConstants>
   </PropertyGroup>
   </PropertyGroup>
 
 

+ 3 - 8
Rx.NET/Integration/WindowsDesktopTests/WindowsDesktopTests.csproj

@@ -1,6 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk">
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
   <PropertyGroup>
-    <TargetFrameworks>net5.0;net5.0-windows10.0.19041</TargetFrameworks>
+    <TargetFrameworks>net6.0;net6.0-windows10.0.19041;net7.0;net7.0-windows10.0.19041</TargetFrameworks>
     <NoWarn>$(NoWarn);CS0618</NoWarn>
     <NoWarn>$(NoWarn);CS0618</NoWarn>
     <LangVersion>latest</LangVersion>
     <LangVersion>latest</LangVersion>
     <AssemblyName>Tests.System.Reactive</AssemblyName>
     <AssemblyName>Tests.System.Reactive</AssemblyName>
@@ -9,13 +9,8 @@
     <AssemblyOriginatorKeyFile>..\..\Source\ReactiveX.snk</AssemblyOriginatorKeyFile>
     <AssemblyOriginatorKeyFile>..\..\Source\ReactiveX.snk</AssemblyOriginatorKeyFile>
   </PropertyGroup>
   </PropertyGroup>
 
 
-  <PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
-    <UseWPF >true</UseWPF>
-    <UseWindowsForms>true</UseWindowsForms>
-    <DefineConstants>$(DefineConstants);HAS_WINRT;HAS_WINFORMS;HAS_WPF;HAS_DISPATCHER;DESKTOPCLR</DefineConstants>
-  </PropertyGroup>
-  <PropertyGroup Condition="$(TargetFramework.StartsWith('net5.0-windows'))">
-    <UseWPF >true</UseWPF>
+  <PropertyGroup Condition="$(TargetFramework.StartsWith('net6.0-windows')) or $(TargetFramework.StartsWith('net7.0-windows'))">
+    <UseWPF>true</UseWPF>
     <UseWindowsForms>true</UseWindowsForms>
     <UseWindowsForms>true</UseWindowsForms>
     <DefineConstants>$(DefineConstants);HAS_TRACE;HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING;HAS_WINFORMS;HAS_WPF;HAS_DISPATCHER;DESKTOPCLR;WINDOWS;CSWINRT</DefineConstants>
     <DefineConstants>$(DefineConstants);HAS_TRACE;HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING;HAS_WINFORMS;HAS_WPF;HAS_DISPATCHER;DESKTOPCLR;WINDOWS;CSWINRT</DefineConstants>
   </PropertyGroup>
   </PropertyGroup>

+ 4 - 0
Rx.NET/Source/Directory.build.props

@@ -20,6 +20,10 @@
     <EmbedUntrackedSources>true</EmbedUntrackedSources>
     <EmbedUntrackedSources>true</EmbedUntrackedSources>
     <PublishRepositoryUrl>true</PublishRepositoryUrl>
     <PublishRepositoryUrl>true</PublishRepositoryUrl>
     <LangVersion>latest</LangVersion>
     <LangVersion>latest</LangVersion>
+
+    <!-- Get diagnostics back to the level that the .NET 5.0 SDK had for now. Fix these properly before release. -->
+    <AnalysisLevel>5-Default</AnalysisLevel>
+    <NoWarn>$(NoWarn);CS8600;CS8602;CS8603;CS8604;CS8632;CA1000;CA1003;CA1014;CA1019;CA1033;CA1045;CA1051;CA1052;CA1063;CA1067;CA1068;CA1507;CA1707;CA1711;CA1716;CA1720;CA1806;CA1815;CA1816;CA1822;CA1825;CA1840;CA1845;CA2016;CA2109;CA2201;CA2211;CA2213;CA2249;IDE0003;IDE0016;IDE0017;IDE0018;IDE0019;IDE0020;IDE0031;IDE0032;IDE0034;IDE0037;IDE0038;IDE0039;IDE0040;IDE0044;IDE0051;IDE0052;IDE0056;IDE0057;IDE0059;IDE0060;IDE0062;IDE0063;IDE0071;IDE0074;IDE0075;IDE0076;IDE0077;IDE0079;IDE0083;IDE0090;IDE0180;IDE0270;IDE0280;IDE1006;IDE1056</NoWarn>
   </PropertyGroup>
   </PropertyGroup>
 
 
   <PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
   <PropertyGroup Condition="'$(TF_BUILD)' == 'true'">

+ 4 - 12
Rx.NET/Source/Directory.build.targets

@@ -9,26 +9,18 @@
   <PropertyGroup Condition="'$(TargetFramework)' == 'net472'">
   <PropertyGroup Condition="'$(TargetFramework)' == 'net472'">
     <DefineConstants>$(DefineConstants);HAS_WINFORMS;HAS_WPF;HAS_WINRT;HAS_DISPATCHER;HAS_REMOTING;DESKTOPCLR;NO_NULLABLE_ATTRIBUTES</DefineConstants>
     <DefineConstants>$(DefineConstants);HAS_WINFORMS;HAS_WPF;HAS_WINRT;HAS_DISPATCHER;HAS_REMOTING;DESKTOPCLR;NO_NULLABLE_ATTRIBUTES</DefineConstants>
   </PropertyGroup>
   </PropertyGroup>
-  <PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0'">
-    <TargetPlatformVersion>10.0.19041.0</TargetPlatformVersion>
-    <TargetPlatformMinVersion>10.0.15063.0</TargetPlatformMinVersion>
-    <DefineConstants>$(DefineConstants);HAS_WINRT;NO_CODE_COVERAGE_ATTRIBUTE;NO_SERIALIZABLE;CRIPPLED_REFLECTION;NO_THREAD;NO_TRACE;WINDOWS;NO_NULLABLE_ATTRIBUTES</DefineConstants>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0.16299'">
+  <PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0.18362'">
     <DefineConstants>$(DefineConstants);HAS_WINRT;WINDOWS;HAS_OS_XAML;LEGACY_WINRT;NO_NULLABLE_ATTRIBUTES</DefineConstants>
     <DefineConstants>$(DefineConstants);HAS_WINRT;WINDOWS;HAS_OS_XAML;LEGACY_WINRT;NO_NULLABLE_ATTRIBUTES</DefineConstants>
     <TargetPlatformVersion>10.0.19041.0</TargetPlatformVersion>
     <TargetPlatformVersion>10.0.19041.0</TargetPlatformVersion>
   </PropertyGroup>
   </PropertyGroup>
-  <PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netcoreapp2.1'">
+  <PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
     <DefineConstants>$(DefineConstants);HAS_WINRT;NO_NULLABLE_ATTRIBUTES</DefineConstants>
     <DefineConstants>$(DefineConstants);HAS_WINRT;NO_NULLABLE_ATTRIBUTES</DefineConstants>
   </PropertyGroup>
   </PropertyGroup>
-  <PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
-    <DefineConstants>$(DefineConstants);HAS_WINRT;HAS_WINFORMS;HAS_WPF;HAS_DISPATCHER;DESKTOPCLR</DefineConstants>
-  </PropertyGroup>
-  <PropertyGroup Condition="$(TargetFramework.StartsWith('net5.0-windows'))">
+  <PropertyGroup Condition="$(TargetFramework.StartsWith('net6.0-windows')) or $(TargetFramework.StartsWith('net7.0-windows'))">
     <DefineConstants>$(DefineConstants);HAS_WINRT;HAS_WINFORMS;HAS_WPF;HAS_DISPATCHER;DESKTOPCLR;WINDOWS;CSWINRT</DefineConstants>
     <DefineConstants>$(DefineConstants);HAS_WINRT;HAS_WINFORMS;HAS_WPF;HAS_DISPATCHER;DESKTOPCLR;WINDOWS;CSWINRT</DefineConstants>
   </PropertyGroup>
   </PropertyGroup>
 
 
-  <ItemGroup Condition="'$(TargetFramework)' == 'net472' or '$(TargetFramework)' == 'uap10.0' or '$(TargetFramework)' == 'uap10.0.16299' or '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netcoreapp2.1'">
+  <ItemGroup Condition="'$(TargetFramework)' == 'net472' or '$(TargetFramework)' == 'uap10.0.18362' or '$(TargetFramework)' == 'netstandard2.0'">
     <PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
     <PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
   </ItemGroup>
   </ItemGroup>
 
 

+ 1 - 1
Rx.NET/Source/facades/System.Reactive.Core/System.Reactive.Core.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="MSBuild.Sdk.Extras">
 <Project Sdk="MSBuild.Sdk.Extras">
 
 
   <PropertyGroup>
   <PropertyGroup>
-    <TargetFrameworks>net472;netstandard2.0;uap10.0.16299</TargetFrameworks>
+    <TargetFrameworks>net472;netstandard2.0;uap10.0.18362</TargetFrameworks>
   </PropertyGroup>
   </PropertyGroup>
 
 
   <ItemGroup>
   <ItemGroup>

+ 1 - 1
Rx.NET/Source/facades/System.Reactive.Interfaces/System.Reactive.Interfaces.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="MSBuild.Sdk.Extras">
 <Project Sdk="MSBuild.Sdk.Extras">
 
 
   <PropertyGroup>
   <PropertyGroup>
-    <TargetFrameworks>net472;netstandard2.0;uap10.0.16299</TargetFrameworks>
+    <TargetFrameworks>net472;netstandard2.0;uap10.0.18362</TargetFrameworks>
   </PropertyGroup>
   </PropertyGroup>
 
 
   <ItemGroup>
   <ItemGroup>

+ 1 - 1
Rx.NET/Source/facades/System.Reactive.Linq/System.Reactive.Linq.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="MSBuild.Sdk.Extras">
 <Project Sdk="MSBuild.Sdk.Extras">
 
 
   <PropertyGroup>
   <PropertyGroup>
-    <TargetFrameworks>net472;netstandard2.0;uap10.0.16299</TargetFrameworks>
+    <TargetFrameworks>net472;netstandard2.0;uap10.0.18362</TargetFrameworks>
   </PropertyGroup>
   </PropertyGroup>
 
 
   <ItemGroup>
   <ItemGroup>

+ 1 - 1
Rx.NET/Source/facades/System.Reactive.PlatformServices/System.Reactive.PlatformServices.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="MSBuild.Sdk.Extras">
 <Project Sdk="MSBuild.Sdk.Extras">
 
 
   <PropertyGroup>
   <PropertyGroup>
-    <TargetFrameworks>net472;netstandard2.0;uap10.0.16299</TargetFrameworks>
+    <TargetFrameworks>net472;netstandard2.0;uap10.0.18362</TargetFrameworks>
   </PropertyGroup>
   </PropertyGroup>
 
 
   <ItemGroup>
   <ItemGroup>

+ 1 - 1
Rx.NET/Source/facades/System.Reactive.Providers/System.Reactive.Providers.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="MSBuild.Sdk.Extras">
 <Project Sdk="MSBuild.Sdk.Extras">
 
 
   <PropertyGroup>
   <PropertyGroup>
-    <TargetFrameworks>net472;netstandard2.0;uap10.0.16299</TargetFrameworks>
+    <TargetFrameworks>net472;netstandard2.0;uap10.0.18362</TargetFrameworks>
   </PropertyGroup>
   </PropertyGroup>
 
 
   <ItemGroup>
   <ItemGroup>

+ 1 - 1
Rx.NET/Source/facades/System.Reactive.Windows.Threading/System.Reactive.Windows.Threading.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="MSBuild.Sdk.Extras">
 <Project Sdk="MSBuild.Sdk.Extras">
 
 
   <PropertyGroup>
   <PropertyGroup>
-    <TargetFrameworks>net472;uap10.0.16299</TargetFrameworks>
+    <TargetFrameworks>net472;uap10.0.18362</TargetFrameworks>
   </PropertyGroup>
   </PropertyGroup>
 
 
   <ItemGroup>
   <ItemGroup>

+ 1 - 1
Rx.NET/Source/facades/System.Reactive.WindowsRuntime/System.Reactive.WindowsRuntime.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="MSBuild.Sdk.Extras">
 <Project Sdk="MSBuild.Sdk.Extras">
 
 
   <PropertyGroup>
   <PropertyGroup>
-    <TargetFramework>uap10.0.16299</TargetFramework>
+    <TargetFramework>uap10.0.18362</TargetFramework>
   </PropertyGroup>
   </PropertyGroup>
 
 
   <ItemGroup>
   <ItemGroup>

+ 1 - 1
Rx.NET/Source/src/Microsoft.Reactive.Testing/Microsoft.Reactive.Testing.csproj

@@ -1,6 +1,6 @@
 <Project Sdk="MSBuild.Sdk.Extras">
 <Project Sdk="MSBuild.Sdk.Extras">
   <PropertyGroup>
   <PropertyGroup>
-    <TargetFrameworks>netcoreapp3.1;net472;uap10.0.16299;netstandard2.0;net5.0</TargetFrameworks>
+    <TargetFrameworks>netstandard2.0;net472;uap10.0.18362;net6.0</TargetFrameworks>
     <CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
     <CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
     <Description>Reactive Extensions Testing Library containing interfaces and classes providing functionality to test applications and libraries built using Reactive Extensions.</Description>    
     <Description>Reactive Extensions Testing Library containing interfaces and classes providing functionality to test applications and libraries built using Reactive Extensions.</Description>    
     <AssemblyTitle>Microsoft.Reactive.Testing - Testing Helper Library</AssemblyTitle>    
     <AssemblyTitle>Microsoft.Reactive.Testing - Testing Helper Library</AssemblyTitle>    

+ 1 - 1
Rx.NET/Source/src/System.Reactive.Observable.Aliases/System.Reactive.Observable.Aliases.csproj

@@ -1,6 +1,6 @@
 <Project Sdk="MSBuild.Sdk.Extras">
 <Project Sdk="MSBuild.Sdk.Extras">
   <PropertyGroup>
   <PropertyGroup>
-    <TargetFrameworks>netstandard2.0;net472;uap10.0.16299;net5.0</TargetFrameworks>    
+    <TargetFrameworks>netstandard2.0;net472;uap10.0.18362;net6.0</TargetFrameworks>
     <Title>Reactive Extensions - Aliases</Title>    
     <Title>Reactive Extensions - Aliases</Title>    
     <CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>    
     <CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>    
     <PackageTags>Rx;Reactive;Extensions;Observable;LINQ;Events</PackageTags>
     <PackageTags>Rx;Reactive;Extensions;Observable;LINQ;Events</PackageTags>

+ 39 - 8
Rx.NET/Source/src/System.Reactive/Internal/ReflectionUtils.cs

@@ -5,10 +5,6 @@
 using System.Globalization;
 using System.Globalization;
 using System.Reflection;
 using System.Reflection;
 
 
-#if HAS_WINRT
-using System.Runtime.InteropServices.WindowsRuntime;
-#endif
-
 namespace System.Reactive
 namespace System.Reactive
 {
 {
     internal static class ReflectionUtils
     internal static class ReflectionUtils
@@ -76,18 +72,16 @@ namespace System.Reactive
 
 
             isWinRT = false;
             isWinRT = false;
 
 
-#if HAS_WINRT && !CSWINRT
-            if (addMethod.ReturnType == typeof(EventRegistrationToken))
+            if (IsWinRTEventRegistrationTokenType(addMethod.ReturnType))
             {
             {
                 isWinRT = true;
                 isWinRT = true;
 
 
                 var pet = psr[0];
                 var pet = psr[0];
-                if (pet.ParameterType != typeof(EventRegistrationToken))
+                if (IsWinRTEventRegistrationTokenType(pet.ParameterType))
                 {
                 {
                     throw new InvalidOperationException(Strings_Linq.EVENT_WINRT_REMOVE_METHOD_SHOULD_TAKE_ERT);
                     throw new InvalidOperationException(Strings_Linq.EVENT_WINRT_REMOVE_METHOD_SHOULD_TAKE_ERT);
                 }
                 }
             }
             }
-#endif
 
 
             delegateType = psa[0].ParameterType;
             delegateType = psa[0].ParameterType;
 
 
@@ -119,5 +113,42 @@ namespace System.Reactive
 #if (CRIPPLED_REFLECTION && HAS_WINRT)
 #if (CRIPPLED_REFLECTION && HAS_WINRT)
         public static MethodInfo GetMethod(this Type type, string name) => type.GetTypeInfo().GetDeclaredMethod(name);
         public static MethodInfo GetMethod(this Type type, string name) => type.GetTypeInfo().GetDeclaredMethod(name);
 #endif
 #endif
+
+        /// <summary>
+        /// Determine whether a type represents a WinRT event registration token
+        /// (https://learn.microsoft.com/en-us/uwp/api/windows.foundation.eventregistrationtoken).
+        /// </summary>
+        /// <param name="t">The type to check.</param>
+        /// <returns>True if this represents a WinRT event registration token</returns>
+        /// <remarks>
+        /// <para>
+        /// We used to perform a simple comparison with typeof(EventRegistrationToken), but the
+        /// introduction of C#/WinRT has made this problematic. Before C#/WinRT, the .NET
+        /// projection of WinRT's Windows.Foundation.EventRegistrationToken type was
+        /// System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken. But that type is
+        /// associated with the old WinRT interop mechanisms in which the CLR works directly with
+        /// WinMD. That was how it worked up as far as .NET Core 3.1, and it's still how .NET
+        /// Framework works, but this direct WinMD support was removed in .NET 5.0.
+        /// </para>
+        /// <para>
+        /// If you're on .NET 5.0 or later, the System.Runtime.InteropServices.WindowsRuntime types
+        /// are no longer supported. While you can still get access to them through the NuGet
+        /// package of the same name (that's how .NET Standard 2.0 libraries are able to use these
+        /// types) they are best avoided, because the types in that library are no longer the types
+        /// you see when any of the WinRT types they are meant to represent are projected into the
+        /// CLR's world.
+        /// </para>
+        /// <para>
+        /// It was therefore necessary for Rx to stop using these types, and to drop its reference
+        /// to the System.Runtime.InteropServices.WindowsRuntime package. We can replicate the
+        /// same logic by looking for the type name. By checking for either the old or new
+        /// namespaces, we can support both the old projection (still used on .NET Framework) and
+        /// also the new C#/WinRT projection.
+        /// </para>
+        /// </remarks>
+        private static bool IsWinRTEventRegistrationTokenType(Type t) =>
+            t.Name == "EventRegistrationToken" &&
+            (t.Namespace == "System.Runtime.InteropServices.WindowsRuntime" ||
+             t.Namespace == "WinRT");
     }
     }
 }
 }

+ 0 - 10
Rx.NET/Source/src/System.Reactive/Linq/Observable/FromEventPattern.cs

@@ -69,18 +69,12 @@ namespace System.Reactive.Linq.ObservableImpl
             private readonly MethodInfo _addMethod;
             private readonly MethodInfo _addMethod;
             private readonly MethodInfo _removeMethod;
             private readonly MethodInfo _removeMethod;
             private readonly Func<TSender, TEventArgs, TResult> _getResult;
             private readonly Func<TSender, TEventArgs, TResult> _getResult;
-#if HAS_WINRT
             private readonly bool _isWinRT;
             private readonly bool _isWinRT;
-#endif
 
 
             public Handler(object? target, Type delegateType, MethodInfo addMethod, MethodInfo removeMethod, Func<TSender, TEventArgs, TResult> getResult, bool isWinRT, IScheduler scheduler)
             public Handler(object? target, Type delegateType, MethodInfo addMethod, MethodInfo removeMethod, Func<TSender, TEventArgs, TResult> getResult, bool isWinRT, IScheduler scheduler)
                 : base(scheduler)
                 : base(scheduler)
             {
             {
-#if HAS_WINRT
                 _isWinRT = isWinRT;
                 _isWinRT = isWinRT;
-#else
-                System.Diagnostics.Debug.Assert(!isWinRT);
-#endif
                 _target = target;
                 _target = target;
                 _delegateType = delegateType;
                 _delegateType = delegateType;
                 _addMethod = addMethod;
                 _addMethod = addMethod;
@@ -100,13 +94,11 @@ namespace System.Reactive.Linq.ObservableImpl
 
 
                 try
                 try
                 {
                 {
-#if HAS_WINRT
                     if (_isWinRT)
                     if (_isWinRT)
                     {
                     {
                         removeHandler = AddHandlerCoreWinRT(handler);
                         removeHandler = AddHandlerCoreWinRT(handler);
                     }
                     }
                     else
                     else
-#endif
                     {
                     {
                         removeHandler = AddHandlerCore(handler);
                         removeHandler = AddHandlerCore(handler);
                     }
                     }
@@ -147,13 +139,11 @@ namespace System.Reactive.Linq.ObservableImpl
                 return () => _removeMethod.Invoke(_target, new object[] { handler });
                 return () => _removeMethod.Invoke(_target, new object[] { handler });
             }
             }
 
 
-#if HAS_WINRT
             private Action AddHandlerCoreWinRT(Delegate handler)
             private Action AddHandlerCoreWinRT(Delegate handler)
             {
             {
                 var token = _addMethod.Invoke(_target, new object[] { handler });
                 var token = _addMethod.Invoke(_target, new object[] { handler });
                 return () => _removeMethod.Invoke(_target, new[] { token });
                 return () => _removeMethod.Invoke(_target, new[] { token });
             }
             }
-#endif
         }
         }
     }
     }
 }
 }

+ 8 - 49
Rx.NET/Source/src/System.Reactive/System.Reactive.csproj

@@ -1,6 +1,6 @@
 <Project Sdk="MSBuild.Sdk.Extras">
 <Project Sdk="MSBuild.Sdk.Extras">
   <PropertyGroup>
   <PropertyGroup>
-    <TargetFrameworks>netcoreapp3.1;netstandard2.0;net472;uap10.0.16299;net5.0;net5.0-windows10.0.19041</TargetFrameworks>
+    <TargetFrameworks>netstandard2.0;net472;uap10.0.18362;net6.0;net6.0-windows10.0.19041</TargetFrameworks>
     <CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
     <CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
     <PackageTags>Rx;Reactive;Extensions;Observable;LINQ;Events</PackageTags>
     <PackageTags>Rx;Reactive;Extensions;Observable;LINQ;Events</PackageTags>
     <Description>Reactive Extensions (Rx) for .NET</Description>
     <Description>Reactive Extensions (Rx) for .NET</Description>
@@ -10,16 +10,11 @@
     <Nullable>enable</Nullable>
     <Nullable>enable</Nullable>
   </PropertyGroup>
   </PropertyGroup>
 
 
-  <PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1' or $(TargetFramework.StartsWith('net5.0-windows'))">
+  <PropertyGroup Condition="$(TargetFramework.StartsWith('net6.0-windows')) or $(TargetFramework.StartsWith('net7.0-windows'))">
     <UseWPF>true</UseWPF>
     <UseWPF>true</UseWPF>
     <UseWindowsForms>true</UseWindowsForms>
     <UseWindowsForms>true</UseWindowsForms>
-    <IncludeBuildOutput Condition="'$(TargetFramework)' == 'netcoreapp3.1'">false</IncludeBuildOutput>
   </PropertyGroup>
   </PropertyGroup>
 
 
-  <ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
-    <FrameworkReference Update="Microsoft.WindowsDesktop.App" PrivateAssets="all" />
-  </ItemGroup>
-
 
 
   <ItemGroup>
   <ItemGroup>
     <Compile Remove="Platforms\**\*.*" />
     <Compile Remove="Platforms\**\*.*" />
@@ -36,23 +31,13 @@
   </ItemGroup>
   </ItemGroup>
 
 
 
 
-  <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
-    <PackageReference Include="System.Runtime.InteropServices.WindowsRuntime" Version="4.3.0" />
-  </ItemGroup>
-
   <!-- UWP -->
   <!-- UWP -->
-  <ItemGroup Condition=" '$(TargetFramework)' == 'uap10.0' ">
-    <PackageReference Include="System.ValueTuple" Version="4.5.0" />
-    <PackageReference Include="System.ComponentModel" Version="4.3.0" />
-    <PackageReference Include="System.Dynamic.Runtime" Version="4.3.0" />
-    <PackageReference Include="System.Linq.Queryable" Version="4.3.0" />
-  </ItemGroup>
-  <ItemGroup Condition=" $(TargetFramework.StartsWith('uap10.0')) or $(TargetFramework.StartsWith('net5.0-windows'))">
+  <ItemGroup Condition=" $(TargetFramework.StartsWith('uap10.0')) or $(TargetFramework.StartsWith('net6.0-windows')) or $(TargetFramework.StartsWith('net7.0-windows'))">
     <Compile Include="Platforms\UWP\**\*.cs" />
     <Compile Include="Platforms\UWP\**\*.cs" />
   </ItemGroup>
   </ItemGroup>
 
 
   <!-- Windows includes for Desktop and UWP -->
   <!-- Windows includes for Desktop and UWP -->
-  <ItemGroup Condition=" '$(TargetFramework)' == 'net472' or $(TargetFramework.StartsWith('uap10.0')) or '$(TargetFramework)' == 'netcoreapp3.1' or $(TargetFramework.StartsWith('net5.0-windows'))">
+  <ItemGroup Condition=" '$(TargetFramework)' == 'net472' or $(TargetFramework.StartsWith('uap10.0')) or $(TargetFramework.StartsWith('net6.0-windows')) or $(TargetFramework.StartsWith('net7.0-windows'))">
     <Compile Include="Platforms\Windows\**\*.cs" />
     <Compile Include="Platforms\Windows\**\*.cs" />
     <EmbeddedResource Include="Platforms\Windows\**\*.resx" />
     <EmbeddedResource Include="Platforms\Windows\**\*.resx" />
   </ItemGroup>
   </ItemGroup>
@@ -64,7 +49,7 @@
     <Reference Include="WindowsBase" />
     <Reference Include="WindowsBase" />
   </ItemGroup>
   </ItemGroup>
 
 
-  <ItemGroup Condition=" '$(TargetFramework)' == 'net472' or '$(TargetFramework)' == 'netcoreapp3.1' or $(TargetFramework.StartsWith('net5.0-windows'))">
+  <ItemGroup Condition=" '$(TargetFramework)' == 'net472' or $(TargetFramework.StartsWith('net6.0-windows')) or $(TargetFramework.StartsWith('net7.0-windows'))">
     <Compile Include="Platforms\Desktop\**\*.cs" />
     <Compile Include="Platforms\Desktop\**\*.cs" />
   </ItemGroup>
   </ItemGroup>
 
 
@@ -159,36 +144,10 @@
     </None>
     </None>
   </ItemGroup>
   </ItemGroup>
 
 
-  <PropertyGroup>
-    <TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);RemoveNetCoreApp3FromNuGet</TargetsForTfmSpecificBuildOutput>
-    <TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);AddNetCore3ToNuGet</TargetsForTfmSpecificContentInPackage>
-  </PropertyGroup>
-
-  <!-- We remove the output from the nuget so it doesn't wind up in the \lib folder -->
-  <Target Name="RemoveNetCoreApp3FromNuGet" DependsOnTargets="BuiltProjectOutputGroup;DocumentationProjectOutputGroup" Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
-    <ItemGroup>
-      <!-- Before clearing the output groups, add them to None for packing -->
-      <ItemsToAddToNuGet Include="@(BuiltProjectOutputGroupOutput);@(DocumentationProjectOutputGroupOutput)" PackagePath="build\netcoreapp3.1" />
-
-      <BuiltProjectOutputGroupOutput Remove="@(BuiltProjectOutputGroupOutput)" />
-      <DocumentationProjectOutputGroupOutput Remove="@(DocumentationProjectOutputGroupOutput)" />
-    </ItemGroup>
-  </Target>
-
-  <Target Name="AddNetCore3ToNuGet" Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
-    <ItemGroup>
-      <!-- Add the removed build output to the build\netcoreapp3.0 folder -->
-      <TfmSpecificPackageFileWithRecursiveDir Include="@(ItemsToAddToNuGet)" PackagePath="build\netcoreapp3.1" />
-    </ItemGroup>
-  </Target>
-
   <ItemGroup>
   <ItemGroup>
-    <None Include="build\_._" PackagePath="lib\netcoreapp3.1" Pack="true" />
-    <None Include="build\_._" PackagePath="build\net5.0;build\net5.0-windows10.0.19041" Pack="true" />
-    <None Include="build\_._" PackagePath="buildTransitive\net5.0;buildTransitive\net5.0-windows10.0.19041" Pack="true" />
-    <None Include="build\System.Reactive.targets" PackagePath="buildTransitive\netcoreapp3.1" Pack="true" />
-    <None Include="build\System.Reactive.targets" PackagePath="build\netcoreapp3.1" Pack="true" />
-	<None Include="build\System.Reactive.net5.0-windows.targets" PackagePath="build\net5.0-windows7\$(PackageId).targets;buildTransitive\net5.0-windows7\$(PackageId).targets" Pack="true" />
+    <None Include="build\_._" PackagePath="build\net6.0;build\net6.0-windows10.0.19041" Pack="true" />
+    <None Include="build\_._" PackagePath="buildTransitive\net6.0;buildTransitive\net6.0-windows10.0.19041" Pack="true" />
+    <None Include="build\System.Reactive.net6.0-windows.targets" PackagePath="build\net6.0-windows7\$(PackageId).targets;buildTransitive\net6.0-windows7\$(PackageId).targets" Pack="true" />
     <None Include="Linq\QbservableEx.NAry.cs">
     <None Include="Linq\QbservableEx.NAry.cs">
       <DesignTime>True</DesignTime>
       <DesignTime>True</DesignTime>
       <AutoGen>True</AutoGen>
       <AutoGen>True</AutoGen>

+ 1 - 1
Rx.NET/Source/src/System.Reactive/build/System.Reactive.net5.0-windows.targets → Rx.NET/Source/src/System.Reactive/build/System.Reactive.net6.0-windows.targets

@@ -3,7 +3,7 @@
    
    
   <Target Name="_RXNETWindowsTFMCheck" BeforeTargets="ResolveAssemblyReferences;Build;Rebuild">
   <Target Name="_RXNETWindowsTFMCheck" BeforeTargets="ResolveAssemblyReferences;Build;Rebuild">
     <Error 
     <Error 
-        Text = "The 'System.Reactive' nuget package cannot be used to target '$(TargetFramework)'. Target 'net5.0-windows10.0.19041' or later instead." />
+        Text = "The 'System.Reactive' nuget package cannot be used to target '$(TargetFramework)'. Target 'net6.0-windows10.0.19041' or later instead." />
   </Target>
   </Target>
   
   
 </Project>
 </Project>

+ 0 - 12
Rx.NET/Source/src/System.Reactive/build/System.Reactive.targets

@@ -1,12 +0,0 @@
-<Project>
-  <PropertyGroup>
-    <UseWindowsRxVersion Condition="'$(UseWpf)' == 'true' OR '$(UseWindowsForms)' == 'true'" >true</UseWindowsRxVersion>
-    <UseWindowsRxVersion Condition="'$(UseWindowsRxVersion)' == '' " >false</UseWindowsRxVersion>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Condition="'$(UseWindowsRxVersion)' == 'true' "  Include="$(MSBuildThisFileDirectory)..\..\build\netcoreapp3.1\System.Reactive.dll" />
-    <Reference Condition="'$(UseWindowsRxVersion)' != 'true' "  Include="$(MSBuildThisFileDirectory)..\..\lib\netstandard2.0\System.Reactive.dll" />
-
-    <FrameworkReference Include="Microsoft.WindowsDesktop.App" Condition="'$(UseWindowsRxVersion)' == 'true' and !@(FrameworkReference->AnyHaveMetadataValue('Identity', 'Microsoft.WindowsDesktop.App'))" />
-  </ItemGroup>
-</Project>

+ 2 - 2
Rx.NET/Source/tests/Tests.System.Reactive.Uwp.DeviceRunner/Package.appxmanifest

@@ -8,14 +8,14 @@
 
 
   <Identity
   <Identity
     Name="ce55b747-4cb1-4fd7-b7f8-9f9e55115229"
     Name="ce55b747-4cb1-4fd7-b7f8-9f9e55115229"
-    Publisher="CN=oren"
+    Publisher="CN=ian"
     Version="1.0.0.0" />
     Version="1.0.0.0" />
 
 
   <mp:PhoneIdentity PhoneProductId="ce55b747-4cb1-4fd7-b7f8-9f9e55115229" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
   <mp:PhoneIdentity PhoneProductId="ce55b747-4cb1-4fd7-b7f8-9f9e55115229" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
 
 
   <Properties>
   <Properties>
     <DisplayName>Tests.System.Reactive.Uwp.DeviceRunner</DisplayName>
     <DisplayName>Tests.System.Reactive.Uwp.DeviceRunner</DisplayName>
-    <PublisherDisplayName>oren</PublisherDisplayName>
+    <PublisherDisplayName>ian</PublisherDisplayName>
     <Logo>Assets\StoreLogo.png</Logo>
     <Logo>Assets\StoreLogo.png</Logo>
   </Properties>
   </Properties>
 
 

+ 22 - 7
Rx.NET/Source/tests/Tests.System.Reactive.Uwp.DeviceRunner/Tests.System.Reactive.Uwp.DeviceRunner.csproj

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
   <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
   <PropertyGroup>
   <PropertyGroup>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -11,19 +11,21 @@
     <AssemblyName>Tests.System.Reactive.Uwp.DeviceRunner</AssemblyName>
     <AssemblyName>Tests.System.Reactive.Uwp.DeviceRunner</AssemblyName>
     <DefaultLanguage>en-US</DefaultLanguage>
     <DefaultLanguage>en-US</DefaultLanguage>
     <TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
     <TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
-    <TargetPlatformVersion>10.0.17134.0</TargetPlatformVersion>
-    <TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
-    <MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
+    <TargetPlatformVersion>10.0.18362.0</TargetPlatformVersion>
+    <TargetPlatformMinVersion>10.0.18362.0</TargetPlatformMinVersion>
+    <MinimumVisualStudioVersion>17</MinimumVisualStudioVersion>
     <FileAlignment>512</FileAlignment>
     <FileAlignment>512</FileAlignment>
     <ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
     <ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <UnitTestPlatformVersion Condition="'$(UnitTestPlatformVersion)' == ''">$(VisualStudioVersion)</UnitTestPlatformVersion>
     <PackageCertificateKeyFile>Tests.System.Reactive.Uwp.DeviceRunner_TemporaryKey.pfx</PackageCertificateKeyFile>
     <PackageCertificateKeyFile>Tests.System.Reactive.Uwp.DeviceRunner_TemporaryKey.pfx</PackageCertificateKeyFile>
-    <PackageCertificateThumbprint>2BD466C3AB205824BF42514FF6A6F268A0B60966</PackageCertificateThumbprint>
+    <PackageCertificateThumbprint>8570A5641EDE61A2AB21E12809E9E0376A041E8C</PackageCertificateThumbprint>
     <SignAssembly>false</SignAssembly>
     <SignAssembly>false</SignAssembly>
+    <AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
     <DebugSymbols>true</DebugSymbols>
     <DebugSymbols>true</DebugSymbols>
     <OutputPath>bin\x86\Debug\</OutputPath>
     <OutputPath>bin\x86\Debug\</OutputPath>
-    <DefineConstants>TRACE;DEBUG;NETFX_CORE;WINDOWS_UWP;CODE_ANALYSIS;NO_EVENTARGS_CONSTRAINT;HAS_EDI;HAS_WINRT;HAS_PROGRESS;PREFER_ASYNC;HAS_AWAIT;HAS_APTCA;HAS_TPL46;NO_REMOTING;NO_SERIALIZABLE;NO_THREAD;CRIPPLED_REFLECTION;WINDOWS;USE_TIMER_SELF_ROOT</DefineConstants>
+    <DefineConstants>TRACE;DEBUG;NETFX_CORE;WINDOWS_UWP;CODE_ANALYSIS;NO_EVENTARGS_CONSTRAINT;HAS_EDI;HAS_WINRT;HAS_PROGRESS;PREFER_ASYNC;HAS_AWAIT;HAS_APTCA;HAS_TPL46;NO_REMOTING;NO_THREAD;WINDOWS;USE_TIMER_SELF_ROOT</DefineConstants>
     <NoWarn>;2008;0618</NoWarn>
     <NoWarn>;2008;0618</NoWarn>
     <DebugType>full</DebugType>
     <DebugType>full</DebugType>
     <PlatformTarget>x86</PlatformTarget>
     <PlatformTarget>x86</PlatformTarget>
@@ -33,7 +35,7 @@
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
     <OutputPath>bin\x86\Release\</OutputPath>
     <OutputPath>bin\x86\Release\</OutputPath>
-    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP;CODE_ANALYSIS;NO_EVENTARGS_CONSTRAINT;HAS_EDI;HAS_WINRT;HAS_PROGRESS;PREFER_ASYNC;HAS_AWAIT;HAS_APTCA;HAS_TPL46;NO_REMOTING;NO_SERIALIZABLE;NO_THREAD;CRIPPLED_REFLECTION;WINDOWS;USE_TIMER_SELF_ROOT</DefineConstants>
+    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP;CODE_ANALYSIS;NO_EVENTARGS_CONSTRAINT;HAS_EDI;HAS_WINRT;HAS_PROGRESS;PREFER_ASYNC;HAS_AWAIT;HAS_APTCA;HAS_TPL46;NO_REMOTING;NO_THREAD;WINDOWS;USE_TIMER_SELF_ROOT</DefineConstants>
     <Optimize>true</Optimize>
     <Optimize>true</Optimize>
     <NoWarn>;2008;0618</NoWarn>
     <NoWarn>;2008;0618</NoWarn>
     <DebugType>pdbonly</DebugType>
     <DebugType>pdbonly</DebugType>
@@ -89,6 +91,9 @@
     <Prefer32Bit>true</Prefer32Bit>
     <Prefer32Bit>true</Prefer32Bit>
     <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
     <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
   </PropertyGroup>
   </PropertyGroup>
+  <PropertyGroup>
+    <NoWarn>$(NoWarn);IDE0003;IDE0016;IDE0017;IDE0018;IDE0019;IDE0020;IDE0031;IDE0032;IDE0034;IDE0037;IDE0038;IDE0039;IDE0040;IDE0044;IDE0051;IDE0052;IDE0056;IDE0057;IDE0059;IDE0060;IDE0062;IDE0063;IDE0071;IDE0074;IDE0075;IDE0076;IDE0077;IDE0079;IDE0083;IDE0090;IDE0180;IDE1006;IDE1056</NoWarn>
+  </PropertyGroup>
   <ItemGroup>
   <ItemGroup>
     <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.13" />
     <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.13" />
     <PackageReference Include="xunit" Version="2.4.1" />
     <PackageReference Include="xunit" Version="2.4.1" />
@@ -160,6 +165,16 @@
   <PropertyGroup>
   <PropertyGroup>
     <AssemblyOriginatorKeyFile>..\..\ReactiveX.snk</AssemblyOriginatorKeyFile>
     <AssemblyOriginatorKeyFile>..\..\ReactiveX.snk</AssemblyOriginatorKeyFile>
   </PropertyGroup>
   </PropertyGroup>
+  <PropertyGroup>
+    <!--
+      The Coverlet targets will be imported as part of the Import after this PropertyGroup, and
+      they seem to presume that the NETCoreSdkVersion property will have been set. It does not
+      appear to get set for old-style projects such as we are required to use for UWP projects
+      so we need to set it ourselves.
+      Note that it doesn't seem to be critical that this exactly matches the SDK version in use.
+    -->
+    <NETCoreSdkVersion>7.0.103</NETCoreSdkVersion>
+  </PropertyGroup>
   <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
   <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
        Other similar extension points exist, see Microsoft.Common.targets.
        Other similar extension points exist, see Microsoft.Common.targets.

BIN
Rx.NET/Source/tests/Tests.System.Reactive.Uwp.DeviceRunner/Tests.System.Reactive.Uwp.DeviceRunner_TemporaryKey.pfx


+ 1 - 1
Rx.NET/Source/tests/Tests.System.Reactive/DispatcherHelpers.cs

@@ -4,7 +4,7 @@
 
 
 using System.Reactive.Disposables;
 using System.Reactive.Disposables;
 
 
-#if NETCOREAPP2_1 || NET472 || NETCOREAPP3_1 || CSWINRT
+#if NET472 || CSWINRT
 using System.Threading;
 using System.Threading;
 #endif
 #endif
 #if HAS_DISPATCHER
 #if HAS_DISPATCHER

+ 2 - 2
Rx.NET/Source/tests/Tests.System.Reactive/Tests.System.Reactive.csproj

@@ -1,10 +1,10 @@
 <Project Sdk="MSBuild.Sdk.Extras">
 <Project Sdk="MSBuild.Sdk.Extras">
   <PropertyGroup>
   <PropertyGroup>
-    <TargetFrameworks>netcoreapp3.1;net472;netcoreapp2.1;net5.0;net5.0-windows10.0.19041</TargetFrameworks>
+    <TargetFrameworks>net472;net6.0;net7.0;net6.0-windows10.0.19041</TargetFrameworks>
     <NoWarn>$(NoWarn);CS0618</NoWarn>
     <NoWarn>$(NoWarn);CS0618</NoWarn>
   </PropertyGroup>
   </PropertyGroup>
 
 
-  <PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1' or '$(TargetFramework)' == 'net472'">
+  <PropertyGroup Condition="'$(TargetFramework)' == 'net472'">
     <UseWPF>true</UseWPF>
     <UseWPF>true</UseWPF>
     <UseWindowsForms>true</UseWindowsForms>
     <UseWindowsForms>true</UseWindowsForms>
   </PropertyGroup>
   </PropertyGroup>

+ 11 - 25
azure-pipelines.rx.yml

@@ -24,7 +24,8 @@ stages:
 - stage: Build
 - stage: Build
   jobs:
   jobs:
   - job: Build
   - job: Build
-    pool: vs2019-preview
+    pool:
+      vmImage: windows-latest
 
 
     variables:
     variables:
       BuildConfiguration: Release
       BuildConfiguration: Release
@@ -33,10 +34,9 @@ stages:
 
 
     steps:
     steps:
     - task: UseDotNet@2
     - task: UseDotNet@2
-      displayName: Use .NET Core 5.0.x SDK
+      displayName: Use .NET Core 7.0.x SDK
       inputs:
       inputs:
-        version: 5.0.x
-        includePreviewVersions: true
+        version: 7.0.x
         performMultiLevelLookup: true
         performMultiLevelLookup: true
 
 
     - task: DotNetCoreCLI@2
     - task: DotNetCoreCLI@2
@@ -120,17 +120,11 @@ stages:
     steps:
     steps:
     - task: UseDotNet@2
     - task: UseDotNet@2
       inputs:
       inputs:
-        version: 5.0.x
-        includePreviewVersions: true
-
-    - task: UseDotNet@2
-      inputs:
-        version: '3.1.x'
-        packageType: runtime
+        version: 7.0.x
 
 
     - task: UseDotNet@2
     - task: UseDotNet@2
       inputs:
       inputs:
-        version: '2.2.x'
+        version: '6.0.x'
         packageType: runtime
         packageType: runtime
 
 
     - task: DotNetCoreCLI@2
     - task: DotNetCoreCLI@2
@@ -161,22 +155,15 @@ stages:
       inputs:
       inputs:
         command: test
         command: test
         projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LinuxTests/LinuxTests.csproj
         projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LinuxTests/LinuxTests.csproj
-        arguments: -c $(BuildConfiguration) -f net5.0 --filter "SkipCI!=true"
-      displayName: Run 5.0 Tests on Linux
-
-    - task: DotNetCoreCLI@2
-      inputs:
-        command: test
-        projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LinuxTests/LinuxTests.csproj
-        arguments: -c $(BuildConfiguration) -f netcoreapp3.1 --filter "SkipCI!=true"
-      displayName: Run 3.1 Tests on Linux
+        arguments: -c $(BuildConfiguration) -f net7.0 --filter "SkipCI!=true"
+      displayName: Run 7.0 Tests on Linux
 
 
     - task: DotNetCoreCLI@2
     - task: DotNetCoreCLI@2
       inputs:
       inputs:
         command: test
         command: test
         projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LinuxTests/LinuxTests.csproj
         projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LinuxTests/LinuxTests.csproj
-        arguments: -c $(BuildConfiguration) -f netcoreapp2.1 --filter "SkipCI!=true" 
-      displayName: Run 2.1 Tests on Linux
+        arguments: -c $(BuildConfiguration) -f net6.0 --filter "SkipCI!=true"
+      displayName: Run 6.0 Tests on Linux
 
 
   - job: WindowsDesktop    
   - job: WindowsDesktop    
     pool:
     pool:
@@ -190,8 +177,7 @@ stages:
     steps:
     steps:
     - task: UseDotNet@2
     - task: UseDotNet@2
       inputs:
       inputs:
-        version: 5.0.x
-        includePreviewVersions: true
+        version: 7.0.x
         performMultiLevelLookup: true
         performMultiLevelLookup: true
 
 
     - task: DotNetCoreCLI@2
     - task: DotNetCoreCLI@2