Bart De Smet 8 年之前
父节点
当前提交
eaf2bd17e8
共有 95 个文件被更改,包括 908 次插入549 次删除
  1. 79 0
      .editorconfig
  2. 14 17
      Ix.NET/Source/Directory.build.props
  3. 0 21
      Ix.NET/Source/Ix.NET.sln.DotSettings
  4. 0 6
      Ix.NET/Source/Ix.NET.v3.ncrunchsolution
  5. 0 23
      Ix.NET/Source/NuSpecs/System.Interactive.Async.Providers.nuspec
  6. 0 27
      Ix.NET/Source/NuSpecs/System.Interactive.Async.nuspec
  7. 0 23
      Ix.NET/Source/NuSpecs/System.Interactive.Providers.nuspec
  8. 0 27
      Ix.NET/Source/NuSpecs/System.Interactive.nuspec
  9. 2 4
      Ix.NET/Source/System.Interactive.Async.Providers/AsyncQueryable.cs
  10. 0 5
      Ix.NET/Source/System.Interactive.Async.Providers/System.Interactive.Async.Providers.v3.ncrunchproject
  11. 6 12
      Ix.NET/Source/System.Interactive.Async/AppendPrepend.cs
  12. 1 2
      Ix.NET/Source/System.Interactive.Async/AsyncEnumerableHelpers.cs
  13. 1 2
      Ix.NET/Source/System.Interactive.Async/Cast.cs
  14. 1 2
      Ix.NET/Source/System.Interactive.Async/Concatenate.cs
  15. 2 4
      Ix.NET/Source/System.Interactive.Async/Count.cs
  16. 1 2
      Ix.NET/Source/System.Interactive.Async/ElementAt.cs
  17. 2 4
      Ix.NET/Source/System.Interactive.Async/Last.cs
  18. 7 5
      Ix.NET/Source/System.Interactive.Async/Lookup.cs
  19. 1 2
      Ix.NET/Source/System.Interactive.Async/Reverse.cs
  20. 3 5
      Ix.NET/Source/System.Interactive.Async/Select.cs
  21. 2 4
      Ix.NET/Source/System.Interactive.Async/SequenceEqual.cs
  22. 2 4
      Ix.NET/Source/System.Interactive.Async/Single.cs
  23. 0 5
      Ix.NET/Source/System.Interactive.Async/System.Interactive.Async.v3.ncrunchproject
  24. 2 4
      Ix.NET/Source/System.Interactive.Async/ToAsyncEnumerable.cs
  25. 2 4
      Ix.NET/Source/System.Interactive.Async/ToCollection.cs
  26. 1 2
      Ix.NET/Source/System.Interactive.Async/Where.cs
  27. 3 6
      Ix.NET/Source/System.Interactive.Providers/QueryableEx.cs
  28. 二进制
      Ix.NET/Source/System.Interactive.Tests.Uwp.DeviceRunner/AppPackages/System.Interactive.Tests.Uwp.DeviceRunner_1.0.0.0_x86_Test/System.Interactive.Tests.Uwp.DeviceRunner_1.0.0.0_x86.appx
  29. 4 3
      Ix.NET/Source/System.Interactive.Tests.Uwp.DeviceRunner/System.Interactive.Tests.Uwp.DeviceRunner.csproj
  30. 0 5
      Ix.NET/Source/System.Interactive.Tests.Uwp.DeviceRunner/System.Interactive.Tests.Uwp.DeviceRunner.v3.ncrunchproject
  31. 二进制
      Ix.NET/Source/System.Interactive.Tests.Uwp.DeviceRunner/System.Interactive.Tests.Uwp.DeviceRunner_TemporaryKey.pfx
  32. 1 2
      Ix.NET/Source/System.Interactive/Case.cs
  33. 1 2
      Ix.NET/Source/System.Interactive/Memoize.cs
  34. 0 5
      Ix.NET/Source/System.Interactive/System.Interactive.v3.ncrunchproject
  35. 15 13
      Ix.NET/Source/Tests/AsyncTests.Aggregates.cs
  36. 26 26
      Ix.NET/Source/Tests/AsyncTests.Single.cs
  37. 2 0
      Ix.NET/Source/Tests/AsyncTests.cs
  38. 7 7
      Ix.NET/Source/Tests/Tests.Creation.cs
  39. 2 0
      Ix.NET/Source/Tests/Tests.cs
  40. 7 4
      Ix.NET/Source/Tests/Tests.csproj
  41. 0 5
      Ix.NET/Source/Tests/Tests.v3.ncrunchproject
  42. 43 36
      Ix.NET/Source/build-new.ps1
  43. 16 0
      Ix.NET/Source/version.json
  44. 1 1
      README.md
  45. 19 21
      Rx.NET/Source/Directory.build.props
  46. 4 1
      Rx.NET/Source/Directory.build.targets
  47. 0 1
      Rx.NET/Source/NuGet.Config
  48. 3 1
      Rx.NET/Source/System.Reactive.sln
  49. 3 0
      Rx.NET/Source/Test.ruleset
  50. 12 35
      Rx.NET/Source/build-new.ps1
  51. 1 0
      Rx.NET/Source/facades/Directory.build.props
  52. 1 1
      Rx.NET/Source/src/Microsoft.Reactive.Testing/Microsoft.Reactive.Testing.csproj
  53. 1 1
      Rx.NET/Source/src/Microsoft.Reactive.Testing/MockObserver.cs
  54. 0 3
      Rx.NET/Source/src/System.Reactive.Observable.Aliases/Qbservable.Aliases.Generated.cs
  55. 1 1
      Rx.NET/Source/src/System.Reactive.Observable.Aliases/System.Reactive.Observable.Aliases.csproj
  56. 2 2
      Rx.NET/Source/src/System.Reactive/Concurrency/ConcurrencyAbstractionLayerImpl.cs
  57. 1 2
      Rx.NET/Source/src/System.Reactive/Concurrency/SchedulerWrapper.cs
  58. 2 2
      Rx.NET/Source/src/System.Reactive/Internal/Constants.cs
  59. 2 4
      Rx.NET/Source/src/System.Reactive/Internal/Lookup.cs
  60. 2 4
      Rx.NET/Source/src/System.Reactive/Internal/SystemClock.cs
  61. 2 4
      Rx.NET/Source/src/System.Reactive/Internal/TailRecursiveSink.cs
  62. 2 3
      Rx.NET/Source/src/System.Reactive/Joins/Plan.cs
  63. 1 2
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Case.cs
  64. 1 2
      Rx.NET/Source/src/System.Reactive/Linq/Observable/GroupByUntil.cs
  65. 1 2
      Rx.NET/Source/src/System.Reactive/Linq/Observable/PushToPullAdapter.cs
  66. 2 2
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Timeout.cs
  67. 0 3
      Rx.NET/Source/src/System.Reactive/Linq/Qbservable.Generated.cs
  68. 0 3
      Rx.NET/Source/src/System.Reactive/Linq/QbservableEx.Generated.cs
  69. 1 5
      Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Events.cs
  70. 20 0
      Rx.NET/Source/src/System.Reactive/Runtime/CompilerServices/AsyncMethodBuilderAttribute.cs
  71. 349 0
      Rx.NET/Source/src/System.Reactive/Runtime/CompilerServices/TaskObservableMethodBuilder.cs
  72. 1 1
      Rx.NET/Source/src/System.Reactive/Subjects/AsyncSubject.cs
  73. 5 4
      Rx.NET/Source/src/System.Reactive/System.Reactive.csproj
  74. 53 0
      Rx.NET/Source/src/System.Reactive/TaskObservable.cs
  75. 1 1
      Rx.NET/Source/src/System.Reactive/TimeInterval.cs
  76. 1 1
      Rx.NET/Source/src/System.Reactive/Timestamped.cs
  77. 3 0
      Rx.NET/Source/tests/Directory.build.props
  78. 0 29
      Rx.NET/Source/tests/Tests.System.Reactive.Uwp.DeviceRunner/Properties/AssemblyInfo.cs
  79. 2 1
      Rx.NET/Source/tests/Tests.System.Reactive.Uwp.DeviceRunner/Tests.System.Reactive.Uwp.DeviceRunner.csproj
  80. 二进制
      Rx.NET/Source/tests/Tests.System.Reactive.Uwp.DeviceRunner/Tests.System.Reactive.Uwp.DeviceRunner_TemporaryKey.pfx
  81. 1 1
      Rx.NET/Source/tests/Tests.System.Reactive/DispatcherHelpers.cs
  82. 1 1
      Rx.NET/Source/tests/Tests.System.Reactive/MockEnumerable.cs
  83. 6 5
      Rx.NET/Source/tests/Tests.System.Reactive/Tests.System.Reactive.csproj
  84. 3 6
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/DefaultSchedulerTest.cs
  85. 1 2
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/SchedulerTest.cs
  86. 2 7
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/ThreadPoolSchedulerTest.cs
  87. 1 1
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/ObservableAggregateTest.cs
  88. 1 1
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/ObservableMultipleTest.cs
  89. 6 6
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Subjects/AsyncSubjectTest.cs
  90. 6 12
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Subjects/BehaviorSubjectTest.cs
  91. 30 30
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Subjects/ReplaySubjectTest.cs
  92. 1 2
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/MySubject.cs
  93. 2 2
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/PrivateTypesTest.cs
  94. 75 0
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/TaskLikeSupportTest.cs
  95. 16 0
      Rx.NET/Source/version.json

+ 79 - 0
.editorconfig

