Browse Source

Upgrade to supported TFMs and SDK versions

Remove dependency on System.Runtime.InteropServices.WindowsRuntime in netstandard2.0 - this wouldn't work right on net6.0 or later because they use C#/WinRT for interop
Ian Griffiths 2 years ago
parent
commit
d0a4bc0700

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

@@ -20,6 +20,10 @@
     <EmbedUntrackedSources>true</EmbedUntrackedSources>
     <PublishRepositoryUrl>true</PublishRepositoryUrl>
     <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 Condition="'$(TF_BUILD)' == 'true'">

+ 3 - 11
Rx.NET/Source/Directory.build.targets

@@ -9,26 +9,18 @@
   <PropertyGroup Condition="'$(TargetFramework)' == 'net472'">
     <DefineConstants>$(DefineConstants);HAS_WINFORMS;HAS_WPF;HAS_WINRT;HAS_DISPATCHER;HAS_REMOTING;DESKTOPCLR;NO_NULLABLE_ATTRIBUTES</DefineConstants>
   </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'">
     <DefineConstants>$(DefineConstants);HAS_WINRT;WINDOWS;HAS_OS_XAML;LEGACY_WINRT;NO_NULLABLE_ATTRIBUTES</DefineConstants>
     <TargetPlatformVersion>10.0.19041.0</TargetPlatformVersion>
   </PropertyGroup>
-  <PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netcoreapp2.1'">
+  <PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
     <DefineConstants>$(DefineConstants);HAS_WINRT;NO_NULLABLE_ATTRIBUTES</DefineConstants>
   </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>
   </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.16299' or '$(TargetFramework)' == 'netstandard2.0'">
     <PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
   </ItemGroup>
 

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

@@ -1,6 +1,6 @@
 <Project Sdk="MSBuild.Sdk.Extras">
   <PropertyGroup>
-    <TargetFrameworks>netcoreapp3.1;net472;uap10.0.16299;netstandard2.0;net5.0</TargetFrameworks>
+    <TargetFrameworks>netstandard2.0;net472;uap10.0.16299;net6.0</TargetFrameworks>
     <CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
     <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>    

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

@@ -1,6 +1,6 @@
 <Project Sdk="MSBuild.Sdk.Extras">
   <PropertyGroup>
-    <TargetFrameworks>netstandard2.0;net472;uap10.0.16299;net5.0</TargetFrameworks>    
+    <TargetFrameworks>netstandard2.0;net472;uap10.0.16299;net6.0</TargetFrameworks>
     <Title>Reactive Extensions - Aliases</Title>    
     <CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>    
     <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.Reflection;
 
-#if HAS_WINRT
-using System.Runtime.InteropServices.WindowsRuntime;
-#endif
-
 namespace System.Reactive
 {
     internal static class ReflectionUtils
@@ -76,18 +72,16 @@ namespace System.Reactive
 
             isWinRT = false;
 
-#if HAS_WINRT && !CSWINRT
-            if (addMethod.ReturnType == typeof(EventRegistrationToken))
+            if (IsWinRTEventRegistrationTokenType(addMethod.ReturnType))
             {
                 isWinRT = true;
 
                 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);
                 }
             }
-#endif
 
             delegateType = psa[0].ParameterType;
 
@@ -119,5 +113,42 @@ namespace System.Reactive
 #if (CRIPPLED_REFLECTION && HAS_WINRT)
         public static MethodInfo GetMethod(this Type type, string name) => type.GetTypeInfo().GetDeclaredMethod(name);
 #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 _removeMethod;
             private readonly Func<TSender, TEventArgs, TResult> _getResult;
-#if HAS_WINRT
             private readonly bool _isWinRT;