@@ -0,0 +1,79 @@
+# EditorConfig is awesome:http://EditorConfig.org
+# From https://raw.githubusercontent.com/dotnet/roslyn/master/.editorconfig
+
+# top-most EditorConfig file
+root = true
+
+# Don't use tabs for indentation.
+[*]
+indent_style = space
+# (Please don't specify an indent_size here; that has too many unintended consequences.)
+
+# Code files
+[*.{cs,csx,vb,vbx}]
+indent_size = 4
+
+# Xml project files
+[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
+indent_size = 2
+
+# Xml config files
+[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
+indent_size = 2
+
+# JSON files
+[*.json]
+indent_size = 2
+
+# Dotnet code style settings:
+[*.{cs,vb}]
+# Sort using and Import directives with System.* appearing first
+dotnet_sort_system_directives_first = true
+# Avoid "this." and "Me." if not necessary
+dotnet_style_qualification_for_field = false:suggestion
+dotnet_style_qualification_for_property = false:suggestion
+dotnet_style_qualification_for_method = false:suggestion
+dotnet_style_qualification_for_event = false:suggestion
+
+# Use language keywords instead of framework type names for type references
+dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
+dotnet_style_predefined_type_for_member_access = true:suggestion
+
+# Suggest more modern language features when available
+dotnet_style_object_initializer = true:suggestion
+dotnet_style_collection_initializer = true:suggestion
+dotnet_style_coalesce_expression = true:suggestion
+dotnet_style_null_propagation = true:suggestion
+dotnet_style_explicit_tuple_names = true:suggestion
+
+# CSharp code style settings:
+[*.cs]
+# Prefer "var" everywhere
+csharp_style_var_for_built_in_types = true:suggestion
+csharp_style_var_when_type_is_apparent = true:suggestion
+csharp_style_var_elsewhere = true:suggestion
+
+# Prefer method-like constructs to have a block body
+csharp_style_expression_bodied_methods = false:none
+csharp_style_expression_bodied_constructors = false:none
+csharp_style_expression_bodied_operators = false:none
+
+# Prefer property-like constructs to have an expression-body
+csharp_style_expression_bodied_properties = true:none
+csharp_style_expression_bodied_indexers = true:none
+csharp_style_expression_bodied_accessors = true:none
+
+# Suggest more modern language features when available
+csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
+csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
+csharp_style_inlined_variable_declaration = true:suggestion
+csharp_style_throw_expression = true:suggestion
+csharp_style_conditional_delegate_call = true:suggestion
+
+# Newline settings
+csharp_new_line_before_open_brace = all
+csharp_new_line_before_else = true
+csharp_new_line_before_catch = true
+csharp_new_line_before_finally = true
+csharp_new_line_before_members_in_object_initializers = true
+csharp_new_line_before_members_in_anonymous_types = true

+ 14 - 17
Ix.NET/Source/Directory.build.props

@@ -6,43 +6,40 @@
     <MinClientVersion>2.12</MinClientVersion>
     <GenerateDocumentationFile Condition=" '$(Configuration)' == 'Release' ">true</GenerateDocumentationFile>
     <Authors>.NET Foundation and Contributors</Authors>
-    <UseFullSemVerForNuGet>true</UseFullSemVerForNuGet>
     <PackageIconUrl>http://go.microsoft.com/fwlink/?LinkId=261274</PackageIconUrl>
     <PackageProjectUrl>http://go.microsoft.com/fwlink/?LinkId=261273</PackageProjectUrl>
     <PackageLicenseUrl>https://raw.githubusercontent.com/Reactive-Extensions/Rx.NET/master/Ix.NET/Source/license.txt</PackageLicenseUrl>
     <PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>    
     <SignAssembly>true</SignAssembly>
     <AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)ReactiveX.snk</AssemblyOriginatorKeyFile>
-    <NoWarn>$(NoWarn);CS1591</NoWarn>
+    <NoWarn>$(NoWarn);1701;1702;CS1591</NoWarn>
     <DefaultLanguage>en-US</DefaultLanguage>
-    <WriteVersionInfoToBuildLog>false</WriteVersionInfoToBuildLog>
     <IncludeSymbols>false</IncludeSymbols>
     <IsTestProject>$(MSBuildProjectName.Contains('Test'))</IsTestProject>
-    
-    <GetVersion Condition=" '$(NCrunch)' != '' ">false</GetVersion>
   </PropertyGroup>
   
-  <ItemGroup>
-    <PackageReference Include="GitVersionTask" Version="4.0.0-beta0011" PrivateAssets="All" /> 
-  </ItemGroup>
-  
   <ItemGroup Condition="'$(IsTestProject)' != 'true' and '$(NCrunch)' == '' and '$(SourceLinkEnabled)' != 'false'">
-    <PackageReference Include="SourceLink.Create.CommandLine" Version="2.1.0" PrivateAssets="All" /> 
+    <PackageReference Include="SourceLink.Create.CommandLine" Version="2.1.2" PrivateAssets="All" /> 
   </ItemGroup>
   
     <!-- Workaround -->
   <Target Name="GetPackagingOutputs" />
-   <PropertyGroup>
-    <GitVersionTaskVersion>4.0.0-beta0011</GitVersionTaskVersion>
+  
+  <PropertyGroup>
+    <NerdbankGitVersioningVersion>2.0.21-beta</NerdbankGitVersioningVersion>
   </PropertyGroup>
+  
+  <ItemGroup>
+    <PackageReference Include="Nerdbank.GitVersioning" Version="2.0.21-beta" PrivateAssets="all" />
+  </ItemGroup>
 
   <!-- https://github.com/NuGet/Home/issues/4337 -->
   <ImportGroup Condition=" '$(ExcludeRestorePackageImports)' == 'true' ">
-    <Import Project="$(UserProfile)\.nuget\packages\GitVersionTask\$(GitVersionTaskVersion)\buildMultiTargeting\GitVersionTask.targets"
-            Condition="Exists('$(UserProfile)\.nuget\packages\GitVersionTask\$(GitVersionTaskVersion)\buildMultiTargeting\GitVersionTask.targets')" />
+    <Import Project="$(UserProfile)\.nuget\packages\nerdbank.gitversioning\$(NerdbankGitVersioningVersion)\buildCrossTargeting\Nerdbank.GitVersioning.targets"
+            Condition="Exists('$(UserProfile)\.nuget\packages\nerdbank.gitversioning\$(NerdbankGitVersioningVersion)\buildCrossTargeting\Nerdbank.GitVersioning.targets')" />
   </ImportGroup>
-  <Target Name="FixupVersion"
+  <Target Name="FixUpVersion"
       BeforeTargets="_GenerateRestoreProjectSpec"
-      DependsOnTargets="GetVersion"
-      Condition=" '$(GitVersion_Task_targets_Imported)' == 'True' " />
+      DependsOnTargets="GetBuildVersion"
+      Condition=" '$(NerdbankGitVersioningTasksPath)' != '' " />
 </Project>

文件差异内容过多而无法显示
+ 0 - 21
Ix.NET/Source/Ix.NET.sln.DotSettings


+ 0 - 6
Ix.NET/Source/Ix.NET.v3.ncrunchsolution

@@ -1,6 +0,0 @@
-<SolutionConfiguration>
-  <Settings>
-    <AllowParallelTestExecution>True</AllowParallelTestExecution>
-    <SolutionConfigured>True</SolutionConfigured>
-  </Settings>
-</SolutionConfiguration>

+ 0 - 23
Ix.NET/Source/NuSpecs/System.Interactive.Async.Providers.nuspec

@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
-  <metadata>
-    <id>System.Interactive.Async.Providers</id>
-    <version>$version$</version>
-    <authors>.NET Foundation and Contributors</authors>
-    <owners>Microsoft,RxTeam</owners>
-    <licenseUrl>http://go.microsoft.com/fwlink/?LinkID=261272</licenseUrl>
-    <projectUrl>http://go.microsoft.com/fwlink/?LinkId=261273</projectUrl>
-    <iconUrl>http://go.microsoft.com/fwlink/?LinkId=261274</iconUrl>
-    <requireLicenseAcceptance>false</requireLicenseAcceptance>
-    <description>Interactive Extensions Providers Library used to build async query providers and express queries over enumerable sequences.</description>
-    <copyright>Copyright (c) .NET Foundation and Contributors. All Rights Reserved</copyright>
-    <language>en-US</language>
-    <tags>Ix Interactive Extensions Enumerable Async</tags>
-    <dependencies>
-      <dependency id="System.Interactive.Async" version="$version$" />
-    </dependencies>
-  </metadata>
-  <files>
-    <file src="..\System.Interactive.Async.Providers\bin\$configuration$\**\System.Interactive.Async.Providers.*" exclude="**\*.deps.json" target="lib" />
-  </files>
-</package>

+ 0 - 27
Ix.NET/Source/NuSpecs/System.Interactive.Async.nuspec

@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
-  <metadata>
-    <id>System.Interactive.Async</id>
-    <title>System.Interactive.Async (Ix Async)</title>
-    <version>$version$</version>
-    <authors>.NET Foundation and Contributors</authors>
-    <owners>Microsoft,RxTeam</owners>
-    <licenseUrl>http://go.microsoft.com/fwlink/?LinkID=261272</licenseUrl>
-    <projectUrl>http://go.microsoft.com/fwlink/?LinkId=261273</projectUrl>
-    <iconUrl>http://go.microsoft.com/fwlink/?LinkId=261274</iconUrl>
-    <requireLicenseAcceptance>false</requireLicenseAcceptance>
-    <description>Interactive Extensions (Ix) Async Library used to express queries over asynchronous enumerable sequences.</description>
-    <copyright>Copyright (c) .NET Foundation and Contributors. All Rights Reserved</copyright>
-    <language>en-US</language>
-    <tags>Ix Interactive Extensions Enumerable Asynchronous</tags>
-    <dependencies>
-     <group targetFramework="netstandard1.0">       
-        <dependency id="NETStandard.Library" version="1.6.0" />
-     </group>
-     <group targetFramework="net45" />
-    </dependencies>
-  </metadata>
-  <files>
-    <file src="..\System.Interactive.Async\bin\$configuration$\**\System.Interactive.Async.*" exclude="**\*.deps.json" target="lib" />
-  </files>
-</package>

+ 0 - 23
Ix.NET/Source/NuSpecs/System.Interactive.Providers.nuspec

@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
-  <metadata>
-    <id>System.Interactive.Providers</id>
-    <version>$version$</version>
-    <authors>.NET Foundation and Contributors</authors>
-    <owners>Microsoft,RxTeam</owners>
-    <licenseUrl>http://go.microsoft.com/fwlink/?LinkID=261272</licenseUrl>
-    <projectUrl>http://go.microsoft.com/fwlink/?LinkId=261273</projectUrl>
-    <iconUrl>http://go.microsoft.com/fwlink/?LinkId=261274</iconUrl>
-    <requireLicenseAcceptance>false</requireLicenseAcceptance>
-    <description>Interactive Extensions Providers Library used to build query providers and express queries over enumerable sequences.</description>
-    <copyright>Copyright (c) .NET Foundation and Contributors. All Rights Reserved</copyright>
-    <language>en-US</language>
-    <tags>Ix Interactive Extensions Enumerable</tags>
-    <dependencies>
-      <dependency id="System.Interactive" version="$version$" />
-    </dependencies>
-  </metadata>
-  <files>
-    <file src="..\System.Interactive.Providers\bin\$configuration$\**\System.Interactive.Providers.*" exclude="**\*.deps.json" target="lib" />
-  </files>
-</package>

+ 0 - 27
Ix.NET/Source/NuSpecs/System.Interactive.nuspec

@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
-  <metadata>
-    <id>System.Interactive</id>
-    <title>System.Interactive (Ix)</title>
-    <version>$version$</version>
-    <authors>.NET Foundation and Contributors</authors>
-    <owners>Microsoft,RxTeam</owners>
-    <licenseUrl>http://go.microsoft.com/fwlink/?LinkID=261272</licenseUrl>
-    <projectUrl>http://go.microsoft.com/fwlink/?LinkId=261273</projectUrl>
-    <iconUrl>http://go.microsoft.com/fwlink/?LinkId=261274</iconUrl>
-    <requireLicenseAcceptance>false</requireLicenseAcceptance>
-    <description>Interactive Extensions (Ix) Main Library used to express queries over enumerable sequences.</description>
-    <copyright>Copyright (c) .NET Foundation and Contributors. All Rights Reserved</copyright>
-    <language>en-US</language>
-    <tags>Ix Interactive Extensions Enumerable</tags>
-    <dependencies>
-     <group targetFramework="netstandard1.0">       
-        <dependency id="NETStandard.Library" version="1.6.0" />
-     </group>
-     <group targetFramework="net45" />
-    </dependencies>
-  </metadata>
-  <files>
-    <file src="..\System.Interactive\bin\$configuration$\**\System.Interactive.*" exclude="**\*.deps.json" target="lib" />
-  </files>
-</package>

+ 2 - 4
Ix.NET/Source/System.Interactive.Async.Providers/AsyncQueryable.cs

@@ -23,8 +23,7 @@ namespace System.Linq
             if (source == null)
                 throw new ArgumentNullException(nameof(source));
 
-            var queryable = source as IAsyncQueryable<TElement>;
-            if (queryable != null)
+            if (source is IAsyncQueryable<TElement> queryable)
             {
                 return queryable;
             }
@@ -34,8 +33,7 @@ namespace System.Linq
 
         private static Expression GetSourceExpression<TSource>(IAsyncEnumerable<TSource> source)
         {
-            var queryable = source as IAsyncQueryable<TSource>;
-            if (queryable != null)
+            if (source is IAsyncQueryable<TSource> queryable)
             {
                 return queryable.Expression;
             }

+ 0 - 5
Ix.NET/Source/System.Interactive.Async.Providers/System.Interactive.Async.Providers.v3.ncrunchproject

@@ -1,5 +0,0 @@
-<ProjectConfiguration>
-  <Settings>
-    <PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully>
-  </Settings>
-</ProjectConfiguration>

+ 6 - 12
Ix.NET/Source/System.Interactive.Async/AppendPrepend.cs

@@ -18,8 +18,7 @@ namespace System.Linq
             if (source == null)
                 throw new ArgumentNullException(nameof(source));
 
-            var appendable = source as AppendPrepentAsyncIterator<TSource>;
-            if (appendable != null)
+            if (source is AppendPrepentAsyncIterator<TSource> appendable)
             {
                 return appendable.Append(element);
             }
@@ -32,8 +31,7 @@ namespace System.Linq
             if (source == null)
                 throw new ArgumentNullException(nameof(source));
 
-            var appendable = source as AppendPrepentAsyncIterator<TSource>;
-            if (appendable != null)
+            if (source is AppendPrepentAsyncIterator<TSource> appendable)
             {
                 return appendable.Prepend(element);
             }
@@ -197,8 +195,7 @@ namespace System.Linq
                     index = 1;
                 }
 
-                var sourceCollection = source as ICollection<TSource>;
-                if (sourceCollection != null)
+                if (source is ICollection<TSource> sourceCollection)
                 {
                     sourceCollection.CopyTo(array, index);
                 }
@@ -253,8 +250,7 @@ namespace System.Linq
 
             public override async Task<int> GetCountAsync(bool onlyIfCheap, CancellationToken cancellationToken)
             {
-                var listProv = source as IIListProvider<TSource>;
-                if (listProv != null)
+                if (source is IIListProvider<TSource> listProv)
                 {
                     var count = await listProv.GetCountAsync(onlyIfCheap, cancellationToken).ConfigureAwait(false);
                     return count == -1 ? -1 : count + 1;
@@ -433,8 +429,7 @@ namespace System.Linq
                     ++index;
                 }
 
-                var sourceCollection = source as ICollection<TSource>;
-                if (sourceCollection != null)
+                if (source is ICollection<TSource> sourceCollection)
                 {
                     sourceCollection.CopyTo(array, index);
                 }
@@ -496,8 +491,7 @@ namespace System.Linq
 
             public override async Task<int> GetCountAsync(bool onlyIfCheap, CancellationToken cancellationToken)
             {
-                var listProv = source as IIListProvider<TSource>;
-                if (listProv != null)
+                if (source is IIListProvider<TSource> listProv)
                 {
                     var count = await listProv.GetCountAsync(onlyIfCheap, cancellationToken).ConfigureAwait(false);
                     return count == -1 ? -1 : count + (appended == null ? 0 : appended.Count) + (prepended == null ? 0 : prepended.Count);

+ 1 - 2
Ix.NET/Source/System.Interactive.Async/AsyncEnumerableHelpers.cs

@@ -24,8 +24,7 @@ namespace System.Collections.Generic
             var result = new ArrayWithLength<T>();
             // Check for short circuit optimizations. This one is very unlikely
             // but could be here as a group
-            var ic = source as ICollection<T>;
-            if (ic != null)
+            if (source is ICollection<T> ic)
             {
                 var count = ic.Count;
                 if (count != 0)

+ 1 - 2
Ix.NET/Source/System.Interactive.Async/Cast.cs

@@ -17,8 +17,7 @@ namespace System.Linq
                 throw new ArgumentNullException(nameof(source));
 
             // Check to see if it already is and short-circuit
-            var typedSource = source as IAsyncEnumerable<TResult>;
-            if (typedSource != null)
+            if (source is IAsyncEnumerable<TResult> typedSource)
             {
                 return typedSource;
             }

+ 1 - 2
Ix.NET/Source/System.Interactive.Async/Concatenate.cs

@@ -343,8 +343,7 @@ namespace System.Linq
                         return current.next;
                     }
 
-                    var prevN = current.previousConcat as ConcatNAsyncIterator<TSource>;
-                    if (prevN != null)
+                    if (current.previousConcat is ConcatNAsyncIterator<TSource> prevN)
                     {
                         current = prevN;
                         continue;

+ 2 - 4
Ix.NET/Source/System.Interactive.Async/Count.cs

@@ -17,14 +17,12 @@ namespace System.Linq
             if (source == null)
                 throw new ArgumentNullException(nameof(source));
 
-            var collection = source as ICollection<TSource>;
-            if (collection != null)
+            if (source is ICollection<TSource> collection)
             {
                 return Task.FromResult(collection.Count);
             }
 
-            var listProv = source as IIListProvider<TSource>;
-            if (listProv != null)
+            if (source is IIListProvider<TSource> listProv)
             {
                 return listProv.GetCountAsync(false, cancellationToken);
             }

+ 1 - 2
Ix.NET/Source/System.Interactive.Async/ElementAt.cs

@@ -51,8 +51,7 @@ namespace System.Linq
 
         private static async Task<TSource> ElementAt_<TSource>(IAsyncEnumerable<TSource> source, int index, CancellationToken cancellationToken)
         {
-            var list = source as IList<TSource>;
-            if (list != null)
+            if (source is IList<TSource> list)
             {
                 return list[index];
             }

+ 2 - 4
Ix.NET/Source/System.Interactive.Async/Last.cs

@@ -91,8 +91,7 @@ namespace System.Linq
             var last = default(TSource);
             var hasLast = false;
 
-            var list = source as IList<TSource>;
-            if (list != null)
+            if (source is IList<TSource> list)
             {
                 var count = list.Count;
                 if (count > 0)
@@ -120,8 +119,7 @@ namespace System.Linq
             var last = default(TSource);
             var hasLast = false;
 
-            var list = source as IList<TSource>;
-            if (list != null)
+            if (source is IList<TSource> list)
             {
                 var count = list.Count;
                 if (count > 0)

+ 7 - 5
Ix.NET/Source/System.Interactive.Async/Lookup.cs

@@ -267,11 +267,13 @@ namespace System.Linq.Internal
                 }
 
                 var index = hashCode%_groupings.Length;
-                var g = new Grouping<TKey, TElement>();
-                g._key = key;
-                g._hashCode = hashCode;
-                g._elements = new TElement[1];
-                g._hashNext = _groupings[index];
+                var g = new Grouping<TKey, TElement>
+                {
+                    _key = key,
+                    _hashCode = hashCode,
+                    _elements = new TElement[1],
+                    _hashNext = _groupings[index]
+                };
                 _groupings[index] = g;
                 if (_lastGrouping == null)
                 {

+ 1 - 2
Ix.NET/Source/System.Interactive.Async/Reverse.cs

@@ -64,8 +64,7 @@ namespace System.Linq
             {
                 if (onlyIfCheap)
                 {
-                    var listProv = source as IIListProvider<TSource>;
-                    if (listProv != null)
+                    if (source is IIListProvider<TSource> listProv)
                     {
                         return listProv.GetCountAsync(true, cancellationToken);
                     }

+ 3 - 5
Ix.NET/Source/System.Interactive.Async/Select.cs

@@ -17,15 +17,13 @@ namespace System.Linq
                 throw new ArgumentNullException(nameof(source));
             if (selector == null)
                 throw new ArgumentNullException(nameof(selector));
-            
-            var iterator = source as AsyncIterator<TSource>;
-            if (iterator != null)
+
+            if (source is AsyncIterator<TSource> iterator)
             {
                 return iterator.Select(selector);
             }
 
-            var ilist = source as IList<TSource>;
-            if (ilist != null)
+            if (source is IList<TSource> ilist)
             {
                 return new SelectIListIterator<TSource, TResult>(ilist, selector);
             }

+ 2 - 4
Ix.NET/Source/System.Interactive.Async/SequenceEqual.cs

@@ -60,11 +60,9 @@ namespace System.Linq
         private static async Task<bool> SequenceEqual_<TSource>(IAsyncEnumerable<TSource> first, IAsyncEnumerable<TSource> second, IEqualityComparer<TSource> comparer,
                                                                 CancellationToken cancellationToken)
         {
-            var firstCol = first as ICollection<TSource>;
-            if (firstCol != null)
+            if (first is ICollection<TSource> firstCol)
             {
-                var secondCol = second as ICollection<TSource>;
-                if (secondCol != null && firstCol.Count != secondCol.Count)
+                if (second is ICollection<TSource> secondCol && firstCol.Count != secondCol.Count)
                 {
                     return false;
                 }

+ 2 - 4
Ix.NET/Source/System.Interactive.Async/Single.cs

@@ -89,8 +89,7 @@ namespace System.Linq
 
         private static async Task<TSource> Single_<TSource>(IAsyncEnumerable<TSource> source, CancellationToken cancellationToken)
         {
-            var list = source as IList<TSource>;
-            if (list != null)
+            if (source is IList<TSource> list)
             {
                 switch (list.Count)
                 {
@@ -119,8 +118,7 @@ namespace System.Linq
 
         private static async Task<TSource> SingleOrDefault_<TSource>(IAsyncEnumerable<TSource> source, CancellationToken cancellationToken)
         {
-            var list = source as IList<TSource>;
-            if (list != null)
+            if (source is IList<TSource> list)
             {
                 switch (list.Count)
                 {

+ 0 - 5
Ix.NET/Source/System.Interactive.Async/System.Interactive.Async.v3.ncrunchproject

@@ -1,5 +0,0 @@
-<ProjectConfiguration>
-  <Settings>
-    <PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully>
-  </Settings>
-</ProjectConfiguration>

+ 2 - 4
Ix.NET/Source/System.Interactive.Async/ToAsyncEnumerable.cs

@@ -18,12 +18,10 @@ namespace System.Linq
                 throw new ArgumentNullException(nameof(source));
 
             // optimize these adapters for lists and collections
-            var list = source as IList<TSource>;
-            if (list != null)
+            if (source is IList<TSource> list)
                 return new AsyncIListEnumerableAdapter<TSource>(list);
 
-            var collection = source as ICollection<TSource>;
-            if (collection != null)
+            if (source is ICollection<TSource> collection)
                 return new AsyncICollectionEnumerableAdapter<TSource>(collection);
 
             return new AsyncEnumerableAdapter<TSource>(source);

+ 2 - 4
Ix.NET/Source/System.Interactive.Async/ToCollection.cs

@@ -25,8 +25,7 @@ namespace System.Linq
             if (source == null)
                 throw new ArgumentNullException(nameof(source));
 
-            var arrayProvider = source as IIListProvider<TSource>;
-            if (arrayProvider != null)
+            if (source is IIListProvider<TSource> arrayProvider)
                 return arrayProvider.ToArrayAsync(cancellationToken);
 
             return AsyncEnumerableHelpers.ToArray(source, cancellationToken);
@@ -145,8 +144,7 @@ namespace System.Linq
             if (source == null)
                 throw new ArgumentNullException(nameof(source));
 
-            var listProvider = source as IIListProvider<TSource>;
-            if (listProvider != null)
+            if (source is IIListProvider<TSource> listProvider)
                 return listProvider.ToListAsync(cancellationToken);
 
             return source.Aggregate(new List<TSource>(), (list, x) =>

+ 1 - 2
Ix.NET/Source/System.Interactive.Async/Where.cs

@@ -18,8 +18,7 @@ namespace System.Linq
             if (predicate == null)
                 throw new ArgumentNullException(nameof(predicate));
 
-            var iterator = source as AsyncIterator<TSource>;
-            if (iterator != null)
+            if (source is AsyncIterator<TSource> iterator)
             {
                 return iterator.Where(predicate);
             }

+ 3 - 6
Ix.NET/Source/System.Interactive.Providers/QueryableEx.cs

@@ -2401,13 +2401,11 @@ namespace System.Linq
 
             private static Expression Redir(Expression expression)
             {
-                var mce = expression as MethodCallExpression;
-                if (mce != null && mce.Method.DeclaringType == typeof(QueryableEx))
+                if (expression is MethodCallExpression mce && mce.Method.DeclaringType == typeof(QueryableEx))
                 {
                     if (mce.Arguments.Count >= 1 && typeof(IQueryProvider).IsAssignableFrom(mce.Arguments[0].Type))
                     {
-                        var ce = mce.Arguments[0] as ConstantExpression;
-                        if (ce != null)
+                        if (mce.Arguments[0] is ConstantExpression ce)
                         {
                             if (ce.Value is QueryProviderShim)
                             {
@@ -2525,8 +2523,7 @@ namespace System.Linq
 
         internal static Expression GetSourceExpression<TSource>(IEnumerable<TSource> source)
         {
-            var q = source as IQueryable<TSource>;
-            if (q != null)
+            if (source is IQueryable<TSource> q)
                 return q.Expression;
 
             return Expression.Constant(source, typeof(IEnumerable<TSource>));

二进制
Ix.NET/Source/System.Interactive.Tests.Uwp.DeviceRunner/AppPackages/System.Interactive.Tests.Uwp.DeviceRunner_1.0.0.0_x86_Test/System.Interactive.Tests.Uwp.DeviceRunner_1.0.0.0_x86.appx


+ 4 - 3
Ix.NET/Source/System.Interactive.Tests.Uwp.DeviceRunner/System.Interactive.Tests.Uwp.DeviceRunner.csproj

@@ -17,6 +17,7 @@
     <FileAlignment>512</FileAlignment>
     <ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
     <PackageCertificateKeyFile>System.Interactive.Tests.Uwp.DeviceRunner_TemporaryKey.pfx</PackageCertificateKeyFile>
+    <PackageCertificateThumbprint>422BF5D1CFB50C975293A3158EA46852395F42CF</PackageCertificateThumbprint>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
     <DebugSymbols>true</DebugSymbols>
@@ -88,9 +89,9 @@
     <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
   </PropertyGroup>
   <ItemGroup>
-    <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="5.3.0" />
+    <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="5.3.3" />
     <PackageReference Include="xunit" Version="2.2.0" />
-    <PackageReference Include="xunit.runner.devices" Version="2.2.0-rc1" />
+    <PackageReference Include="xunit.runner.devices" Version="2.2.0" />
     <PackageReference Include="FluentAssertions" Version="4.19.2" />
   </ItemGroup>
   <ItemGroup>
@@ -211,7 +212,7 @@
     <VisualStudioVersion>14.0</VisualStudioVersion>
   </PropertyGroup>
   <PropertyGroup>
-    <SignAssembly>true</SignAssembly>
+    <SignAssembly>false</SignAssembly>
   </PropertyGroup>
   <PropertyGroup>
     <AssemblyOriginatorKeyFile>..\ReactiveX.snk</AssemblyOriginatorKeyFile>

+ 0 - 5
Ix.NET/Source/System.Interactive.Tests.Uwp.DeviceRunner/System.Interactive.Tests.Uwp.DeviceRunner.v3.ncrunchproject

@@ -1,5 +0,0 @@
-<ProjectConfiguration>
-  <Settings>
-    <IgnoreThisComponentCompletely>True</IgnoreThisComponentCompletely>
-  </Settings>
-</ProjectConfiguration>

二进制
Ix.NET/Source/System.Interactive.Tests.Uwp.DeviceRunner/System.Interactive.Tests.Uwp.DeviceRunner_TemporaryKey.pfx


+ 1 - 2
Ix.NET/Source/System.Interactive/Case.cs

@@ -53,8 +53,7 @@ namespace System.Linq
 
             return Defer(() =>
                          {
-                             IEnumerable<TResult> result;
-                             if (!sources.TryGetValue(selector(), out result))
+                             if (!sources.TryGetValue(selector(), out var result))
                                  result = defaultSource;
                              return result;
                          });

+ 1 - 2
Ix.NET/Source/System.Interactive/Memoize.cs

@@ -333,8 +333,7 @@ namespace System.Linq
             {
                 Debug.Assert(i < _count);
 
-                var res = default(RefCount);
-                if (!_list.TryGetValue(i, out res))
+                if (!_list.TryGetValue(i, out var res))
                     throw new InvalidOperationException("Element no longer available in the buffer.");
 
                 var val = res.Value;

+ 0 - 5
Ix.NET/Source/System.Interactive/System.Interactive.v3.ncrunchproject

@@ -1,5 +0,0 @@
-<ProjectConfiguration>
-  <Settings>
-    <PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully>
-  </Settings>
-</ProjectConfiguration>

+ 15 - 13
Ix.NET/Source/Tests/AsyncTests.Aggregates.cs

@@ -48,7 +48,7 @@ namespace Tests
         {
             var xs = new[] { 1, 2, 3, 4 }.ToAsyncEnumerable();
             var ys = xs.Aggregate((x, y) => x * y);
-            Assert.Equal(ys.Result, 24);
+            Assert.Equal(24, ys.Result);
         }
 
         [Fact]
@@ -82,7 +82,7 @@ namespace Tests
         {
             var xs = new[] { 1, 2, 3, 4 }.ToAsyncEnumerable();
             var ys = xs.Aggregate(1, (x, y) => x * y);
-            Assert.Equal(ys.Result, 24);
+            Assert.Equal(24, ys.Result);
         }
 
         [Fact]
@@ -90,7 +90,7 @@ namespace Tests
         {
             var xs = new int[0].ToAsyncEnumerable();
             var ys = xs.Aggregate(1, (x, y) => x * y);
-            Assert.Equal(ys.Result, 1);
+            Assert.Equal(1, ys.Result);
         }
 
         [Fact]
@@ -116,7 +116,7 @@ namespace Tests
         {
             var xs = new[] { 1, 2, 3, 4 }.ToAsyncEnumerable();
             var ys = xs.Aggregate(1, (x, y) => x * y, x => x + 1);
-            Assert.Equal(ys.Result, 25);
+            Assert.Equal(25, ys.Result);
         }
 
         [Fact]
@@ -124,7 +124,7 @@ namespace Tests
         {
             var xs = new int[0].ToAsyncEnumerable();
             var ys = xs.Aggregate(1, (x, y) => x * y, x => x + 1);
-            Assert.Equal(ys.Result, 2);
+            Assert.Equal(2, ys.Result);
         }
 
         [Fact]
@@ -169,16 +169,16 @@ namespace Tests
         [Fact]
         public void Count1()
         {
-            Assert.Equal(new int[0].ToAsyncEnumerable().Count().Result, 0);
-            Assert.Equal(new[] { 1, 2, 3 }.ToAsyncEnumerable().Count().Result, 3);
+            Assert.Equal(0, new int[0].ToAsyncEnumerable().Count().Result);
+            Assert.Equal(3, new[] { 1, 2, 3 }.ToAsyncEnumerable().Count().Result);
             AssertThrows<AggregateException>(() => AsyncEnumerable.Throw<int>(new Exception("Bang!")).Count().Wait(WaitTimeoutMs));
         }
 
         [Fact]
         public void Count2()
         {
-            Assert.Equal(new int[0].ToAsyncEnumerable().Count(x => x < 3).Result, 0);
-            Assert.Equal(new[] { 1, 2, 3 }.ToAsyncEnumerable().Count(x => x < 3).Result, 2);
+            Assert.Equal(0, new int[0].ToAsyncEnumerable().Count(x => x < 3).Result);
+            Assert.Equal(2, new[] { 1, 2, 3 }.ToAsyncEnumerable().Count(x => x < 3).Result);
             AssertThrows<AggregateException>(() => AsyncEnumerable.Throw<int>(new Exception("Bang!")).Count(x => x < 3).Wait(WaitTimeoutMs));
         }
 
@@ -205,16 +205,16 @@ namespace Tests
         [Fact]
         public void LongCount1()
         {
-            Assert.Equal(new int[0].ToAsyncEnumerable().LongCount().Result, 0);
-            Assert.Equal(new[] { 1, 2, 3 }.ToAsyncEnumerable().LongCount().Result, 3);
+            Assert.Equal(0, new int[0].ToAsyncEnumerable().LongCount().Result);
+            Assert.Equal(3, new[] { 1, 2, 3 }.ToAsyncEnumerable().LongCount().Result);
             AssertThrows<AggregateException>(() => AsyncEnumerable.Throw<int>(new Exception("Bang!")).LongCount().Wait(WaitTimeoutMs));
         }
 
         [Fact]
         public void LongCount2()
         {
-            Assert.Equal(new int[0].ToAsyncEnumerable().LongCount(x => x < 3).Result, 0);
-            Assert.Equal(new[] { 1, 2, 3 }.ToAsyncEnumerable().LongCount(x => x < 3).Result, 2);
+            Assert.Equal(0, new int[0].ToAsyncEnumerable().LongCount(x => x < 3).Result);
+            Assert.Equal(2, new[] { 1, 2, 3 }.ToAsyncEnumerable().LongCount(x => x < 3).Result);
             AssertThrows<AggregateException>(() => AsyncEnumerable.Throw<int>(new Exception("Bang!")).LongCount(x => x < 3).Wait(WaitTimeoutMs));
         }
 
@@ -1306,8 +1306,10 @@ namespace Tests
         {
             var xs = new[] { 1, 4, 2 }.ToAsyncEnumerable();
             var res = xs.ToLookup(x => x % 2).Result;
+#pragma warning disable IDE0007 // Use implicit type
             foreach (IGrouping<int, int> g in (IEnumerable)res)
                 Assert.True(g.Key == 0 || g.Key == 1);
+#pragma warning restore IDE0007 // Use implicit type
         }
 
         [Fact]

+ 26 - 26
Ix.NET/Source/Tests/AsyncTests.Single.cs

@@ -1822,7 +1822,7 @@ namespace Tests
             var ys = xs.OrderBy(x => x);
 
             var e = ys.GetEnumerator();
-            for (int i = 0; i < 10; i++)
+            for (var i = 0; i < 10; i++)
                 HasNext(e, i);
             NoNext(e);
         }
@@ -1852,7 +1852,7 @@ namespace Tests
         {
             var ex = new Exception("Bang!");
             var xs = new[] { 2, 6, 1, 5, 7, 8, 9, 3, 4, 0 }.ToAsyncEnumerable();
-            var ys = xs.OrderBy<int, int>(x => x).ThenBy<int, int>(x => { throw ex; });
+            var ys = xs.OrderBy(x => x).ThenBy<int, int>(x => { throw ex; });
 
             var e = ys.GetEnumerator();
             AssertThrows<Exception>(() => e.MoveNext().Wait(WaitTimeoutMs), ex_ => ((AggregateException)ex_).Flatten().InnerExceptions.Single() == ex);
@@ -1865,7 +1865,7 @@ namespace Tests
             var ys = xs.OrderByDescending(x => x);
 
             var e = ys.GetEnumerator();
-            for (int i = 9; i >= 0; i--)
+            for (var i = 9; i >= 0; i--)
                 HasNext(e, i);
             NoNext(e);
         }
@@ -2045,7 +2045,7 @@ namespace Tests
             var e = res.GetEnumerator();
 
             Assert.True(e.MoveNext().Result);
-            Assert.Equal(e.Current.Key, 2);
+            Assert.Equal(2, e.Current.Key);
             var g1 = e.Current.GetEnumerator();
             HasNext(g1, xs[0]);
             HasNext(g1, xs[2]);
@@ -2054,19 +2054,19 @@ namespace Tests
             NoNext(g1);
 
             Assert.True(e.MoveNext().Result);
-            Assert.Equal(e.Current.Key, 6);
+            Assert.Equal(6, e.Current.Key);
             var g2 = e.Current.GetEnumerator();
             HasNext(g2, xs[1]);
             NoNext(g2);
 
             Assert.True(e.MoveNext().Result);
-            Assert.Equal(e.Current.Key, 1);
+            Assert.Equal(1, e.Current.Key);
             var g3 = e.Current.GetEnumerator();
             HasNext(g3, xs[3]);
             NoNext(g3);
 
             Assert.True(e.MoveNext().Result);
-            Assert.Equal(e.Current.Key, 4);
+            Assert.Equal(4, e.Current.Key);
             var g4 = e.Current.GetEnumerator();
             HasNext(g4, xs[6]);
             NoNext(g4);
@@ -2095,19 +2095,19 @@ namespace Tests
 
             Assert.True(e.MoveNext().Result);
             var g1 = e.Current;
-            Assert.Equal(g1.Key, 2);
+            Assert.Equal(2, g1.Key);
 
             Assert.True(e.MoveNext().Result);
             var g2 = e.Current;
-            Assert.Equal(g2.Key, 6);
+            Assert.Equal(6, g2.Key);
 
             Assert.True(e.MoveNext().Result);
             var g3 = e.Current;
-            Assert.Equal(g3.Key, 1);
+            Assert.Equal(1, g3.Key);
 
             Assert.True(e.MoveNext().Result);
             var g4 = e.Current;
-            Assert.Equal(g4.Key, 4);
+            Assert.Equal(4, g4.Key);
 
             NoNext(e);
 
@@ -2255,7 +2255,7 @@ namespace Tests
 
             Assert.True(e.MoveNext().Result);
             var g1 = e.Current;
-            Assert.Equal(g1.Key, 0);
+            Assert.Equal(0, g1.Key);
             var g1e = g1.GetEnumerator();
             HasNext(g1e, 'a');
             HasNext(g1e, 'd');
@@ -2265,7 +2265,7 @@ namespace Tests
 
             Assert.True(e.MoveNext().Result);
             var g2 = e.Current;
-            Assert.Equal(g2.Key, 1);
+            Assert.Equal(1, g2.Key);
             var g2e = g2.GetEnumerator();
             HasNext(g2e, 'b');
             HasNext(g2e, 'e');
@@ -2274,7 +2274,7 @@ namespace Tests
 
             Assert.True(e.MoveNext().Result);
             var g3 = e.Current;
-            Assert.Equal(g3.Key, 2);
+            Assert.Equal(2, g3.Key);
             var g3e = g3.GetEnumerator();
             HasNext(g3e, 'c');
             HasNext(g3e, 'f');
@@ -2320,7 +2320,7 @@ namespace Tests
 
             Assert.True(e.MoveNext().Result);
             var g1 = e.Current;
-            Assert.Equal(g1.Key, 0);
+            Assert.Equal(0, g1.Key);
             var g1e = g1.GetEnumerator();
             HasNext(g1e, 0);
             HasNext(g1e, 3);
@@ -2330,7 +2330,7 @@ namespace Tests
 
             Assert.True(e.MoveNext().Result);
             var g2 = e.Current;
-            Assert.Equal(g2.Key, 1);
+            Assert.Equal(1, g2.Key);
             var g2e = g2.GetEnumerator();
             HasNext(g2e, 1);
             HasNext(g2e, 4);
@@ -2339,7 +2339,7 @@ namespace Tests
 
             Assert.True(e.MoveNext().Result);
             var g3 = e.Current;
-            Assert.Equal(g3.Key, 2);
+            Assert.Equal(2, g3.Key);
             var g3e = g3.GetEnumerator();
             HasNext(g3e, 2);
             HasNext(g3e, 5);
@@ -2359,7 +2359,7 @@ namespace Tests
 
             Assert.True(e.MoveNext().Result);
             var g1 = e.Current;
-            Assert.Equal(g1.Key, 0);
+            Assert.Equal(0, g1.Key);
             var g1e = g1.GetEnumerator();
             HasNext(g1e, 'a');
             HasNext(g1e, 'd');
@@ -2369,7 +2369,7 @@ namespace Tests
 
             Assert.True(e.MoveNext().Result);
             var g2 = e.Current;
-            Assert.Equal(g2.Key, 1);
+            Assert.Equal(1, g2.Key);
             var g2e = g2.GetEnumerator();
             HasNext(g2e, 'b');
             HasNext(g2e, 'e');
@@ -2378,7 +2378,7 @@ namespace Tests
 
             Assert.True(e.MoveNext().Result);
             var g3 = e.Current;
-            Assert.Equal(g3.Key, 2);
+            Assert.Equal(2, g3.Key);
             var g3e = g3.GetEnumerator();
             HasNext(g3e, 'c');
             HasNext(g3e, 'f');
@@ -2424,7 +2424,7 @@ namespace Tests
 
             Assert.True(e.MoveNext().Result);
             var g1 = e.Current;
-            Assert.Equal(g1.Key, 0);
+            Assert.Equal(0, g1.Key);
             var g1e = g1.GetEnumerator();
             HasNext(g1e, 'a');
             HasNext(g1e, 'd');
@@ -2435,7 +2435,7 @@ namespace Tests
 
             Assert.True(e.MoveNext().Result);
             var g2 = e.Current;
-            Assert.Equal(g2.Key, 1);
+            Assert.Equal(1, g2.Key);
             var g2e = g2.GetEnumerator();
             HasNext(g2e, 'b');
             HasNext(g2e, 'e');
@@ -2445,7 +2445,7 @@ namespace Tests
 
             Assert.True(e.MoveNext().Result);
             var g3 = e.Current;
-            Assert.Equal(g3.Key, 2);
+            Assert.Equal(2, g3.Key);
             var g3e = g3.GetEnumerator();
             HasNext(g3e, 'c');
             HasNext(g3e, 'f');
@@ -2480,7 +2480,7 @@ namespace Tests
 
             Assert.True(e.MoveNext().Result);
             var g1 = e.Current;
-            Assert.Equal(g1.Key, 0);
+            Assert.Equal(0, g1.Key);
             var g1e = g1.GetEnumerator();
             HasNext(g1e, 'a');
 
@@ -2810,7 +2810,7 @@ namespace Tests
             {
                 if (ReferenceEquals(null, obj)) return false;
                 if (ReferenceEquals(this, obj)) return true;
-                if (obj.GetType() != this.GetType()) return false;
+                if (obj.GetType() != GetType()) return false;
                 return Equals((Kvp)obj);
             }
 
@@ -3445,7 +3445,7 @@ namespace Tests
         [Fact]
         public void TakeLast_BugFix_TakeLast_Zero_TakesForever()
         {
-            bool isSet = false;
+            var isSet = false;
             new int[] { 1, 2, 3, 4 }.ToAsyncEnumerable()
                 .TakeLast(0)
                 .ForEachAsync(_ => { isSet = true; })

+ 2 - 0
Ix.NET/Source/Tests/AsyncTests.cs

@@ -18,6 +18,7 @@ namespace Tests
 {
     public partial class AsyncTests
     {
+#pragma warning disable xUnit1013 // Public method should be marked as test        
         public void AssertThrows<E>(Action a)
             where E : Exception
         {
@@ -85,5 +86,6 @@ namespace Tests
 
             e1Result.ShouldAllBeEquivalentTo(e2Result);
         }
+#pragma warning restore xUnit1013 // Public method should be marked as test        
     }
 }

+ 7 - 7
Ix.NET/Source/Tests/Tests.Creation.cs

@@ -56,14 +56,14 @@ namespace Tests
                 }
             });
 
-            int j = 0;
-            foreach (int elem in xs)
+            var j = 0;
+            foreach (var elem in xs)
             {
-                Assert.Equal(elem, j);
+                Assert.Equal(j, elem);
                 j++;
             }
 
-            Assert.Equal(j, 10);
+            Assert.Equal(10, j);
         }
 
         [Fact]
@@ -85,14 +85,14 @@ namespace Tests
                 }
             });
 
-            int j = 0;
-            foreach (int elem in xs)
+            var j = 0;
+            foreach (var elem in xs)
             {
                 Assert.Equal(elem, j);
                 j++;
             }
 
-            Assert.Equal(j, 10);
+            Assert.Equal(10, j);
         }
 
         [Fact]

+ 2 - 0
Ix.NET/Source/Tests/Tests.cs

@@ -13,6 +13,7 @@ namespace Tests
     
     public partial class Tests
     {
+#pragma warning disable xUnit1013 // Public method should be marked as test
         public void AssertThrows<E>(Action a)
             where E : Exception
         {
@@ -43,5 +44,6 @@ namespace Tests
             Assert.True(e.MoveNext());
             Assert.Equal(value, e.Current);
         }
+#pragma warning restore xUnit1013 // Public method should be marked as test
     }
 }

+ 7 - 4
Ix.NET/Source/Tests/Tests.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFrameworks>netcoreapp1.0;net461</TargetFrameworks>
+    <TargetFrameworks>netcoreapp1.1;net461</TargetFrameworks>
     <NoWarn>$(NoWarn);CS0618</NoWarn>
   </PropertyGroup>
 
@@ -17,10 +17,13 @@
   </ItemGroup>
 
   <ItemGroup>
-    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
-    <PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta1-build1279" />
-    <PackageReference Include="xunit" Version="2.3.0-beta1-build3561" />
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0-preview-20170601-03" />
+    <PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta3-build3705" />
     <PackageReference Include="FluentAssertions" Version="4.19.2 " />
+    
+    <PackageReference Include="xunit" Version="2.3.0-beta3-build3705" />
+    <DotNetCliToolReference Include="dotnet-xunit" Version="2.3.0-beta3-build3705" />
+
   </ItemGroup>
 
   <ItemGroup>

+ 0 - 5
Ix.NET/Source/Tests/Tests.v3.ncrunchproject

@@ -1,5 +0,0 @@
-<ProjectConfiguration>
-  <Settings>
-    <PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully>
-  </Settings>
-</ProjectConfiguration>

+ 43 - 36
Ix.NET/Source/build-new.ps1

@@ -16,43 +16,47 @@ $signClientAppPath = Join-Path (Join-Path (Join-Path .\Packages "SignClient") "T
 #remove any old coverage file
 md -Force $outputLocation | Out-Null
 $outputPath = (Resolve-Path $outputLocation).Path
-$outputFileDotCover1 = Join-Path $outputPath -childpath 'coverage-ix1.dcvr'
-$outputFileDotCover2 = Join-Path $outputPath -childpath 'coverage-ix2.dcvr'
-$outputFileDotCover = Join-Path $outputPath -childpath 'coverage-ix.dcvr'
 $outputFile = Join-Path $outputPath -childpath 'coverage-ix.xml'
 Remove-Item $outputPath -Force -Recurse
 md -Force $outputLocation | Out-Null
 
 if (!(Test-Path .\nuget.exe)) {
-    wget "https://dist.nuget.org/win-x86-commandline/v4.0.0/nuget.exe" -outfile .\nuget.exe
+    wget "https://dist.nuget.org/win-x86-commandline/v4.1.0/nuget.exe" -outfile .\nuget.exe
 }
 
 # get tools
 .\nuget.exe install -excludeversion SignClient -Version 0.7.0 -outputdirectory packages
 .\nuget.exe install -excludeversion JetBrains.dotCover.CommandLineTools -pre -outputdirectory packages
-.\nuget.exe install -excludeversion gitversion.commandline -pre -outputdirectory packages
+.\nuget.exe install -excludeversion Nerdbank.GitVersioning -Version 2.0.21-beta -pre -outputdirectory packages
 .\nuget.exe install -excludeversion xunit.runner.console -pre -outputdirectory packages
 .\nuget.exe install -excludeversion ReportGenerator -outputdirectory packages
 #.\nuget.exe install -excludeversion coveralls.io -outputdirectory packages
 .\nuget.exe install -excludeversion coveralls.io.dotcover -outputdirectory packages
 
+#update version
+$versionObj = .\packages\Nerdbank.GitVersioning\tools\get-version.ps1
+$packageSemVer = $versionObj.NuGetPackageVersion
 
-.\packages\gitversion.commandline\tools\gitversion.exe /l console /output buildserver
-$versionObj = .\packages\gitversion.commandline\tools\gitversion.exe | ConvertFrom-Json
-$packageSemVer = $versionObj.FullSemVer
+Write-Host "Building $packageSemVer" -Foreground Green
 
 New-Item -ItemType Directory -Force -Path $artifacts
 
 
 Write-Host "Restoring packages for $scriptPath\Ix.NET.sln" -Foreground Green
 # use nuget.exe to restore on the legacy proj type
-.\nuget.exe restore "$scriptPath\System.Interactive.Tests.Uwp.DeviceRunner\System.Interactive.Tests.Uwp.DeviceRunner.csproj"
-msbuild "$scriptPath\Ix.NET.sln" /m /t:restore /p:Configuration=$configuration 
+#.\nuget.exe restore "$scriptPath\System.Interactive.Tests.Uwp.DeviceRunner\System.Interactive.Tests.Uwp.DeviceRunner.csproj"
+dotnet restore "$scriptPath\Ix.NET.sln" -c $configuration 
 # Force a restore again to get proper version numbers https://github.com/NuGet/Home/issues/4337
-msbuild "$scriptPath\Ix.NET.sln" /m /t:restore /p:Configuration=$configuration 
+dotnet restore "$scriptPath\Ix.NET.sln"
 
 Write-Host "Building $scriptPath\Ix.NET.sln" -Foreground Green
-msbuild "$scriptPath\Ix.NET.sln" /m /t:build /p:Configuration=$configuration 
+
+# Using MSBuild here since th UWP test project cannot be built by the dotnet CLI
+#msbuild "$scriptPath\Ix.NET.sln" /m /t:build /p:Configuration=$configuration 
+
+
+Write-Host "Building Packages" -Foreground Green
+dotnet pack "$scriptPath\System.Interactive\System.Interactive.csproj" -c $configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true
 if ($LastExitCode -ne 0) { 
         Write-Host "Error with build" -Foreground Red
         if($isAppVeyor) {
@@ -61,12 +65,32 @@ if ($LastExitCode -ne 0) {
         }  
 }
 
+dotnet pack "$scriptPath\System.Interactive.Async\System.Interactive.Async.csproj" -c $configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true
+if ($LastExitCode -ne 0) { 
+        Write-Host "Error with build" -Foreground Red
+        if($isAppVeyor) {
+          $host.SetShouldExit($LastExitCode)
+          exit $LastExitCode
+        }  
+}
 
-Write-Host "Building Packages" -Foreground Green
-msbuild "$scriptPath\System.Interactive\System.Interactive.csproj" /t:pack /p:Configuration=$configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true
-msbuild "$scriptPath\System.Interactive.Async\System.Interactive.Async.csproj" /t:pack /p:Configuration=$configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true
-msbuild "$scriptPath\System.Interactive.Async.Providers\System.Interactive.Async.Providers.csproj" /t:pack /p:Configuration=$configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true
-msbuild "$scriptPath\System.Interactive.Providers\System.Interactive.Providers.csproj" /t:pack /p:Configuration=$configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true
+dotnet pack "$scriptPath\System.Interactive.Async.Providers\System.Interactive.Async.Providers.csproj" -c $configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true
+if ($LastExitCode -ne 0) { 
+        Write-Host "Error with build" -Foreground Red
+        if($isAppVeyor) {
+          $host.SetShouldExit($LastExitCode)
+          exit $LastExitCode
+        }  
+}
+
+dotnet pack "$scriptPath\System.Interactive.Providers\System.Interactive.Providers.csproj" -c $configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true
+if ($LastExitCode -ne 0) { 
+        Write-Host "Error with build" -Foreground Red
+        if($isAppVeyor) {
+          $host.SetShouldExit($LastExitCode)
+          exit $LastExitCode
+        }  
+}
 
 if($hasSignClientSecret) {
   Write-Host "Signing Packages" -Foreground Green	
@@ -96,9 +120,9 @@ $testDirectory = Join-Path $scriptPath "Tests"
 
 # OpenCover isn't working currently. So run tests on CI and coverage with JetBrains 
 
-# Run .NET Core only for now until perf improves on the runner for .net desktop
+# Use xUnit CLI as it's significantly faster than vstest (dotnet test)
 $dotnet = "$env:ProgramFiles\dotnet\dotnet.exe"
-.\packages\JetBrains.dotCover.CommandLineTools\tools\dotCover.exe cover /targetexecutable="$dotnet" /targetworkingdir="$testDirectory" /targetarguments="test -c $configuration --no-build -f netcoreapp1.0" /output="$outputFileDotCover1" /Filters="+:module=System.Interactive;+:module=System.Interactive.Async;+:module=System.Interactive.Providers;+:module=System.Interactive.Async.Providers;-:type=Xunit*" /DisableDefaultFilters /ReturnTargetExitCode /AttributeFilters="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute"
+.\packages\JetBrains.dotCover.CommandLineTools\tools\dotCover.exe analyse /targetexecutable="$dotnet" /targetworkingdir="$testDirectory" /targetarguments="xunit -c $configuration" /Filters="+:module=System.Interactive;+:module=System.Interactive.Async;+:module=System.Interactive.Providers;+:module=System.Interactive.Async.Providers;-:type=Xunit*" /DisableDefaultFilters /ReturnTargetExitCode /AttributeFilters="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute" /output="$outputFile" /ReportType=DetailedXML /HideAutoProperties
 
 if ($LastExitCode -ne 0) { 
 	Write-Host "Error with tests" -Foreground Red
@@ -108,23 +132,6 @@ if ($LastExitCode -ne 0) {
 	}  
 }
 
-# run .net desktop tests
-.\packages\JetBrains.dotCover.CommandLineTools\tools\dotCover.exe cover /targetexecutable="$xUnitConsolePath" /targetworkingdir="$testDirectory\bin\$configuration\net461\" /targetarguments="Tests.dll" /output="$outputFileDotCover2" /Filters="+:module=System.Interactive;+:module=System.Interactive.Async;+:module=System.Interactive.Providers;+:module=System.Interactive.Async.Providers;-:type=Xunit*" /DisableDefaultFilters /ReturnTargetExitCode /AttributeFilters="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute"
-
-if ($LastExitCode -ne 0) { 
-	Write-Host "Error with tests" -Foreground Red
-	if($isAppVeyor) {
-	  $host.SetShouldExit($LastExitCode)
-	  exit $LastExitCode
-	}  
-}
-
-# For perf, we need to use the xunit console runner, but that generates two reports. merge into one and generate the detailed xml output
-
-.\packages\JetBrains.dotCover.CommandLineTools\tools\dotCover.exe merge /Source="$outputFileDotCover1;$outputFileDotCover2" /Output="$outputFileDotCover"
-.\packages\JetBrains.dotCover.CommandLineTools\tools\dotCover.exe report /Source="$outputFileDotCover" /Output="$outputFile" /ReportType=DetailedXML /HideAutoProperties
-
-
 # Either display or publish the results
 if ($env:CI -eq 'True')
 {

+ 16 - 0
Ix.NET/Source/version.json

@@ -0,0 +1,16 @@
+{
+  "version": "3.2.0-preview.{height}",
+  "publicReleaseRefSpec": [
+    "^refs/heads/master$", // we release out of master
+    "^refs/heads/develop$", // we release out of develop
+    "^refs/tags/v\\d+\\.\\d+" // we also release tags starting with vN.N
+  ],
+  "nugetPackageVersion":{
+    "semVer": 2
+  },
+  "cloudBuild": {
+    "buildNumber": {
+      "enabled": true
+    }
+  }
+}

+ 1 - 1
README.md

@@ -4,7 +4,7 @@ Reactive Extensions
 Channel  | Rx | Ix |
 -------- | :------------: | :-------------: |
 AppVeyor<br>([home](https://ci.appveyor.com/project/dotnetfoundation/rx-net)) | ![#](https://img.shields.io/appveyor/ci/dotnetfoundation/rx-net/master.svg) | ![#](https://img.shields.io/appveyor/ci/dotnetfoundation/rx-net/master.svg)
-NuGet.org | ![#](https://img.shields.io/nuget/v/System.Reactive.svg) | ![#](https://img.shields.io/nuget/v/System.Interactive.svg)
+NuGet.org | [![#](https://img.shields.io/nuget/v/System.Reactive.svg)](https://www.nuget.org/packages/System.Reactive/) | [![#](https://img.shields.io/nuget/v/System.Interactive.svg)](https://www.nuget.org/packages/System.Interactive/)
 MyGet<br>([gallery](https://dotnet.myget.org/gallery/rx)) | ![#](https://img.shields.io/dotnet.myget/rx/vpre/System.Reactive.svg)<br>![#](https://img.shields.io/dotnet.myget/rx/v/System.Reactive.svg) | ![#](https://img.shields.io/dotnet.myget/rx/vpre/System.Interactive.svg)<br>![#](https://img.shields.io/dotnet.myget/rx/v/System.Interactive.svg)  
 
 ### Join the conversation

+ 19 - 21
Rx.NET/Source/Directory.build.props

@@ -1,12 +1,10 @@
-<Project>  
-  
+<Project>    
   <PropertyGroup>
     <Product>$(AssemblyName) ($(TargetFramework))</Product>
     <Copyright>Copyright (c) .NET Foundation and Contributors.</Copyright>
     <MinClientVersion>2.12</MinClientVersion>
     <GenerateDocumentationFile Condition=" '$(Configuration)' == 'Release' ">true</GenerateDocumentationFile>
     <Authors>.NET Foundation and Contributors</Authors>
-    <UseFullSemVerForNuGet>false</UseFullSemVerForNuGet>
     <PackageIconUrl>http://go.microsoft.com/fwlink/?LinkId=261274</PackageIconUrl>
     <PackageProjectUrl>http://go.microsoft.com/fwlink/?LinkId=261273</PackageProjectUrl>
     <PackageLicenseUrl>http://go.microsoft.com/fwlink/?LinkID=261272</PackageLicenseUrl>
@@ -14,37 +12,37 @@
     <DebugType>embedded</DebugType>
     <SignAssembly>true</SignAssembly>
     <AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)ReactiveX.snk</AssemblyOriginatorKeyFile>
-    <NoWarn>$(NoWarn);CS1591</NoWarn>
+    <NoWarn>$(NoWarn);1701;1702;CS1591</NoWarn>
     <DefaultLanguage>en-US</DefaultLanguage>
-    <WriteVersionInfoToBuildLog>false</WriteVersionInfoToBuildLog>
     <IncludeSymbols>false</IncludeSymbols>
     <IsTestProject>$(MSBuildProjectName.Contains('Test'))</IsTestProject>
-    <GetVersion Condition=" '$(NCrunch)' != '' ">false</GetVersion>
+    <CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)Rx.ruleset</CodeAnalysisRuleSet>
   </PropertyGroup>
   
   <ItemGroup>
-    <PackageReference Include="GitVersionTask" Version="4.0.0-beta0011" PrivateAssets="All" /> 
-    <PackageReference Include="MSBuild.Sdk.Extras" Version="1.0.2" PrivateAssets="All" />
+    <PackageReference Include="MSBuild.Sdk.Extras" Version="1.0.6" PrivateAssets="All" />
   </ItemGroup>
   
   <ItemGroup Condition="'$(IsTestProject)' != 'true' and '$(SourceLinkEnabled)' != 'false'">
-    <PackageReference Include="SourceLink.Create.CommandLine" Version="2.1.0" PrivateAssets="All" /> 
+    <!-- Disabled until https://github.com/ctaggart/SourceLink/issues/230 is fixed  -->
+    <!--<PackageReference Include="SourceLink.Create.CommandLine" Version="2.1.2" PrivateAssets="All" />-->
   </ItemGroup>
-  
-  <!-- Workaround -->
-  <Target Name="GetPackagingOutputs" />
-  
-  <!-- https://github.com/NuGet/Home/issues/4337 -->
- <PropertyGroup>
-    <GitVersionTaskVersion>4.0.0-beta0011</GitVersionTaskVersion>
+    
+  <PropertyGroup>
+    <NerdbankGitVersioningVersion>2.0.37-beta</NerdbankGitVersioningVersion>
   </PropertyGroup>
+  
+  <ItemGroup>
+    <PackageReference Include="Nerdbank.GitVersioning" Version="2.0.37-beta" PrivateAssets="all" />
+  </ItemGroup>
 
+  <!-- https://github.com/NuGet/Home/issues/4337 -->
   <ImportGroup Condition=" '$(ExcludeRestorePackageImports)' == 'true' ">
-    <Import Project="$(UserProfile)\.nuget\packages\GitVersionTask\$(GitVersionTaskVersion)\buildMultiTargeting\GitVersionTask.targets"
-            Condition="Exists('$(UserProfile)\.nuget\packages\GitVersionTask\$(GitVersionTaskVersion)\buildMultiTargeting\GitVersionTask.targets')" />
+    <Import Project="$(UserProfile)\.nuget\packages\nerdbank.gitversioning\$(NerdbankGitVersioningVersion)\buildCrossTargeting\Nerdbank.GitVersioning.targets"
+            Condition="Exists('$(UserProfile)\.nuget\packages\nerdbank.gitversioning\$(NerdbankGitVersioningVersion)\buildCrossTargeting\Nerdbank.GitVersioning.targets')" />
   </ImportGroup>
-  <Target Name="FixupVersion"
+  <Target Name="FixUpVersion"
       BeforeTargets="_GenerateRestoreProjectSpec"
-      DependsOnTargets="GetVersion"
-      Condition=" '$(GitVersion_Task_targets_Imported)' == 'True' " />
+      DependsOnTargets="GetBuildVersion"
+      Condition=" '$(NerdbankGitVersioningTasksPath)' != '' " />
 </Project>

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

@@ -20,9 +20,12 @@
   <PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp1.0' or '$(TargetFramework)' == 'netcoreapp1.1'">
     <DefineConstants>$(DefineConstants);HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING;NO_SERIALIZABLE;CRIPPLED_REFLECTION</DefineConstants>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netcoreapp2.0'">
+    <DefineConstants>$(DefineConstants);HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING</DefineConstants>
+  </PropertyGroup>
   
   <!-- UWP -->
   <ItemGroup Condition=" '$(TargetFramework)' == 'uap10.0' ">
-    <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform " Version="5.2.2" />
+    <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="5.2.3" />
   </ItemGroup>
 </Project>

+ 0 - 1
Rx.NET/Source/NuGet.Config

@@ -4,6 +4,5 @@
     <add key="xUnit CI" value="https://www.myget.org/F/xunit/api/v3/index.json" />
     <add key="Build Packages" value="https://www.myget.org/F/c037199d-41df-4567-b966-25ff65324688/api/v3/index.json" />
     <add key="NuGet.org" value="https://api.nuget.org/v3/index.json" />
-    <!-- <add key="sourcelink" value="https://ci.appveyor.com/nuget/sourcelink/" /> -->
   </packageSources>
 </configuration>

+ 3 - 1
Rx.NET/Source/System.Reactive.sln

@@ -1,7 +1,7 @@
 
 Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 15
-VisualStudioVersion = 15.0.26228.9
+VisualStudioVersion = 15.0.26606.0
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Reactive", "src\System.Reactive\System.Reactive.csproj", "{01706A0F-8A63-4FD6-AF45-0BC0BED3C0D9}"
 EndProject
@@ -18,6 +18,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
 		build-new.ps1 = build-new.ps1
 		Directory.build.props = Directory.build.props
 		Directory.build.targets = Directory.build.targets
+		Rx.ruleset = Rx.ruleset
+		Test.ruleset = Test.ruleset
 	EndProjectSection
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{D324579D-CBE6-4867-8980-D7842C7C45A2}"

+ 3 - 0
Rx.NET/Source/Test.ruleset

@@ -3,4 +3,7 @@
   <Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">
     <Rule Id="CA2212" Action="Warning" />
   </Rules>
+  <Rules AnalyzerId="xunit.analyzers" RuleNamespace="xunit.analyzers">
+    <Rule Id="xUnit1004" Action="None" />
+  </Rules>
 </RuleSet>

+ 12 - 35
Rx.NET/Source/build-new.ps1

@@ -16,9 +16,6 @@ $signClientAppPath = Join-Path (Join-Path (Join-Path .\Packages "SignClient") "T
 #remove any old coverage file
 md -Force $outputLocation | Out-Null
 $outputPath = (Resolve-Path $outputLocation).Path
-$outputFileDotCover1 = Join-Path $outputPath -childpath 'coverage-rx1.dcvr'
-$outputFileDotCover2 = Join-Path $outputPath -childpath 'coverage-rx2.dcvr'
-$outputFileDotCover = Join-Path $outputPath -childpath 'coverage-rx.dcvr'
 $outputFile = Join-Path $outputPath -childpath 'coverage-rx.xml'
 Remove-Item $outputPath -Force -Recurse
 md -Force $outputLocation | Out-Null
@@ -30,18 +27,18 @@ if (!(Test-Path .\nuget.exe)) {
 # get tools
 .\nuget.exe install -excludeversion SignClient -Version 0.7.0 -outputdirectory packages
 .\nuget.exe install -excludeversion JetBrains.dotCover.CommandLineTools -pre -outputdirectory packages
-.\nuget.exe install -excludeversion gitversion.commandline -pre -outputdirectory packages
+.\nuget.exe install -excludeversion Nerdbank.GitVersioning -Version 2.0.37-beta -pre -outputdirectory packages
 .\nuget.exe install -excludeversion xunit.runner.console -pre -outputdirectory packages
 #.\nuget.exe install -excludeversion OpenCover -Version 4.6.519 -outputdirectory packages
 .\nuget.exe install -excludeversion ReportGenerator -outputdirectory packages
 #.\nuget.exe install -excludeversion coveralls.io -outputdirectory packages
 .\nuget.exe install -excludeversion coveralls.io.dotcover -outputdirectory packages
 
-
 #update version
-.\packages\gitversion.commandline\tools\gitversion.exe /l console /output buildserver
-$versionObj = .\packages\gitversion.commandline\tools\gitversion.exe | ConvertFrom-Json
-$packageSemVer = $versionObj.NuGetVersionV2
+$versionObj = .\packages\Nerdbank.GitVersioning\tools\get-version.ps1
+$packageSemVer = $versionObj.NuGetPackageVersion
+
+Write-Host "Building $packageSemVer" -Foreground Green
 
 New-Item -ItemType Directory -Force -Path $artifacts
 
@@ -63,20 +60,20 @@ if ($LastExitCode -ne 0) {
 
 
 Write-Host "Building Packages" -Foreground Green
-msbuild "$scriptPath\src\System.Reactive\System.Reactive.csproj" /t:pack /p:Configuration=$configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true /p:NuGetBuildTasksPackTargets="workaround"
+msbuild "$scriptPath\src\System.Reactive\System.Reactive.csproj" /t:pack /p:Configuration=$configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true
 msbuild "$scriptPath\src\Microsoft.Reactive.Testing\Microsoft.Reactive.Testing.csproj" /t:pack /p:Configuration=$configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true
 msbuild "$scriptPath\src\System.Reactive.Observable.Aliases\System.Reactive.Observable.Aliases.csproj" /t:pack /p:Configuration=$configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true
 
-msbuild "$scriptPath\facades\System.Reactive.Core\System.Reactive.Core.csproj" /t:pack /p:Configuration=$configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true /p:NuGetBuildTasksPackTargets="workaround"
+msbuild "$scriptPath\facades\System.Reactive.Core\System.Reactive.Core.csproj" /t:pack /p:Configuration=$configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true
 msbuild "$scriptPath\facades\System.Reactive.Experimental\System.Reactive.Experimental.csproj" /t:pack /p:Configuration=$configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true 
 msbuild "$scriptPath\facades\System.Reactive.Interfaces\System.Reactive.Interfaces.csproj" /t:pack /p:Configuration=$configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true 
 msbuild "$scriptPath\facades\System.Reactive.Linq\System.Reactive.Linq.csproj" /t:pack /p:Configuration=$configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true 
-msbuild "$scriptPath\facades\System.Reactive.PlatformServices\System.Reactive.PlatformServices.csproj" /t:pack /p:Configuration=$configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true /p:NuGetBuildTasksPackTargets="workaround"
+msbuild "$scriptPath\facades\System.Reactive.PlatformServices\System.Reactive.PlatformServices.csproj" /t:pack /p:Configuration=$configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true
 msbuild "$scriptPath\facades\System.Reactive.Providers\System.Reactive.Providers.csproj" /t:pack /p:Configuration=$configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true 
 msbuild "$scriptPath\facades\System.Reactive.Runtime.Remoting\System.Reactive.Runtime.Remoting.csproj" /t:pack /p:Configuration=$configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true 
 msbuild "$scriptPath\facades\System.Reactive.Windows.Forms\System.Reactive.Windows.Forms.csproj" /t:pack /p:Configuration=$configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true
-msbuild "$scriptPath\facades\System.Reactive.Windows.Threading\System.Reactive.Windows.Threading.csproj" /t:pack /p:Configuration=$configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true /p:NuGetBuildTasksPackTargets="workaround"
-msbuild "$scriptPath\facades\System.Reactive.WindowsRuntime\System.Reactive.WindowsRuntime.csproj" /t:pack /p:Configuration=$configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true /p:NuGetBuildTasksPackTargets="workaround"
+msbuild "$scriptPath\facades\System.Reactive.Windows.Threading\System.Reactive.Windows.Threading.csproj" /t:pack /p:Configuration=$configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true
+msbuild "$scriptPath\facades\System.Reactive.WindowsRuntime\System.Reactive.WindowsRuntime.csproj" /t:pack /p:Configuration=$configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true
 
 .\nuget.exe pack "$scriptPath\facades\System.Reactive.Compatibility.nuspec" -Version $packageSemVer -MinClientVersion 2.12 -nopackageanalysis -outputdirectory "$artifacts" 
 
@@ -109,20 +106,9 @@ $testDirectory = Join-Path $scriptPath "tests\Tests.System.Reactive"
 
 # OpenCover isn't working currently. So run tests on CI and coverage with JetBrains 
 
-# Run .NET Core only for now until perf improves on the runner for .net desktop
+# Use xUnit CLI as it's significantly faster than vstest (dotnet test)
 $dotnet = "$env:ProgramFiles\dotnet\dotnet.exe"
-.\packages\JetBrains.dotCover.CommandLineTools\tools\dotCover.exe cover /targetexecutable="$dotnet" /targetworkingdir="$testDirectory" /targetarguments="test -c $configuration --no-build -f netcoreapp1.0 --filter:SkipCI!=true" /output="$outputFileDotCover1" /Filters="+:module=System.Reactive;+:module=Microsoft.Reactive.Testing;+:module=System.Reactive.Observable.Aliases;-:type=Xunit*" /DisableDefaultFilters /ReturnTargetExitCode /AttributeFilters="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute"
-
-if ($LastExitCode -ne 0) { 
-	Write-Host "Error with tests" -Foreground Red
-	if($isAppVeyor) {
-	  $host.SetShouldExit($LastExitCode)
-	  exit $LastExitCode
-	}  
-}
-
-# run .net desktop tests
-.\packages\JetBrains.dotCover.CommandLineTools\tools\dotCover.exe cover /targetexecutable="$xUnitConsolePath" /targetworkingdir="$testDirectory\bin\$configuration\net46\" /targetarguments="Tests.System.Reactive.dll -notrait SkipCI=true" /output="$outputFileDotCover2" /Filters="+:module=System.Reactive;+:module=Microsoft.Reactive.Testing;+:module=System.Reactive.Observable.Aliases;-:type=Xunit*" /DisableDefaultFilters /ReturnTargetExitCode  /AttributeFilters="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute"
+.\packages\JetBrains.dotCover.CommandLineTools\tools\dotCover.exe analyse /targetexecutable="$dotnet" /targetworkingdir="$testDirectory" /targetarguments="xunit -c $configuration --no-build -notrait `"SkipCI=true`"" /Filters="+:module=System.Reactive;+:module=Microsoft.Reactive.Testing;+:module=System.Reactive.Observable.Aliases;-:type=Xunit*" /DisableDefaultFilters /ReturnTargetExitCode /AttributeFilters="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute" /Output="$outputFile" /ReportType=DetailedXML /HideAutoProperties
 
 if ($LastExitCode -ne 0) { 
 	Write-Host "Error with tests" -Foreground Red
@@ -132,15 +118,6 @@ if ($LastExitCode -ne 0) {
 	}  
 }
 
-#.\packages\JetBrains.dotCover.CommandLineTools\tools\dotCover.exe analyze /targetexecutable="$dotnet" /targetworkingdir="$testDirectory" /targetarguments="test -c $configuration --no-build --filter:SkipCI!=true" /ReportType=DetailedXML /output="$outputFile" /Filters="+:module=System.Reactive;+:module=Microsoft.Reactive.Testing;+:module=System.Reactive.Observable.Aliases;-:type=Xunit*" /DisableDefaultFilters /HideAutoProperties /ReturnTargetExitCode
-
-
-# For perf, we need to use the xunit console runner, but that generates two reports. merge into one and generate the detailed xml output
-
-.\packages\JetBrains.dotCover.CommandLineTools\tools\dotCover.exe merge /Source="$outputFileDotCover1;$outputFileDotCover2" /Output="$outputFileDotCover"
-.\packages\JetBrains.dotCover.CommandLineTools\tools\dotCover.exe report /Source="$outputFileDotCover" /Output="$outputFile" /ReportType=DetailedXML /HideAutoProperties
-
-
 # Either display or publish the results
 if ($env:CI -eq 'True')
 {

+ 1 - 0
Rx.NET/Source/facades/Directory.build.props

@@ -2,6 +2,7 @@
   <Import Project="..\Directory.build.props" />
   <PropertyGroup>
     <GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
+    <GenerateAssemblyVersionInfo>false</GenerateAssemblyVersionInfo>
     <CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
     <Description>Reactive Extensions (Rx) for .NET - v3 compatibility facade for $(AssemblyName)</Description>
   </PropertyGroup>

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

@@ -1,6 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
-    <TargetFrameworks>net45;netstandard1.3</TargetFrameworks>
+    <TargetFrameworks>net45;netstandard1.3;netstandard2.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/Microsoft.Reactive.Testing/MockObserver.cs

@@ -19,7 +19,7 @@ namespace Microsoft.Reactive.Testing
                 throw new ArgumentNullException(nameof(scheduler));
 
             this.scheduler = scheduler;
-            this.messages = new List<Recorded<Notification<T>>>();
+            messages = new List<Recorded<Notification<T>>>();
         }
 
         public void OnNext(T value)

+ 0 - 3
Rx.NET/Source/src/System.Reactive.Observable.Aliases/Qbservable.Aliases.Generated.cs

@@ -17,9 +17,6 @@ using System.Reactive.Subjects;
 using System.Reflection;
 using System.Threading;
 using System.Threading.Tasks;
-#if !NO_REMOTING
-using System.Runtime.Remoting.Lifetime;
-#endif
 
 namespace System.Reactive.Linq
 {

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

@@ -1,6 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
-    <TargetFrameworks>netstandard1.3;net45</TargetFrameworks>    
+    <TargetFrameworks>netstandard1.3;netstandard2.0;net45</TargetFrameworks>    
     <Title>Reactive Extensions - Aliases</Title>    
     <CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>    
     <PackageTags>Rx;Reactive;Extensions;Observable;LINQ;Events</PackageTags>

+ 2 - 2
Rx.NET/Source/src/System.Reactive/Concurrency/ConcurrencyAbstractionLayerImpl.cs

@@ -147,7 +147,7 @@ namespace System.Reactive.Concurrency
                     // Rooting of the timer happens through the this.Tick delegate's target object,
                     // which is the current instance and has a field to store the Timer instance.
                     //
-                    _timer = new System.Threading.Timer(this.Tick, state, dueTime, TimeSpan.FromMilliseconds(System.Threading.Timeout.Infinite));
+                    _timer = new System.Threading.Timer(Tick, state, dueTime, TimeSpan.FromMilliseconds(System.Threading.Timeout.Infinite));
                 }
             }
 
@@ -192,7 +192,7 @@ namespace System.Reactive.Concurrency
                 // Rooting of the timer happens through the this.Tick delegate's target object,
                 // which is the current instance and has a field to store the Timer instance.
                 //
-                _timer = new System.Threading.Timer(this.Tick, null, period, period);
+                _timer = new System.Threading.Timer(Tick, null, period, period);
             }
 
             private void Tick(object state) => _action();

+ 1 - 2
Rx.NET/Source/src/System.Reactive/Concurrency/SchedulerWrapper.cs

@@ -67,8 +67,7 @@ namespace System.Reactive.Concurrency
             if (serviceProvider == null)
                 return null;
 
-            var result = default(object);
-            if (TryGetService(serviceProvider, serviceType, out result))
+            if (TryGetService(serviceProvider, serviceType, out var result))
                 return result;
 
             return serviceProvider.GetService(serviceType);

+ 2 - 2
Rx.NET/Source/src/System.Reactive/Internal/Constants.cs

@@ -10,8 +10,8 @@ namespace System.Reactive
     {
         private const string OBSOLETE_REFACTORING = "This property is no longer supported due to refactoring of the API surface and elimination of platform-specific dependencies.";
 
-        public const string OBSOLETE_SCHEDULER_NEWTHREAD  = OBSOLETE_REFACTORING + " Please add a reference to the System.Reactive.PlatformServices assembly for your target platform and use NewThreadScheduler.Default to obtain an instance of this scheduler type.";
-        public const string OBSOLETE_SCHEDULER_TASKPOOL   = OBSOLETE_REFACTORING + " Please add a reference to the System.Reactive.PlatformServices assembly for your target platform and use TaskPoolScheduler.Default to obtain an instance of this scheduler type.";
+        public const string OBSOLETE_SCHEDULER_NEWTHREAD  = OBSOLETE_REFACTORING + " Please use NewThreadScheduler.Default to obtain an instance of this scheduler type.";
+        public const string OBSOLETE_SCHEDULER_TASKPOOL   = OBSOLETE_REFACTORING + " Please use TaskPoolScheduler.Default to obtain an instance of this scheduler type.";
         public const string OBSOLETE_SCHEDULER_THREADPOOL = OBSOLETE_REFACTORING + " Consider using Scheduler.Default to obtain the platform's most appropriate pool-based scheduler. In order to access a specific pool-based scheduler, please add a reference to the System.Reactive.PlatformServices assembly for your target platform and use the appropriate scheduler in the System.Reactive.Concurrency namespace.";
 
         public const string OBSOLETE_SCHEDULEREQUIRED     = "This instance property is no longer supported. Use CurrentThreadScheduler.IsScheduleRequired instead.";

+ 2 - 4
Rx.NET/Source/src/System.Reactive/Internal/Lookup.cs

@@ -19,9 +19,8 @@ namespace System.Reactive
 
         public void Add(K key, E element)
         {
-            var list = default(List<E>);
 
-            if (!_dictionary.TryGetValue(key, out list))
+            if (!_dictionary.TryGetValue(key, out var list))
             {
                 _dictionary[key] = list = new List<E>();
             }
@@ -37,9 +36,8 @@ namespace System.Reactive
         {
             get
             {
-                var list = default(List<E>);
 
-                if (!_dictionary.TryGetValue(key, out list))
+                if (!_dictionary.TryGetValue(key, out var list))
                     return Enumerable.Empty<E>();
 
                 return Hide(list);

+ 2 - 4
Rx.NET/Source/src/System.Reactive/Internal/SystemClock.cs

@@ -61,8 +61,7 @@ namespace System.Reactive.PlatformServices
             {
                 foreach (var entry in s_systemClockChanged)
                 {
-                    var scheduler = default(LocalScheduler);
-                    if (entry.TryGetTarget(out scheduler))
+                    if (entry.TryGetTarget(out var scheduler))
                     {
                         scheduler.SystemClockChanged(sender, e);
                     }
@@ -124,8 +123,7 @@ namespace System.Reactive.PlatformServices
 
                 foreach (var handler in s_systemClockChanged)
                 {
-                    var scheduler = default(LocalScheduler);
-                    if (!handler.TryGetTarget(out scheduler))
+                    if (!handler.TryGetTarget(out var scheduler))
                     {
                         if (remove == null)
                         {

+ 2 - 4
Rx.NET/Source/src/System.Reactive/Internal/TailRecursiveSink.cs

@@ -30,8 +30,7 @@ namespace System.Reactive
             _stack = new Stack<IEnumerator<IObservable<TSource>>>();
             _length = new Stack<int?>();
 
-            var e = default(IEnumerator<IObservable<TSource>>);
-            if (!TryGetEnumerator(sources, out e))
+            if (!TryGetEnumerator(sources, out var e))
                 return Disposable.Empty;
 
             _stack.Push(e);
@@ -139,8 +138,7 @@ namespace System.Reactive
                     var nextSeq = Extract(next);
                     if (nextSeq != null)
                     {
-                        var nextEnumerator = default(IEnumerator<IObservable<TSource>>);
-                        if (!TryGetEnumerator(nextSeq, out nextEnumerator))
+                        if (!TryGetEnumerator(nextSeq, out var nextEnumerator))
                             return;
 
                         _stack.Push(nextEnumerator);

+ 2 - 3
Rx.NET/Source/src/System.Reactive/Joins/Plan.cs

@@ -23,15 +23,14 @@ namespace System.Reactive.Joins
             Dictionary<object, IJoinObserver> externalSubscriptions, IObservable<TSource> observable, Action<Exception> onError)
         {
             var observer = default(JoinObserver<TSource>);
-            var nonGeneric = default(IJoinObserver);
-            if (!externalSubscriptions.TryGetValue(observable, out nonGeneric))
+            if (!externalSubscriptions.TryGetValue(observable, out var nonGeneric))
             {
                 observer = new JoinObserver<TSource>(observable, onError);
                 externalSubscriptions.Add(observable, observer);
             }
             else
             {
-                observer = (JoinObserver<TSource>) nonGeneric;
+                observer = (JoinObserver<TSource>)nonGeneric;
             }
             return observer;
         }

+ 1 - 2
Rx.NET/Source/src/System.Reactive/Linq/Observable/Case.cs

@@ -22,8 +22,7 @@ namespace System.Reactive.Linq.ObservableImpl
 
         public IObservable<TResult> Eval()
         {
-            var res = default(IObservable<TResult>);
-            if (_sources.TryGetValue(_selector(), out res))
+            if (_sources.TryGetValue(_selector(), out var res))
                 return res;
 
             return _defaultSource;

+ 1 - 2
Rx.NET/Source/src/System.Reactive/Linq/Observable/GroupByUntil.cs

@@ -339,8 +339,7 @@ namespace System.Reactive.Linq.ObservableImpl
 
         public bool Remove(TKey key)
         {
-            var value = default(TValue);
-            return _map.TryRemove(key, out value);
+            return _map.TryRemove(key, out var value);
         }
     }
 }

+ 1 - 2
Rx.NET/Source/src/System.Reactive/Linq/Observable/PushToPullAdapter.cs

@@ -51,8 +51,7 @@ namespace System.Reactive.Linq.ObservableImpl
         {
             if (!_done)
             {
-                var current = default(TResult);
-                if (TryMoveNext(out current))
+                if (TryMoveNext(out var current))
                 {
                     Current = current;
                     return true;

+ 2 - 2
Rx.NET/Source/src/System.Reactive/Linq/Observable/Timeout.cs

@@ -81,7 +81,7 @@ namespace System.Reactive.Linq.ObservableImpl
                     }
 
                     if (timerWins)
-                        _subscription.Disposable = _other.SubscribeSafe(this.GetForwarder());
+                        _subscription.Disposable = _other.SubscribeSafe(GetForwarder());
 
                     return Disposable.Empty;
                 }
@@ -208,7 +208,7 @@ namespace System.Reactive.Linq.ObservableImpl
                     }
 
                     if (timerWins)
-                        _subscription.Disposable = _other.SubscribeSafe(this.GetForwarder());
+                        _subscription.Disposable = _other.SubscribeSafe(GetForwarder());
                 }
 
                 public void OnNext(TSource value)

+ 0 - 3
Rx.NET/Source/src/System.Reactive/Linq/Qbservable.Generated.cs

@@ -17,9 +17,6 @@ using System.Reactive;
 using System.Reactive.Subjects;
 using System.Diagnostics.CodeAnalysis;
 using System.Threading.Tasks;
-#if !NO_REMOTING
-using System.Runtime.Remoting.Lifetime;
-#endif
 
 namespace System.Reactive.Linq
 {

+ 0 - 3
Rx.NET/Source/src/System.Reactive/Linq/QbservableEx.Generated.cs

@@ -16,9 +16,6 @@ using System.Threading;
 using System.Threading.Tasks;
 using System.Reactive;
 using System.Reactive.Subjects;
-#if !NO_REMOTING
-using System.Runtime.Remoting.Lifetime;
-#endif
 
 namespace System.Reactive.Linq
 {

+ 1 - 5
Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Events.cs

@@ -264,11 +264,7 @@ namespace System.Reactive.Linq
 
         private static IObservable<TResult> FromEventPattern_<TSender, TEventArgs, TResult>(Type targetType, object target, string eventName, Func<TSender, TEventArgs, TResult> getResult, IScheduler scheduler)
         {
-            var addMethod = default(MethodInfo);
-            var removeMethod = default(MethodInfo);
-            var delegateType = default(Type);
-            var isWinRT = default(bool);
-            ReflectionUtils.GetEventMethods<TSender, TEventArgs>(targetType, target, eventName, out addMethod, out removeMethod, out delegateType, out isWinRT);
+            ReflectionUtils.GetEventMethods<TSender, TEventArgs>(targetType, target, eventName, out var addMethod, out var removeMethod, out var delegateType, out var isWinRT);
 
 #if HAS_WINRT
             if (isWinRT)

+ 20 - 0
Rx.NET/Source/src/System.Reactive/Runtime/CompilerServices/AsyncMethodBuilderAttribute.cs

@@ -0,0 +1,20 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the Apache 2.0 License.
+// See the LICENSE file in the project root for more information. 
+
+namespace System.Runtime.CompilerServices
+{
+    /// <summary>
+    /// Attribute to decorate a task-like type to specify a compatible asynchronous method builder.
+    /// </summary>
+    internal sealed class AsyncMethodBuilderAttribute : Attribute
+    {
+        /// <summary>
+        /// Creates a new instance of the attribute using the specified <paramref name="type"/>.
+        /// </summary>
+        /// <param name="type">The type implementing the asynchronous method builder.</param>
+        public AsyncMethodBuilderAttribute(Type type)
+        {
+        }
+    }
+}

+ 349 - 0
Rx.NET/Source/src/System.Reactive/Runtime/CompilerServices/TaskObservableMethodBuilder.cs

@@ -0,0 +1,349 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the Apache 2.0 License.
+// See the LICENSE file in the project root for more information. 
+
+using System.Reactive;
+using System.Reactive.Concurrency;
+using System.Reactive.Disposables;
+using System.Reactive.Linq;
+using System.Reactive.Subjects;
+using System.Security;
+
+namespace System.Runtime.CompilerServices
+{
+    /// <summary>
+    /// Represents a builder for asynchronous methods that return a task-like <see cref="ITaskObservable{T}"/>.
+    /// </summary>
+    /// <typeparam name="T">The type of the elements in the sequence.</typeparam>
+    public struct TaskObservableMethodBuilder<T>
+    {
+        /// <summary>
+        /// The compiler-generated asynchronous state machine representing the execution flow of the asynchronous
+        /// method whose return type is a task-like <see cref="ITaskObservable{T}"/>.
+        /// </summary>
+        private IAsyncStateMachine _stateMachine;
+
+        /// <summary>
+        /// The underlying observable sequence representing the result produced by the asynchronous method.
+        /// </summary>
+        private TaskObservable _inner;
+
+        /// <summary>
+        /// Creates an instance of the <see cref="TaskObservableMethodBuilder{T}"/> struct.
+        /// </summary>
+        /// <returns>A new instance of the struct.</returns>
+        public static TaskObservableMethodBuilder<T> Create() => default(TaskObservableMethodBuilder<T>);
+
+        /// <summary>
+        /// Begins running the builder with the associated state machine.
+        /// </summary>
+        /// <typeparam name="TStateMachine">The type of the state machine.</typeparam>
+        /// <param name="stateMachine">The state machine instance, passed by reference.</param>
+        /// <exception cref="ArgumentNullException"><paramref name="stateMachine"/> is <c>null</c>.</exception>
+        public void Start<TStateMachine>(ref TStateMachine stateMachine)
+            where TStateMachine : IAsyncStateMachine
+        {
+            if (stateMachine == null)
+                throw new ArgumentNullException(nameof(stateMachine));
+
+            stateMachine.MoveNext();
+        }
+
+        /// <summary>
+        /// Associates the builder with the specified state machine.
+        /// </summary>
+        /// <param name="stateMachine">The state machine instance to associate with the builder.</param>
+        /// <exception cref="ArgumentNullException"><paramref name="stateMachine"/> is <c>null</c>.</exception>
+        /// <exception cref="InvalidOperationException">The state machine was previously set.</exception>
+        public void SetStateMachine(IAsyncStateMachine stateMachine)
+        {
+            if (stateMachine == null)
+                throw new ArgumentNullException(nameof(stateMachine));
+
+            if (_stateMachine != null)
+                throw new InvalidOperationException();
+
+            _stateMachine = stateMachine;
+        }
+
+        /// <summary>
+        /// Marks the observable as successfully completed.
+        /// </summary>
+        /// <param name="result">The result to use to complete the observable sequence.</param>
+        /// <exception cref="InvalidOperationException">The observable has already completed.</exception>
+        public void SetResult(T result)
+        {
+            if (_inner == null)
+            {
+                _inner = new TaskObservable(result);
+            }
+            else
+            {
+                _inner.SetResult(result);
+            }
+        }
+
+        /// <summary>
+        /// Marks the observable as failed and binds the specified exception to the observable sequence.
+        /// </summary>
+        /// <param name="exception">The exception to bind to the observable sequence.</param>
+        /// <exception cref="ArgumentNullException"><paramref name="exception"/> is <c>null</c>.</exception>
+        /// <exception cref="InvalidOperationException">The observable has already completed.</exception>
+        public void SetException(Exception exception)
+        {
+            if (exception == null)
+                throw new ArgumentNullException(nameof(exception));
+
+            if (_inner == null)
+            {
+                _inner = new TaskObservable(exception);
+            }
+            else
+            {
+                _inner.SetException(exception);
+            }
+        }
+
+        /// <summary>
+        /// Gets the observable sequence for this builder.
+        /// </summary>
+        public ITaskObservable<T> Task => _inner ?? (_inner = new TaskObservable());
+
+        /// <summary>
+        /// Schedules the state machine to proceed to the next action when the specified awaiter completes.
+        /// </summary>
+        /// <typeparam name="TAwaiter">The type of the awaiter.</typeparam>
+        /// <typeparam name="TStateMachine">The type of the state machine.</typeparam>
+        /// <param name="awaiter">The awaiter.</param>
+        /// <param name="stateMachine">The state machine.</param>
+        public void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine)
+            where TAwaiter : INotifyCompletion
+            where TStateMachine : IAsyncStateMachine
+        {
+            try
+            {
+                if (_stateMachine == null)
+                {
+                    var ignored = Task; // NB: Ensure we have the observable backed by an async subject ready.
+
+                    _stateMachine = stateMachine;
+                    _stateMachine.SetStateMachine(_stateMachine);
+                }
+
+                // NB: Rx has historically not bothered with execution contexts, so we don't do it here either.
+
+                awaiter.OnCompleted(_stateMachine.MoveNext);
+            }
+            catch (Exception ex)
+            {
+                // NB: Prevent reentrancy into the async state machine when an exception would be observed
+                //     by the caller. This could cause concurrent execution of the async method. Instead,
+                //     rethrow the exception elsewhere.
+
+                Rethrow(ex);
+            }
+        }
+
+        /// <summary>
+        /// Schedules the state machine to proceed to the next action when the specified awaiter completes.
+        /// </summary>
+        /// <typeparam name="TAwaiter">The type of the awaiter.</typeparam>
+        /// <typeparam name="TStateMachine">The type of the state machine.</typeparam>
+        /// <param name="awaiter">The awaiter.</param>
+        /// <param name="stateMachine">The state machine.</param>
+        [SecuritySafeCritical]
+        public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine)
+            where TAwaiter : ICriticalNotifyCompletion
+            where TStateMachine : IAsyncStateMachine
+        {
+            try
+            {
+                if (_stateMachine == null)
+                {
+                    var ignored = Task; // NB: Ensure we have the observable backed by an async subject ready.
+
+                    _stateMachine = stateMachine;
+                    _stateMachine.SetStateMachine(_stateMachine);
+                }
+
+                // NB: Rx has historically not bothered with execution contexts, so we don't do it here either.
+
+                awaiter.UnsafeOnCompleted(_stateMachine.MoveNext);
+            }
+            catch (Exception ex)
+            {
+                // NB: Prevent reentrancy into the async state machine when an exception would be observed
+                //     by the caller. This could cause concurrent execution of the async method. Instead,
+                //     rethrow the exception elsewhere.
+
+                Rethrow(ex);
+            }
+        }
+
+        /// <summary>
+        /// Rethrows an exception that was thrown from an awaiter's OnCompleted methods.
+        /// </summary>
+        /// <param name="exception">The exception to rethrow.</param>
+        private static void Rethrow(Exception exception)
+        {
+            Scheduler.Default.Schedule(exception, (ex, recurse) => ex.Throw());
+        }
+
+        /// <summary>
+        /// Implementation of the IObservable&lt;T&gt; interface compatible with async method return types.
+        /// </summary>
+        /// <remarks>
+        /// This class implements a "task-like" type that can be used as the return type of an asynchronous
+        /// method in C# 7.0 and beyond. For example:
+        /// <code>
+        /// async Observable&lt;int&gt; RxAsync()
+        /// {
+        ///     var res = await Observable.Return(21).Delay(TimeSpan.FromSeconds(1));
+        ///     return res * 2;
+        /// }
+        /// </code>
+        /// </remarks>
+        /// <typeparam name="T">The type of the elements in the sequence.</typeparam>
+        internal sealed class TaskObservable : ITaskObservable<T>, ITaskObservableAwaiter<T>
+        {
+            /// <summary>
+            /// The underlying observable sequence to subscribe to in case the asynchronous method did not
+            /// finish synchronously.
+            /// </summary>
+            private readonly AsyncSubject<T> _subject;
+
+            /// <summary>
+            /// The result returned by the asynchronous method in case the method finished synchronously.
+            /// </summary>
+            private readonly T _result;
+
+            /// <summary>
+            /// The exception thrown by the asynchronous method in case the method finished synchronously.
+            /// </summary>
+            private readonly Exception _exception;
+
+            /// <summary>
+            /// Creates a new <see cref="TaskObservable"/> for an asynchronous method that has not finished yet.
+            /// </summary>
+            public TaskObservable()
+            {
+                _subject = new AsyncSubject<T>();
+            }
+
+            /// <summary>
+            /// Creates a new <see cref="TaskObservable"/> for an asynchronous method that synchronously returned
+            /// the specified <paramref name="result"/> value.
+            /// </summary>
+            /// <param name="result">The result returned by the asynchronous method.</param>
+            public TaskObservable(T result)
+            {
+                _result = result;
+            }
+
+            /// <summary>
+            /// Creates a new <see cref="TaskObservable"/> for an asynchronous method that synchronously threw
+            /// the specified <paramref name="exception"/>.
+            /// </summary>
+            /// <param name="exception">The exception thrown by the asynchronous method.</param>
+            public TaskObservable(Exception exception)
+            {
+                _exception = exception;
+            }
+
+            /// <summary>
+            /// Marks the observable as successfully completed.
+            /// </summary>
+            /// <param name="result">The result to use to complete the observable sequence.</param>
+            /// <exception cref="InvalidOperationException">The observable has already completed.</exception>
+            public void SetResult(T result)
+            {
+                if (IsCompleted)
+                    throw new InvalidOperationException();
+
+                _subject.OnNext(result);
+                _subject.OnCompleted();
+            }
+
+            /// <summary>
+            /// Marks the observable as failed and binds the specified exception to the observable sequence.
+            /// </summary>
+            /// <param name="exception">The exception to bind to the observable sequence.</param>
+            /// <exception cref="ArgumentNullException"><paramref name="exception"/> is <c>null</c>.</exception>
+            /// <exception cref="InvalidOperationException">The observable has already completed.</exception>
+            public void SetException(Exception exception)
+            {
+                if (IsCompleted)
+                    throw new InvalidOperationException();
+
+                _subject.OnError(exception);
+            }
+
+            /// <summary>
+            /// Subscribes the given observer to the observable sequence.
+            /// </summary>
+            /// <param name="observer">Observer that will receive notifications from the observable sequence.</param>
+            /// <returns>Disposable object representing an observer's subscription to the observable sequence.</returns>
+            /// <exception cref="ArgumentNullException"><paramref name="observer"/> is null.</exception>
+            public IDisposable Subscribe(IObserver<T> observer)
+            {
+                if (_subject != null)
+                {
+                    return _subject.Subscribe(observer);
+                }
+                else if (_exception != null)
+                {
+                    observer.OnError(_exception);
+                    return Disposable.Empty;
+                }
+                else
+                {
+                    observer.OnNext(_result);
+                    return Disposable.Empty;
+                }
+            }
+
+            /// <summary>
+            /// Gets an awaiter that can be used to await the eventual completion of the observable sequence.
+            /// </summary>
+            /// <returns>An awaiter that can be used to await the eventual completion of the observable sequence.</returns>
+            public ITaskObservableAwaiter<T> GetAwaiter() => this;
+
+            /// <summary>
+            /// Gets a Boolean indicating whether the observable sequence has completed.
+            /// </summary>
+            public bool IsCompleted => _subject?.IsCompleted ?? true;
+
+            /// <summary>
+            /// Gets the result produced by the observable sequence.
+            /// </summary>
+            /// <returns>The result produced by the observable sequence.</returns>
+            public T GetResult()
+            {
+                if (_subject != null)
+                {
+                    return _subject.GetResult();
+                }
+
+                _exception.ThrowIfNotNull();
+
+                return _result;
+            }
+
+            /// <summary>
+            /// Attaches the specified <paramref name="continuation"/> to the observable sequence.
+            /// </summary>
+            /// <param name="continuation">The continuation to attach.</param>
+            public void OnCompleted(Action continuation)
+            {
+                if (_subject != null)
+                {
+                    _subject.OnCompleted(continuation);
+                }
+                else
+                {
+                    continuation();
+                }
+            }
+        }
+    }
+}

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Subjects/AsyncSubject.cs

@@ -291,7 +291,7 @@ namespace System.Reactive.Subjects
             //
             // [OK] Use of unsafe Subscribe: this type's Subscribe implementation is safe.
             //
-            this.Subscribe/*Unsafe*/(new AwaitObserver(continuation, originalContext));
+            Subscribe/*Unsafe*/(new AwaitObserver(continuation, originalContext));
         }
 
         private sealed class AwaitObserver : IObserver<T>

+ 5 - 4
Rx.NET/Source/src/System.Reactive/System.Reactive.csproj

@@ -1,6 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
-    <TargetFrameworks>netstandard1.3;net45;net46;uap10.0</TargetFrameworks>
+    <TargetFrameworks>netstandard2.0;netstandard1.3;net45;net46;uap10.0</TargetFrameworks>
     <CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>       
     <PackageTags>Rx;Reactive;Extensions;Observable;LINQ;Events</PackageTags>
     <Description>Reactive Extensions (Rx) for .NET</Description>
@@ -25,6 +25,10 @@
     <PackageReference Include="System.Threading.ThreadPool" Version="4.3.0" />
   </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.ComponentModel" Version="4.0.1" />
@@ -64,9 +68,6 @@
     <EmbeddedResource Update="Strings_PlatformServices.resx" Generator="ResXFileCodeGenerator" LastGenOutput="Strings_PlatformServices.Designer.cs" />
     <EmbeddedResource Update="Strings_Providers.resx" Generator="ResXFileCodeGenerator" LastGenOutput="Strings_Providers.Designer.cs" />    
   </ItemGroup>
-  <ItemGroup>
-    <Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
-  </ItemGroup>
 
   <Import Project="$(MSBuildSDKExtrasTargets)" Condition="Exists('$(MSBuildSDKExtrasTargets)')" />
   

+ 53 - 0
Rx.NET/Source/src/System.Reactive/TaskObservable.cs

@@ -0,0 +1,53 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the Apache 2.0 License.
+// See the LICENSE file in the project root for more information. 
+
+using System.Runtime.CompilerServices;
+
+namespace System.Reactive
+{
+    /// <summary>
+    /// Extension of the <see cref="IObservable{T}"/> interface compatible with async method return types.
+    /// </summary>
+    /// <remarks>
+    /// This class implements a "task-like" type that can be used as the return type of an asynchronous
+    /// method in C# 7.0 and beyond. For example:
+    /// <code>
+    /// async ITaskObservable&lt;int&gt; RxAsync()
+    /// {
+    ///     var res = await Observable.Return(21).Delay(TimeSpan.FromSeconds(1));
+    ///     return res * 2;
+    /// }
+    /// </code>
+    /// </remarks>
+    /// <typeparam name="T">The type of the elements in the sequence.</typeparam>
+    [AsyncMethodBuilder(typeof(TaskObservableMethodBuilder<>))]
+    public interface ITaskObservable<out T> : IObservable<T>
+    {
+        // NB: An interface type is preferred to enable the use of covariance.
+
+        /// <summary>
+        /// Gets an awaiter that can be used to await the eventual completion of the observable sequence.
+        /// </summary>
+        /// <returns>An awaiter that can be used to await the eventual completion of the observable sequence.</returns>
+        ITaskObservableAwaiter<T> GetAwaiter();
+    }
+
+    /// <summary>
+    /// Interface representing an awaiter for an <see cref="ITaskObservable{T}"/>.
+    /// </summary>
+    /// <typeparam name="T">The type of the elements in the sequence.</typeparam>
+    public interface ITaskObservableAwaiter<out T> : INotifyCompletion
+    {
+        /// <summary>
+        /// Gets a Boolean indicating whether the observable sequence has completed.
+        /// </summary>
+        bool IsCompleted { get; }
+
+        /// <summary>
+        /// Gets the result produced by the observable sequence.
+        /// </summary>
+        /// <returns>The result produced by the observable sequence.</returns>
+        T GetResult();
+    }
+}

+ 1 - 1
Rx.NET/Source/src/System.Reactive/TimeInterval.cs

@@ -81,7 +81,7 @@ namespace System.Reactive
                 return false;
 
             var other = (TimeInterval<T>)obj;
-            return this.Equals(other);
+            return Equals(other);
         }
 
         /// <summary>

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Timestamped.cs

@@ -82,7 +82,7 @@ namespace System.Reactive
                 return false;
 
             var other = (Timestamped<T>)obj;
-            return this.Equals(other);
+            return Equals(other);
         }
 
         /// <summary>

+ 3 - 0
Rx.NET/Source/tests/Directory.build.props

@@ -1,3 +1,6 @@
 <Project>
   <Import Project="..\Directory.build.props" />
+  <PropertyGroup>
+    <CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)..\Test.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup> 
 </Project>

+ 0 - 29
Rx.NET/Source/tests/Tests.System.Reactive.Uwp.DeviceRunner/Properties/AssemblyInfo.cs

@@ -1,29 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following 
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("Tests.System.Reactive.Uwp.DeviceRunner")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany(".NET Foundation and Contributors.")]
-[assembly: AssemblyProduct("Tests.System.Reactive.Uwp.DeviceRunner")]
-[assembly: AssemblyCopyright("\x00a9 .NET Foundation and Contributors.  All rights reserved.")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version 
-//      Build Number
-//      Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers 
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
-[assembly: ComVisible(false)]

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

@@ -17,6 +17,8 @@
     <FileAlignment>512</FileAlignment>
     <ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
     <PackageCertificateKeyFile>Tests.System.Reactive.Uwp.DeviceRunner_TemporaryKey.pfx</PackageCertificateKeyFile>
+    <PackageCertificateThumbprint>089EC27AC482FBFAFA90BA9DB8C8C793664FCA3B</PackageCertificateThumbprint>
+    <SignAssembly>false</SignAssembly>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
     <DebugSymbols>true</DebugSymbols>
@@ -363,7 +365,6 @@
     <Compile Include="App.xaml.cs">
       <DependentUpon>App.xaml</DependentUpon>
     </Compile>
-    <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
   <ItemGroup>
     <AppxManifest Include="Package.appxmanifest">

二进制
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

@@ -3,7 +3,7 @@
 // See the LICENSE file in the project root for more information. 
 
 using System;
-#if NETCOREAPP1_0 || NET46
+#if NETCOREAPP1_1 || NET46 || NETCOREAPP1_0
 using System.Threading;
 #endif
 #if HAS_DISPATCHER

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

@@ -23,7 +23,7 @@ namespace ReactiveTests
             if (underlyingEnumerable == null)
                 throw new ArgumentNullException(nameof(underlyingEnumerable));
 
-            this.Scheduler = scheduler;
+            Scheduler = scheduler;
             this.underlyingEnumerable = underlyingEnumerable;
         }
 

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

@@ -1,8 +1,8 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
-    <TargetFrameworks>net46;netcoreapp1.0</TargetFrameworks>
+    <TargetFrameworks>net46;netcoreapp1.1;netcoreapp2.0</TargetFrameworks>
     <NoWarn>$(NoWarn);CS0618</NoWarn>
-  </PropertyGroup> 
+  </PropertyGroup>
   
   <ItemGroup>
     <Content Include="xunit.runner.json">
@@ -15,9 +15,10 @@
     <Reference Include="WindowsBase" />
   </ItemGroup>
   <ItemGroup>
-    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
-    <PackageReference Include="xunit" Version="2.3.0-beta1-build3561" />
-    <PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta1-build1279" />
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
+    <PackageReference Include="xunit" Version="2.3.0-beta5-build3745" />
+    <PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta5-build3745" />
+    <DotNetCliToolReference Include="dotnet-xunit" Version="2.3.0-beta5-build3745" />
     <ProjectReference Include="..\..\src\System.Reactive\System.Reactive.csproj" />
     <ProjectReference Include="..\..\src\System.Reactive.Observable.Aliases\System.Reactive.Observable.Aliases.csproj" />
     <ProjectReference Include="..\..\src\Microsoft.Reactive.Testing\Microsoft.Reactive.Testing.csproj" />

+ 3 - 6
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/DefaultSchedulerTest.cs

@@ -94,11 +94,10 @@ namespace ReactiveTests.Tests
 #endif
 #if DESKTOPCLR
         [Trait("SkipCI", "true")]
+        [Fact]
         public void No_ThreadPool_Starvation_Dispose()
         {
-            var bwt = default(int);
-            var bio = default(int);
-            ThreadPool.GetAvailableThreads(out bwt, out bio);
+            ThreadPool.GetAvailableThreads(out var bwt, out var bio);
 
             var N = Environment.ProcessorCount * 2;
 
@@ -112,9 +111,7 @@ namespace ReactiveTests.Tests
                 f.Set();
             }
 
-            var ewt = default(int);
-            var eio = default(int);
-            ThreadPool.GetAvailableThreads(out ewt, out eio);
+            ThreadPool.GetAvailableThreads(out var ewt, out var eio);
 
             Assert.False(bwt - ewt >= N);
         }

+ 1 - 2
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/SchedulerTest.cs

@@ -1046,8 +1046,7 @@ namespace ReactiveTests.Tests
 
             public object GetService(Type serviceType)
             {
-                var res = default(object);
-                if (_services.TryGetValue(serviceType, out res))
+                if (_services.TryGetValue(serviceType, out var res))
                     return res;
 
                 return null;

+ 2 - 7
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/ThreadPoolSchedulerTest.cs

@@ -298,9 +298,7 @@ namespace ReactiveTests.Tests
         [Fact]
         public void No_ThreadPool_Starvation_Dispose()
         {
-            var bwt = default(int);
-            var bio = default(int);
-            ThreadPool.GetAvailableThreads(out bwt, out bio);
+            ThreadPool.GetAvailableThreads(out var bwt, out var bio);
 
             var N = Environment.ProcessorCount * 2;
 
@@ -313,10 +311,7 @@ namespace ReactiveTests.Tests
                 d.Dispose();
                 f.Set();
             }
-
-            var ewt = default(int);
-            var eio = default(int);
-            ThreadPool.GetAvailableThreads(out ewt, out eio);
+            ThreadPool.GetAvailableThreads(out var ewt, out var eio);
 
             Assert.False(bwt - ewt >= N);
         }

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

@@ -2460,7 +2460,7 @@ namespace ReactiveTests.Tests
             ReactiveAssert.Throws<OverflowException>(() => res.ForEach(_ => { }));
         }
 #endif
-#if !CRIPPLED_REFLECTION || NETCOREAPP1_0
+#if !CRIPPLED_REFLECTION || NETCOREAPP1_1 || NETCOREAPP1_0
         class OverflowInjection<T> : IObservable<T>
         {
             private readonly IObservable<T> _source;

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

@@ -6608,7 +6608,7 @@ namespace ReactiveTests.Tests
             res.Messages.AssertEqual(expected);
         }
 
-#if !NO_THREAD && !NETCOREAPP1_0
+#if !NO_THREAD && !NETCOREAPP1_1 && !NETCOREAPP1_0
         [Fact]
         public void Concat_TailRecursive2()
         {

+ 6 - 6
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Subjects/AsyncSubjectTest.cs

@@ -308,14 +308,14 @@ namespace ReactiveTests.Tests
         public void Await_Blocking()
         {
             var s = new AsyncSubject<int>();
-            GetResult_Blocking(s.GetAwaiter());
+            GetResult_BlockingImpl(s.GetAwaiter());
         }
 
         [Fact]
         public void Await_Throw()
         {
             var s = new AsyncSubject<int>();
-            GetResult_Blocking_Throw(s.GetAwaiter());
+            GetResult_Blocking_ThrowImpl(s.GetAwaiter());
         }
 #endif
 
@@ -331,10 +331,10 @@ namespace ReactiveTests.Tests
         [Fact]
         public void GetResult_Blocking()
         {
-            GetResult_Blocking(new AsyncSubject<int>());
+            GetResult_BlockingImpl(new AsyncSubject<int>());
         }
 
-        private void GetResult_Blocking(AsyncSubject<int> s)
+        private void GetResult_BlockingImpl(AsyncSubject<int> s)
         {
             Assert.False(s.IsCompleted);
 
@@ -359,10 +359,10 @@ namespace ReactiveTests.Tests
         [Fact]
         public void GetResult_Blocking_Throw()
         {
-            GetResult_Blocking_Throw(new AsyncSubject<int>());
+            GetResult_Blocking_ThrowImpl(new AsyncSubject<int>());
         }
 
-        private void GetResult_Blocking_Throw(AsyncSubject<int> s)
+        private void GetResult_Blocking_ThrowImpl(AsyncSubject<int> s)
         {
             Assert.False(s.IsCompleted);
 

+ 6 - 12
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Subjects/BehaviorSubjectTest.cs

@@ -450,8 +450,7 @@ namespace ReactiveTests.Tests
             var s = new BehaviorSubject<int>(42);
             Assert.Equal(42, s.Value);
 
-            var x = default(int);
-            Assert.True(s.TryGetValue(out x));
+            Assert.True(s.TryGetValue(out var x));
             Assert.Equal(42, x);
         }
 
@@ -461,8 +460,7 @@ namespace ReactiveTests.Tests
             var s = new BehaviorSubject<int>(42);
             Assert.Equal(42, s.Value);
 
-            var x = default(int);
-            Assert.True(s.TryGetValue(out x));
+            Assert.True(s.TryGetValue(out var x));
             Assert.Equal(42, x);
 
             s.OnNext(43);
@@ -478,8 +476,7 @@ namespace ReactiveTests.Tests
             var s = new BehaviorSubject<int>(42);
             Assert.Equal(42, s.Value);
 
-            var x = default(int);
-            Assert.True(s.TryGetValue(out x));
+            Assert.True(s.TryGetValue(out var x));
             Assert.Equal(42, x);
 
             s.OnNext(43);
@@ -501,8 +498,7 @@ namespace ReactiveTests.Tests
             var s = new BehaviorSubject<int>(42);
             Assert.Equal(42, s.Value);
 
-            var x = default(int);
-            Assert.True(s.TryGetValue(out x));
+            Assert.True(s.TryGetValue(out var x));
             Assert.Equal(42, x);
 
             s.OnNext(43);
@@ -545,8 +541,7 @@ namespace ReactiveTests.Tests
 
             ReactiveAssert.Throws<InvalidOperationException>(() =>
             {
-                var x = default(int);
-                s.TryGetValue(out x);
+                s.TryGetValue(out var x);
             });
         }
 
@@ -563,8 +558,7 @@ namespace ReactiveTests.Tests
                 var ignored = s.Value;
             });
 
-            var x = default(int);
-            Assert.False(s.TryGetValue(out x));
+            Assert.False(s.TryGetValue(out var x));
         }
     }
 }

+ 30 - 30
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Subjects/ReplaySubjectTest.cs

@@ -1497,13 +1497,13 @@ namespace ReactiveTests.Tests
         [Fact]
         public void HasObservers()
         {
-            HasObservers(new ReplaySubject<int>());
-            HasObservers(new ReplaySubject<int>(1));
-            HasObservers(new ReplaySubject<int>(3));
-            HasObservers(new ReplaySubject<int>(TimeSpan.FromSeconds(1)));
+            HasObserversImpl(new ReplaySubject<int>());
+            HasObserversImpl(new ReplaySubject<int>(1));
+            HasObserversImpl(new ReplaySubject<int>(3));
+            HasObserversImpl(new ReplaySubject<int>(TimeSpan.FromSeconds(1)));
         }
 
-        private static void HasObservers(ReplaySubject<int> s)
+        private static void HasObserversImpl(ReplaySubject<int> s)
         {
             Assert.False(s.HasObservers);
 
@@ -1529,13 +1529,13 @@ namespace ReactiveTests.Tests
         [Fact]
         public void HasObservers_Dispose1()
         {
-            HasObservers_Dispose1(new ReplaySubject<int>());
-            HasObservers_Dispose1(new ReplaySubject<int>(1));
-            HasObservers_Dispose1(new ReplaySubject<int>(3));
-            HasObservers_Dispose1(new ReplaySubject<int>(TimeSpan.FromSeconds(1)));
+            HasObservers_Dispose1Impl(new ReplaySubject<int>());
+            HasObservers_Dispose1Impl(new ReplaySubject<int>(1));
+            HasObservers_Dispose1Impl(new ReplaySubject<int>(3));
+            HasObservers_Dispose1Impl(new ReplaySubject<int>(TimeSpan.FromSeconds(1)));
         }
 
-        private static void HasObservers_Dispose1(ReplaySubject<int> s)
+        private static void HasObservers_Dispose1Impl(ReplaySubject<int> s)
         {
             Assert.False(s.HasObservers);
             Assert.False(s.IsDisposed);
@@ -1556,13 +1556,13 @@ namespace ReactiveTests.Tests
         [Fact]
         public void HasObservers_Dispose2()
         {
-            HasObservers_Dispose2(new ReplaySubject<int>());
-            HasObservers_Dispose2(new ReplaySubject<int>(1));
-            HasObservers_Dispose2(new ReplaySubject<int>(3));
-            HasObservers_Dispose2(new ReplaySubject<int>(TimeSpan.FromSeconds(1)));
+            HasObservers_Dispose2Impl(new ReplaySubject<int>());
+            HasObservers_Dispose2Impl(new ReplaySubject<int>(1));
+            HasObservers_Dispose2Impl(new ReplaySubject<int>(3));
+            HasObservers_Dispose2Impl(new ReplaySubject<int>(TimeSpan.FromSeconds(1)));
         }
 
-        private static void HasObservers_Dispose2(ReplaySubject<int> s)
+        private static void HasObservers_Dispose2Impl(ReplaySubject<int> s)
         {
             Assert.False(s.HasObservers);
             Assert.False(s.IsDisposed);
@@ -1583,13 +1583,13 @@ namespace ReactiveTests.Tests
         [Fact]
         public void HasObservers_Dispose3()
         {
-            HasObservers_Dispose3(new ReplaySubject<int>());
-            HasObservers_Dispose3(new ReplaySubject<int>(1));
-            HasObservers_Dispose3(new ReplaySubject<int>(3));
-            HasObservers_Dispose3(new ReplaySubject<int>(TimeSpan.FromSeconds(1)));
+            HasObservers_Dispose3Impl(new ReplaySubject<int>());
+            HasObservers_Dispose3Impl(new ReplaySubject<int>(1));
+            HasObservers_Dispose3Impl(new ReplaySubject<int>(3));
+            HasObservers_Dispose3Impl(new ReplaySubject<int>(TimeSpan.FromSeconds(1)));
         }
 
-        private static void HasObservers_Dispose3(ReplaySubject<int> s)
+        private static void HasObservers_Dispose3Impl(ReplaySubject<int> s)
         {
             Assert.False(s.HasObservers);
             Assert.False(s.IsDisposed);
@@ -1602,13 +1602,13 @@ namespace ReactiveTests.Tests
         [Fact]
         public void HasObservers_OnCompleted()
         {
-            HasObservers_OnCompleted(new ReplaySubject<int>());
-            HasObservers_OnCompleted(new ReplaySubject<int>(1));
-            HasObservers_OnCompleted(new ReplaySubject<int>(3));
-            HasObservers_OnCompleted(new ReplaySubject<int>(TimeSpan.FromSeconds(1)));
+            HasObservers_OnCompletedImpl(new ReplaySubject<int>());
+            HasObservers_OnCompletedImpl(new ReplaySubject<int>(1));
+            HasObservers_OnCompletedImpl(new ReplaySubject<int>(3));
+            HasObservers_OnCompletedImpl(new ReplaySubject<int>(TimeSpan.FromSeconds(1)));
         }
 
-        private static void HasObservers_OnCompleted(ReplaySubject<int> s)
+        private static void HasObservers_OnCompletedImpl(ReplaySubject<int> s)
         {
             Assert.False(s.HasObservers);
 
@@ -1625,13 +1625,13 @@ namespace ReactiveTests.Tests
         [Fact]
         public void HasObservers_OnError()
         {
-            HasObservers_OnError(new ReplaySubject<int>());
-            HasObservers_OnError(new ReplaySubject<int>(1));
-            HasObservers_OnError(new ReplaySubject<int>(3));
-            HasObservers_OnError(new ReplaySubject<int>(TimeSpan.FromSeconds(1)));
+            HasObservers_OnErrorImpl(new ReplaySubject<int>());
+            HasObservers_OnErrorImpl(new ReplaySubject<int>(1));
+            HasObservers_OnErrorImpl(new ReplaySubject<int>(3));
+            HasObservers_OnErrorImpl(new ReplaySubject<int>(TimeSpan.FromSeconds(1)));
         }
 
-        private static void HasObservers_OnError(ReplaySubject<int> s)
+        private static void HasObservers_OnErrorImpl(ReplaySubject<int> s)
         {
             Assert.False(s.HasObservers);
 

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

@@ -24,8 +24,7 @@ namespace ReactiveTests.Tests
         {
             _observer.OnNext(value);
 
-            IDisposable disconnect;
-            if (_disposeOn.TryGetValue(value, out disconnect))
+            if (_disposeOn.TryGetValue(value, out var disconnect))
                 disconnect.Dispose();
         }
 

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

@@ -211,7 +211,7 @@ namespace ReactiveTests.Tests
             public bool Equals(Left other)
             {
                 var equ = _value.GetType().GetMethods().Where(m => m.Name == nameof(Equals) && m.GetParameters()[0].ParameterType != typeof(object)).Single();
-                return (bool)equ.Invoke(_value, new object[] { other == null ? null : other._value });
+                return (bool)equ.Invoke(_value, new object[] { other?._value });
             }
         }
 
@@ -233,7 +233,7 @@ namespace ReactiveTests.Tests
             public bool Equals(Right other)
             {
                 var equ = _value.GetType().GetMethods().Where(m => m.Name == nameof(Equals) && m.GetParameters()[0].ParameterType != typeof(object)).Single();
-                return (bool)equ.Invoke(_value, new object[] { other == null ? null : other._value });
+                return (bool)equ.Invoke(_value, new object[] { other?._value });
             }
         }
     }

+ 75 - 0
Rx.NET/Source/tests/Tests.System.Reactive/Tests/TaskLikeSupportTest.cs

@@ -0,0 +1,75 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the Apache 2.0 License.
+// See the LICENSE file in the project root for more information. 
+
+using System;
+using System.Reactive;
+using System.Reactive.Linq;
+using System.Threading.Tasks;
+using Xunit;
+
+namespace Tests.System.Reactive.Tests
+{
+    public class TaskLikeSupportTest
+    {
+        [Fact]
+        public async Task Return()
+        {
+            Assert.Equal(42, await ManOrBoy_Return());
+        }
+
+#pragma warning disable 1998
+        private async ITaskObservable<int> ManOrBoy_Return()
+        {
+            return 42;
+        }
+#pragma warning restore 1998
+
+        [Fact]
+        public async Task Throw()
+        {
+            await Assert.ThrowsAsync<DivideByZeroException>(async () => await ManOrBoy_Throw(42, 0));
+        }
+
+#pragma warning disable 1998
+        private async ITaskObservable<int> ManOrBoy_Throw(int n, int d)
+        {
+            return n / d;
+        }
+#pragma warning restore 1998
+
+        [Fact]
+        public async Task Basics()
+        {
+            Assert.Equal(45, await ManOrBoy_Basics());
+        }
+
+#pragma warning disable 1998
+        private async ITaskObservable<int> ManOrBoy_Basics()
+        {
+            var res = 0;
+
+            for (var i = 0; i < 10; i++)
+            {
+                switch (i % 4)
+                {
+                    case 0:
+                        res += await Observable.Return(i);
+                        break;
+                    case 1:
+                        res += await Observable.Return(i).Delay(TimeSpan.FromMilliseconds(50));
+                        break;
+                    case 2:
+                        res += await Task.FromResult(i);
+                        break;
+                    case 3:
+                        res += await Task.Run(() => { Task.Delay(50).Wait(); return i; });
+                        break;
+                }
+            }
+
+            return res;
+        }
+#pragma warning restore 1998
+    }
+}

+ 16 - 0
Rx.NET/Source/version.json

@@ -0,0 +1,16 @@
+{
+  "version": "4.0.0-preview.2.build.{height}",
+  "publicReleaseRefSpec": [
+    "^refs/heads/master$", // we release out of master
+    "^refs/heads/develop$", // we release out of develop
+    "^refs/tags/v\\d+\\.\\d+" // we also release tags starting with vN.N
+  ],
+  "nugetPackageVersion":{
+    "semVer": 2
+  },
+  "cloudBuild": {
+    "buildNumber": {
+      "enabled": true
+    }
+  }
+}

部分文件因为文件数量过多而无法显示