-#endif
 
             public Handler(object? target, Type delegateType, MethodInfo addMethod, MethodInfo removeMethod, Func<TSender, TEventArgs, TResult> getResult, bool isWinRT, IScheduler scheduler)
                 : base(scheduler)
             {
-#if HAS_WINRT
                 _isWinRT = isWinRT;
-#else
-                System.Diagnostics.Debug.Assert(!isWinRT);
-#endif
                 _target = target;
                 _delegateType = delegateType;
                 _addMethod = addMethod;
@@ -100,13 +94,11 @@ namespace System.Reactive.Linq.ObservableImpl
 
                 try
                 {
-#if HAS_WINRT
                     if (_isWinRT)
                     {
                         removeHandler = AddHandlerCoreWinRT(handler);
                     }
                     else
-#endif
                     {
                         removeHandler = AddHandlerCore(handler);
                     }
@@ -147,13 +139,11 @@ namespace System.Reactive.Linq.ObservableImpl
                 return () => _removeMethod.Invoke(_target, new object[] { handler });
             }
 
-#if HAS_WINRT
             private Action AddHandlerCoreWinRT(Delegate handler)
             {
                 var token = _addMethod.Invoke(_target, new object[] { handler });
                 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">
   <PropertyGroup>
-    <TargetFrameworks>netcoreapp3.1;netstandard2.0;net472;uap10.0.16299;net5.0;net5.0-windows10.0.19041</TargetFrameworks>
+    <TargetFrameworks>netstandard2.0;net472;uap10.0.16299;net6.0;net6.0-windows10.0.19041</TargetFrameworks>
     <CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
     <PackageTags>Rx;Reactive;Extensions;Observable;LINQ;Events</PackageTags>
     <Description>Reactive Extensions (Rx) for .NET</Description>
@@ -10,16 +10,11 @@
     <Nullable>enable</Nullable>
   </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>
     <UseWindowsForms>true</UseWindowsForms>
-    <IncludeBuildOutput Condition="'$(TargetFramework)' == 'netcoreapp3.1'">false</IncludeBuildOutput>
   </PropertyGroup>
 
-  <ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
-    <FrameworkReference Update="Microsoft.WindowsDesktop.App" PrivateAssets="all" />
-  </ItemGroup>
-
 
   <ItemGroup>
     <Compile Remove="Platforms\**\*.*" />
@@ -36,23 +31,13 @@
   </ItemGroup>
 
 
-  <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
-    <PackageReference Include="System.Runtime.InteropServices.WindowsRuntime" Version="4.3.0" />
-  </ItemGroup>
-
   <!-- 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" />
   </ItemGroup>
 
   <!-- 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" />
     <EmbeddedResource Include="Platforms\Windows\**\*.resx" />
   </ItemGroup>
@@ -64,7 +49,7 @@
     <Reference Include="WindowsBase" />
   </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" />
   </ItemGroup>
 
@@ -159,36 +144,10 @@
     </None>
   </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>
-    <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">
       <DesignTime>True</DesignTime>
       <AutoGen>True</AutoGen>

+ 0 - 9
Rx.NET/Source/src/System.Reactive/build/System.Reactive.net5.0-windows.targets

@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-   
-  <Target Name="_RXNETWindowsTFMCheck" BeforeTargets="ResolveAssemblyReferences;Build;Rebuild">
-    <Error 
-        Text = "The 'System.Reactive' nuget package cannot be used to target '$(TargetFramework)'. Target 'net5.0-windows10.0.19041' or later instead." />
-  </Target>
-  
-</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
     Name="ce55b747-4cb1-4fd7-b7f8-9f9e55115229"
-    Publisher="CN=oren"
+    Publisher="CN=ian"
     Version="1.0.0.0" />
 
   <mp:PhoneIdentity PhoneProductId="ce55b747-4cb1-4fd7-b7f8-9f9e55115229" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
 
   <Properties>
     <DisplayName>Tests.System.Reactive.Uwp.DeviceRunner</DisplayName>
-    <PublisherDisplayName>oren</PublisherDisplayName>
+    <PublisherDisplayName>ian</PublisherDisplayName>
     <Logo>Assets\StoreLogo.png</Logo>
   </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"?>
-<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')" />
   <PropertyGroup>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -11,19 +11,21 @@
     <AssemblyName>Tests.System.Reactive.Uwp.DeviceRunner</AssemblyName>
     <DefaultLanguage>en-US</DefaultLanguage>
     <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>
     <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>
-    <PackageCertificateThumbprint>2BD466C3AB205824BF42514FF6A6F268A0B60966</PackageCertificateThumbprint>
+    <PackageCertificateThumbprint>8570A5641EDE61A2AB21E12809E9E0376A041E8C</PackageCertificateThumbprint>
     <SignAssembly>false</SignAssembly>
+    <AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
     <DebugSymbols>true</DebugSymbols>
     <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>
     <DebugType>full</DebugType>
     <PlatformTarget>x86</PlatformTarget>
@@ -33,7 +35,7 @@
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
     <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>
     <NoWarn>;2008;0618</NoWarn>
     <DebugType>pdbonly</DebugType>
@@ -89,6 +91,9 @@
     <Prefer32Bit>true</Prefer32Bit>
     <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
   </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>
     <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.13" />
     <PackageReference Include="xunit" Version="2.4.1" />
@@ -160,6 +165,16 @@
   <PropertyGroup>
     <AssemblyOriginatorKeyFile>..\..\ReactiveX.snk</AssemblyOriginatorKeyFile>
   </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" />
   <!-- 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.

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;
 
-#if NETCOREAPP2_1 || NET472 || NETCOREAPP3_1 || CSWINRT
+#if NET472 || CSWINRT
 using System.Threading;
 #endif
 #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">
   <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>
   </PropertyGroup>
 
-  <PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1' or '$(TargetFramework)' == 'net472'">
+  <PropertyGroup Condition="'$(TargetFramework)' == 'net472'">
     <UseWPF>true</UseWPF>
     <UseWindowsForms>true</UseWindowsForms>
   </PropertyGroup>

+ 9 - 24
azure-pipelines.rx.yml

@@ -33,10 +33,9 @@ stages:
 
     steps:
     - task: UseDotNet@2
-      displayName: Use .NET Core 5.0.x SDK
+      displayName: Use .NET Core 7.0.x SDK
       inputs:
-        version: 5.0.x
-        includePreviewVersions: true
+        version: 7.0.x
         performMultiLevelLookup: true
 
     - task: DotNetCoreCLI@2
@@ -120,17 +119,11 @@ stages:
     steps:
     - task: UseDotNet@2
       inputs:
-        version: 5.0.x
-        includePreviewVersions: true
+        version: 7.0.x
 
     - task: UseDotNet@2
       inputs:
-        version: '3.1.x'
-        packageType: runtime
-
-    - task: UseDotNet@2
-      inputs:
-        version: '2.2.x'
+        version: '6.0.x'
         packageType: runtime
 
     - task: DotNetCoreCLI@2
@@ -161,22 +154,15 @@ stages:
       inputs:
         command: test
         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
       inputs:
         command: test
         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    
     pool:
@@ -190,8 +176,7 @@ stages:
     steps:
     - task: UseDotNet@2
       inputs:
-        version: 5.0.x
-        includePreviewVersions: true
+        version: 7.0.x
         performMultiLevelLookup: true
 
     - task: DotNetCoreCLI@2