Browse Source

Merge pull request #25372 from dotnet-maestro-bot/merge/release/5.0-to-master

[automated] Merge branch 'release/5.0' => 'master'
John Luo 5 years ago
parent
commit
ce16ff0a51
100 changed files with 268 additions and 4571 deletions
  1. 0 88
      AspNetCore.sln
  2. 1 0
      Directory.Build.props
  3. 42 58
      eng/Baseline.Designer.props
  4. 2 0
      eng/Dependencies.props
  5. 0 2
      eng/ProjectReferences.props
  6. 4 0
      eng/Version.Details.xml
  7. 5 3
      eng/Versions.props
  8. 19 3
      eng/targets/ResolveReferences.targets
  9. 34 6
      eng/tools/BaselineGenerator/Program.cs
  10. 0 1
      src/Components/Components.slnf
  11. 10 4
      src/Components/Components/src/Microsoft.AspNetCore.Components.csproj
  12. 1 2
      src/Components/ComponentsNoDeps.slnf
  13. 0 0
      src/Components/Web.JS/dist/Release/blazor.webassembly.js
  14. 1 9
      src/Components/Web.JS/src/Platform/Mono/MonoDebugger.ts
  15. 0 10
      src/Components/WebAssembly/DebugProxy/src/DebugProxyOptions.cs
  16. 0 65
      src/Components/WebAssembly/DebugProxy/src/Hosting/DebugProxyHost.cs
  17. 0 30
      src/Components/WebAssembly/DebugProxy/src/Microsoft.AspNetCore.Components.WebAssembly.DebugProxy.csproj
  18. 0 843
      src/Components/WebAssembly/DebugProxy/src/MonoDebugProxy/ws-proxy/DebugStore.cs
  19. 0 298
      src/Components/WebAssembly/DebugProxy/src/MonoDebugProxy/ws-proxy/DevToolsHelper.cs
  20. 0 337
      src/Components/WebAssembly/DebugProxy/src/MonoDebugProxy/ws-proxy/DevToolsProxy.cs
  21. 0 182
      src/Components/WebAssembly/DebugProxy/src/MonoDebugProxy/ws-proxy/EvaluateExpression.cs
  22. 0 885
      src/Components/WebAssembly/DebugProxy/src/MonoDebugProxy/ws-proxy/MonoProxy.cs
  23. 0 71
      src/Components/WebAssembly/DebugProxy/src/Program.cs
  24. 0 45
      src/Components/WebAssembly/DebugProxy/src/Startup.cs
  25. 1 0
      src/Components/WebAssembly/Sdk/src/targets/BlazorWasm.web.config
  26. 14 5
      src/Components/WebAssembly/Server/src/DebugProxyLauncher.cs
  27. 3 25
      src/Components/WebAssembly/Server/src/Microsoft.AspNetCore.Components.WebAssembly.Server.csproj
  28. 14 12
      src/Components/WebAssembly/Server/src/TargetPickerUi.cs
  29. 18 4
      src/Components/WebAssembly/Server/src/WebAssemblyNetDebugProxyAppBuilderExtensions.cs
  30. 8 4
      src/Components/WebAssembly/WebAssembly/src/Microsoft.AspNetCore.Components.WebAssembly.csproj
  31. 1 1
      src/Configuration.KeyPerFile/src/Microsoft.Extensions.Configuration.KeyPerFile.csproj
  32. 1 1
      src/Configuration.KeyPerFile/test/Microsoft.Extensions.Configuration.KeyPerFile.Tests.csproj
  33. 1 1
      src/DataProtection/Abstractions/src/Microsoft.AspNetCore.DataProtection.Abstractions.csproj
  34. 1 1
      src/DataProtection/Abstractions/test/Microsoft.AspNetCore.DataProtection.Abstractions.Tests.csproj
  35. 1 1
      src/DataProtection/Cryptography.Internal/src/Microsoft.AspNetCore.Cryptography.Internal.csproj
  36. 1 1
      src/DataProtection/Cryptography.Internal/test/Microsoft.AspNetCore.Cryptography.Internal.Tests.csproj
  37. 1 1
      src/DataProtection/Cryptography.KeyDerivation/src/Microsoft.AspNetCore.Cryptography.KeyDerivation.csproj
  38. 1 1
      src/DataProtection/Cryptography.KeyDerivation/src/PBKDF2/Pbkdf2Util.cs
  39. 1 1
      src/DataProtection/Cryptography.KeyDerivation/test/Microsoft.AspNetCore.Cryptography.KeyDerivation.Tests.csproj
  40. 19 0
      src/DataProtection/Cryptography.KeyDerivation/test/Pbkdf2Tests.cs
  41. 2 2
      src/DataProtection/DataProtection/src/Managed/ManagedGenRandomImpl.cs
  42. 5 2
      src/DataProtection/DataProtection/src/Microsoft.AspNetCore.DataProtection.csproj
  43. 1 1
      src/DataProtection/Extensions/src/Microsoft.AspNetCore.DataProtection.Extensions.csproj
  44. 1 1
      src/DataProtection/Extensions/test/Microsoft.AspNetCore.DataProtection.Extensions.Tests.csproj
  45. 1 1
      src/DataProtection/StackExchangeRedis/src/Microsoft.AspNetCore.DataProtection.StackExchangeRedis.csproj
  46. 1 1
      src/DataProtection/StackExchangeRedis/test/Microsoft.AspNetCore.DataProtection.StackExchangeRedis.Tests.csproj
  47. 1 1
      src/Features/JsonPatch/src/Microsoft.AspNetCore.JsonPatch.csproj
  48. 1 1
      src/Features/JsonPatch/test/Microsoft.AspNetCore.JsonPatch.Tests.csproj
  49. 1 1
      src/FileProviders/Embedded/src/Microsoft.Extensions.FileProviders.Embedded.csproj
  50. 1 1
      src/FileProviders/Embedded/test/Microsoft.Extensions.FileProviders.Embedded.Tests.csproj
  51. 1 1
      src/HealthChecks/Abstractions/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions.csproj
  52. 1 1
      src/HealthChecks/HealthChecks/src/Microsoft.Extensions.Diagnostics.HealthChecks.csproj
  53. 1 1
      src/HealthChecks/HealthChecks/test/Microsoft.Extensions.Diagnostics.HealthChecks.Tests.csproj
  54. 5 0
      src/Hosting/TestHost/src/Microsoft.AspNetCore.TestHost.csproj
  55. 10 2
      src/Http/Http.Features/src/Microsoft.AspNetCore.Http.Features.csproj
  56. 1 1
      src/Http/Http.Features/test/Microsoft.AspNetCore.Http.Features.Tests.csproj
  57. 1 1
      src/Http/Metadata/src/Microsoft.AspNetCore.Metadata.csproj
  58. 4 2
      src/Identity/Extensions.Core/src/Microsoft.Extensions.Identity.Core.csproj
  59. 3 3
      src/Identity/Extensions.Core/src/PasswordHasher.cs
  60. 3 3
      src/Identity/Extensions.Core/src/Rfc6238AuthenticationService.cs
  61. 2 2
      src/Identity/Extensions.Core/src/UserManager.cs
  62. 1 2
      src/Identity/Extensions.Stores/src/Microsoft.Extensions.Identity.Stores.csproj
  63. 0 4
      src/Identity/Specification.Tests/src/Microsoft.AspNetCore.Identity.Specification.Tests.csproj
  64. 5 0
      src/Identity/UI/src/Microsoft.AspNetCore.Identity.UI.csproj
  65. 1 1
      src/Localization/Abstractions/src/Microsoft.Extensions.Localization.Abstractions.csproj
  66. 1 1
      src/Localization/Localization/src/Microsoft.Extensions.Localization.csproj
  67. 1 1
      src/Localization/Localization/test/Microsoft.Extensions.Localization.RootNamespace.Tests/Microsoft.Extensions.Localization.RootNamespace.Tests.csproj
  68. 1 1
      src/Localization/Localization/test/Microsoft.Extensions.Localization.Tests/Microsoft.Extensions.Localization.Tests.csproj
  69. 5 1
      src/Logging.AzureAppServices/src/Microsoft.Extensions.Logging.AzureAppServices.csproj
  70. 1 1
      src/Logging.AzureAppServices/test/Microsoft.Extensions.Logging.AzureAppServices.Tests.csproj
  71. 0 340
      src/Middleware/NodeServices/README.md
  72. 0 47
      src/Middleware/NodeServices/samples/NodeServicesExamples/Controllers/HomeController.cs
  73. 0 14
      src/Middleware/NodeServices/samples/NodeServicesExamples/Node/prerenderPage.js
  74. 0 8
      src/Middleware/NodeServices/samples/NodeServicesExamples/Node/renderChart.js
  75. 0 12
      src/Middleware/NodeServices/samples/NodeServicesExamples/Node/transpilation.js
  76. 0 24
      src/Middleware/NodeServices/samples/NodeServicesExamples/NodeServicesExamples.csproj
  77. 0 25
      src/Middleware/NodeServices/samples/NodeServicesExamples/Properties/launchSettings.json
  78. 0 83
      src/Middleware/NodeServices/samples/NodeServicesExamples/Startup.cs
  79. 0 12
      src/Middleware/NodeServices/samples/NodeServicesExamples/Views/Home/Chart.cshtml
  80. 0 16
      src/Middleware/NodeServices/samples/NodeServicesExamples/Views/Home/ES2015Transpilation.cshtml
  81. 0 13
      src/Middleware/NodeServices/samples/NodeServicesExamples/Views/Home/Index.cshtml
  82. 0 21
      src/Middleware/NodeServices/samples/NodeServicesExamples/Views/Home/Prerendering.cshtml
  83. 0 6
      src/Middleware/NodeServices/samples/NodeServicesExamples/Views/Shared/Error.cshtml
  84. 0 12
      src/Middleware/NodeServices/samples/NodeServicesExamples/Views/Shared/_Layout.cshtml
  85. 0 2
      src/Middleware/NodeServices/samples/NodeServicesExamples/Views/_ViewImports.cshtml
  86. 0 3
      src/Middleware/NodeServices/samples/NodeServicesExamples/Views/_ViewStart.cshtml
  87. 0 1
      src/Middleware/NodeServices/samples/NodeServicesExamples/appsettings.json
  88. 0 6
      src/Middleware/NodeServices/samples/NodeServicesExamples/jsconfig.json
  89. 0 10
      src/Middleware/NodeServices/samples/NodeServicesExamples/package.json
  90. 0 0
      src/Middleware/NodeServices/samples/NodeServicesExamples/wwwroot/css/chartist.min.css
  91. BIN
      src/Middleware/NodeServices/samples/NodeServicesExamples/wwwroot/favicon.ico
  92. 0 7
      src/Middleware/NodeServices/samples/NodeServicesExamples/wwwroot/js/main.js
  93. 0 9
      src/Middleware/NodeServices/samples/NodeServicesExamples/wwwroot/web.config
  94. 0 30
      src/Middleware/NodeServices/src/Configuration/NodeServicesFactory.cs
  95. 0 118
      src/Middleware/NodeServices/src/Configuration/NodeServicesOptions.cs
  96. 0 47
      src/Middleware/NodeServices/src/Configuration/NodeServicesServiceCollectionExtensions.cs
  97. 0 416
      src/Middleware/NodeServices/src/Content/Node/entrypoint-http.js
  98. 0 161
      src/Middleware/NodeServices/src/HostingModels/HttpNodeInstance.cs
  99. 0 27
      src/Middleware/NodeServices/src/HostingModels/INodeInstance.cs
  100. 0 59
      src/Middleware/NodeServices/src/HostingModels/NodeInvocationException.cs

+ 0 - 88
AspNetCore.sln

@@ -393,10 +393,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "HttpOverrides", "HttpOverri
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.HttpOverrides", "src\Middleware\HttpOverrides\src\Microsoft.AspNetCore.HttpOverrides.csproj", "{34F24889-22D2-40A1-A2AB-A43B9061FE0D}"
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NodeServices", "NodeServices", "{ED90A0D9-867B-4212-846F-3E09D60A5B7E}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.NodeServices", "src\Middleware\NodeServices\src\Microsoft.AspNetCore.NodeServices.csproj", "{C68A3531-E47A-4F2F-842E-4A3A7C844CC1}"
-EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ResponseCompression", "ResponseCompression", "{512EFCA7-1590-492A-8D06-84744F79DA91}"
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.ResponseCompression", "src\Middleware\ResponseCompression\src\Microsoft.AspNetCore.ResponseCompression.csproj", "{CC783D3A-71CB-4DFD-9769-9EC7EF1ADF1B}"
@@ -405,10 +401,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SpaServices.Extensions", "S
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.SpaServices.Extensions", "src\Middleware\SpaServices.Extensions\src\Microsoft.AspNetCore.SpaServices.Extensions.csproj", "{566B6729-63FF-484D-8F47-91561D76F445}"
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SpaServices", "SpaServices", "{1EBEF6FF-4A0D-4668-A9F3-74587ECAC969}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.SpaServices", "src\Middleware\SpaServices\src\Microsoft.AspNetCore.SpaServices.csproj", "{797B9228-5BC9-4C0C-B444-C490A98D057E}"
-EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mvc.Analyzers", "Mvc.Analyzers", "{515282B6-6EF9-46E0-8EF1-DBD1CD948D9E}"
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Mvc.Analyzers", "src\Mvc\Mvc.Analyzers\src\Microsoft.AspNetCore.Mvc.Analyzers.csproj", "{02A85F31-A092-4322-A3D9-91E894D9ECD2}"
@@ -493,10 +485,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Authentication.Msal", "Auth
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Authentication.WebAssembly.Msal", "src\Components\WebAssembly\Authentication.Msal\src\Microsoft.Authentication.WebAssembly.Msal.csproj", "{09F72EF0-2BDE-4B73-B116-A87E38C432FE}"
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DebugProxy", "DebugProxy", "{F01E5B0D-1277-481D-8879-41A87F3F9524}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Components.WebAssembly.DebugProxy", "src\Components\WebAssembly\DebugProxy\src\Microsoft.AspNetCore.Components.WebAssembly.DebugProxy.csproj", "{67F51062-6897-4019-AA88-6BDB5E30B015}"
-EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "JSInterop", "JSInterop", "{44161B20-CC30-403A-AC94-247592ED7590}"
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.JSInterop.WebAssembly", "src\Components\WebAssembly\JSInterop\src\Microsoft.JSInterop.WebAssembly.csproj", "{E0B1F2AA-4EBA-4DC7-92D5-2F081354C8DE}"
@@ -839,12 +827,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "HttpSys", "HttpSys", "{166E
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Server.HttpSys", "src\Servers\HttpSys\src\Microsoft.AspNetCore.Server.HttpSys.csproj", "{AC0CBDEB-B750-4B81-AEC3-F218A384FB16}"
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{81AF139E-F3BB-46FD-B8DB-93A645E5222C}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NodeServicesExamples", "src\Middleware\NodeServices\samples\NodeServicesExamples\NodeServicesExamples.csproj", "{49EAD781-92BF-4863-9159-08674548D1BE}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.NodeServices.Tests", "src\Middleware\NodeServices\test\Microsoft.AspNetCore.NodeServices.Tests.csproj", "{F7E4CC45-B553-4D58-8B3E-B9F426FAF67F}"
-EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "HeaderPropagation", "HeaderPropagation", "{5527E368-FD50-4E8C-B8D8-C3D1374BE4F1}"
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.HeaderPropagation", "src\Middleware\HeaderPropagation\src\Microsoft.AspNetCore.HeaderPropagation.csproj", "{EC7CA990-BB0E-44AF-81B6-44E0E27FDE9B}"
@@ -877,8 +859,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "perf", "perf", "{EE65018D-F
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.WebSockets.Microbenchmarks", "src\Middleware\perf\Microbenchmarks\Microsoft.AspNetCore.WebSockets.Microbenchmarks.csproj", "{A8E1962B-688E-44B3-81F3-BBB9891534CE}"
 EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.SpaServices.Tests", "src\Middleware\SpaServices\test\Microsoft.AspNetCore.SpaServices.Tests.csproj", "{81E8CF5B-F285-40C6-B935-6E5F7AA7A072}"
-EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.ResponseCaching.Microbenchmarks", "src\Middleware\perf\ResponseCaching.Microbenchmarks\Microsoft.AspNetCore.ResponseCaching.Microbenchmarks.csproj", "{8A745E35-8098-4EB4-AC55-587B9F0DC4BE}"
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MusicStore", "MusicStore", "{884AED21-7931-42A3-B08A-E58F7B0D6E7F}"
@@ -2623,18 +2603,6 @@ Global
 		{34F24889-22D2-40A1-A2AB-A43B9061FE0D}.Release|x64.Build.0 = Release|Any CPU
 		{34F24889-22D2-40A1-A2AB-A43B9061FE0D}.Release|x86.ActiveCfg = Release|Any CPU
 		{34F24889-22D2-40A1-A2AB-A43B9061FE0D}.Release|x86.Build.0 = Release|Any CPU
-		{C68A3531-E47A-4F2F-842E-4A3A7C844CC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{C68A3531-E47A-4F2F-842E-4A3A7C844CC1}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{C68A3531-E47A-4F2F-842E-4A3A7C844CC1}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{C68A3531-E47A-4F2F-842E-4A3A7C844CC1}.Debug|x64.Build.0 = Debug|Any CPU
-		{C68A3531-E47A-4F2F-842E-4A3A7C844CC1}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{C68A3531-E47A-4F2F-842E-4A3A7C844CC1}.Debug|x86.Build.0 = Debug|Any CPU
-		{C68A3531-E47A-4F2F-842E-4A3A7C844CC1}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{C68A3531-E47A-4F2F-842E-4A3A7C844CC1}.Release|Any CPU.Build.0 = Release|Any CPU
-		{C68A3531-E47A-4F2F-842E-4A3A7C844CC1}.Release|x64.ActiveCfg = Release|Any CPU
-		{C68A3531-E47A-4F2F-842E-4A3A7C844CC1}.Release|x64.Build.0 = Release|Any CPU
-		{C68A3531-E47A-4F2F-842E-4A3A7C844CC1}.Release|x86.ActiveCfg = Release|Any CPU
-		{C68A3531-E47A-4F2F-842E-4A3A7C844CC1}.Release|x86.Build.0 = Release|Any CPU
 		{CC783D3A-71CB-4DFD-9769-9EC7EF1ADF1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{CC783D3A-71CB-4DFD-9769-9EC7EF1ADF1B}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{CC783D3A-71CB-4DFD-9769-9EC7EF1ADF1B}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -2659,18 +2627,6 @@ Global
 		{566B6729-63FF-484D-8F47-91561D76F445}.Release|x64.Build.0 = Release|Any CPU
 		{566B6729-63FF-484D-8F47-91561D76F445}.Release|x86.ActiveCfg = Release|Any CPU
 		{566B6729-63FF-484D-8F47-91561D76F445}.Release|x86.Build.0 = Release|Any CPU
-		{797B9228-5BC9-4C0C-B444-C490A98D057E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{797B9228-5BC9-4C0C-B444-C490A98D057E}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{797B9228-5BC9-4C0C-B444-C490A98D057E}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{797B9228-5BC9-4C0C-B444-C490A98D057E}.Debug|x64.Build.0 = Debug|Any CPU
-		{797B9228-5BC9-4C0C-B444-C490A98D057E}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{797B9228-5BC9-4C0C-B444-C490A98D057E}.Debug|x86.Build.0 = Debug|Any CPU
-		{797B9228-5BC9-4C0C-B444-C490A98D057E}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{797B9228-5BC9-4C0C-B444-C490A98D057E}.Release|Any CPU.Build.0 = Release|Any CPU
-		{797B9228-5BC9-4C0C-B444-C490A98D057E}.Release|x64.ActiveCfg = Release|Any CPU
-		{797B9228-5BC9-4C0C-B444-C490A98D057E}.Release|x64.Build.0 = Release|Any CPU
-		{797B9228-5BC9-4C0C-B444-C490A98D057E}.Release|x86.ActiveCfg = Release|Any CPU
-		{797B9228-5BC9-4C0C-B444-C490A98D057E}.Release|x86.Build.0 = Release|Any CPU
 		{02A85F31-A092-4322-A3D9-91E894D9ECD2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{02A85F31-A092-4322-A3D9-91E894D9ECD2}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{02A85F31-A092-4322-A3D9-91E894D9ECD2}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -4303,30 +4259,6 @@ Global
 		{AC0CBDEB-B750-4B81-AEC3-F218A384FB16}.Release|x64.Build.0 = Release|Any CPU
 		{AC0CBDEB-B750-4B81-AEC3-F218A384FB16}.Release|x86.ActiveCfg = Release|Any CPU
 		{AC0CBDEB-B750-4B81-AEC3-F218A384FB16}.Release|x86.Build.0 = Release|Any CPU
-		{49EAD781-92BF-4863-9159-08674548D1BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{49EAD781-92BF-4863-9159-08674548D1BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{49EAD781-92BF-4863-9159-08674548D1BE}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{49EAD781-92BF-4863-9159-08674548D1BE}.Debug|x64.Build.0 = Debug|Any CPU
-		{49EAD781-92BF-4863-9159-08674548D1BE}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{49EAD781-92BF-4863-9159-08674548D1BE}.Debug|x86.Build.0 = Debug|Any CPU
-		{49EAD781-92BF-4863-9159-08674548D1BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{49EAD781-92BF-4863-9159-08674548D1BE}.Release|Any CPU.Build.0 = Release|Any CPU
-		{49EAD781-92BF-4863-9159-08674548D1BE}.Release|x64.ActiveCfg = Release|Any CPU
-		{49EAD781-92BF-4863-9159-08674548D1BE}.Release|x64.Build.0 = Release|Any CPU
-		{49EAD781-92BF-4863-9159-08674548D1BE}.Release|x86.ActiveCfg = Release|Any CPU
-		{49EAD781-92BF-4863-9159-08674548D1BE}.Release|x86.Build.0 = Release|Any CPU
-		{F7E4CC45-B553-4D58-8B3E-B9F426FAF67F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{F7E4CC45-B553-4D58-8B3E-B9F426FAF67F}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{F7E4CC45-B553-4D58-8B3E-B9F426FAF67F}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{F7E4CC45-B553-4D58-8B3E-B9F426FAF67F}.Debug|x64.Build.0 = Debug|Any CPU
-		{F7E4CC45-B553-4D58-8B3E-B9F426FAF67F}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{F7E4CC45-B553-4D58-8B3E-B9F426FAF67F}.Debug|x86.Build.0 = Debug|Any CPU
-		{F7E4CC45-B553-4D58-8B3E-B9F426FAF67F}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{F7E4CC45-B553-4D58-8B3E-B9F426FAF67F}.Release|Any CPU.Build.0 = Release|Any CPU
-		{F7E4CC45-B553-4D58-8B3E-B9F426FAF67F}.Release|x64.ActiveCfg = Release|Any CPU
-		{F7E4CC45-B553-4D58-8B3E-B9F426FAF67F}.Release|x64.Build.0 = Release|Any CPU
-		{F7E4CC45-B553-4D58-8B3E-B9F426FAF67F}.Release|x86.ActiveCfg = Release|Any CPU
-		{F7E4CC45-B553-4D58-8B3E-B9F426FAF67F}.Release|x86.Build.0 = Release|Any CPU
 		{EC7CA990-BB0E-44AF-81B6-44E0E27FDE9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{EC7CA990-BB0E-44AF-81B6-44E0E27FDE9B}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{EC7CA990-BB0E-44AF-81B6-44E0E27FDE9B}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -4447,18 +4379,6 @@ Global
 		{A8E1962B-688E-44B3-81F3-BBB9891534CE}.Release|x64.Build.0 = Release|Any CPU
 		{A8E1962B-688E-44B3-81F3-BBB9891534CE}.Release|x86.ActiveCfg = Release|Any CPU
 		{A8E1962B-688E-44B3-81F3-BBB9891534CE}.Release|x86.Build.0 = Release|Any CPU
-		{81E8CF5B-F285-40C6-B935-6E5F7AA7A072}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{81E8CF5B-F285-40C6-B935-6E5F7AA7A072}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{81E8CF5B-F285-40C6-B935-6E5F7AA7A072}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{81E8CF5B-F285-40C6-B935-6E5F7AA7A072}.Debug|x64.Build.0 = Debug|Any CPU
-		{81E8CF5B-F285-40C6-B935-6E5F7AA7A072}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{81E8CF5B-F285-40C6-B935-6E5F7AA7A072}.Debug|x86.Build.0 = Debug|Any CPU
-		{81E8CF5B-F285-40C6-B935-6E5F7AA7A072}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{81E8CF5B-F285-40C6-B935-6E5F7AA7A072}.Release|Any CPU.Build.0 = Release|Any CPU
-		{81E8CF5B-F285-40C6-B935-6E5F7AA7A072}.Release|x64.ActiveCfg = Release|Any CPU
-		{81E8CF5B-F285-40C6-B935-6E5F7AA7A072}.Release|x64.Build.0 = Release|Any CPU
-		{81E8CF5B-F285-40C6-B935-6E5F7AA7A072}.Release|x86.ActiveCfg = Release|Any CPU
-		{81E8CF5B-F285-40C6-B935-6E5F7AA7A072}.Release|x86.Build.0 = Release|Any CPU
 		{8A745E35-8098-4EB4-AC55-587B9F0DC4BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{8A745E35-8098-4EB4-AC55-587B9F0DC4BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{8A745E35-8098-4EB4-AC55-587B9F0DC4BE}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -7391,14 +7311,10 @@ Global
 		{7FC5CFC7-9BFE-4C19-90DE-A84A76A8E03D} = {58915BB2-CEF5-4CA3-8886-A61156564505}
 		{39086512-EBC8-4061-BE34-DCCA5D1BA585} = {E5963C9F-20A6-4385-B364-814D2581FADF}
 		{34F24889-22D2-40A1-A2AB-A43B9061FE0D} = {39086512-EBC8-4061-BE34-DCCA5D1BA585}
-		{ED90A0D9-867B-4212-846F-3E09D60A5B7E} = {E5963C9F-20A6-4385-B364-814D2581FADF}
-		{C68A3531-E47A-4F2F-842E-4A3A7C844CC1} = {ED90A0D9-867B-4212-846F-3E09D60A5B7E}
 		{512EFCA7-1590-492A-8D06-84744F79DA91} = {E5963C9F-20A6-4385-B364-814D2581FADF}
 		{CC783D3A-71CB-4DFD-9769-9EC7EF1ADF1B} = {512EFCA7-1590-492A-8D06-84744F79DA91}
 		{B06D06BD-DE60-46E8-AC05-0C1D39E40638} = {E5963C9F-20A6-4385-B364-814D2581FADF}
 		{566B6729-63FF-484D-8F47-91561D76F445} = {B06D06BD-DE60-46E8-AC05-0C1D39E40638}
-		{1EBEF6FF-4A0D-4668-A9F3-74587ECAC969} = {E5963C9F-20A6-4385-B364-814D2581FADF}
-		{797B9228-5BC9-4C0C-B444-C490A98D057E} = {1EBEF6FF-4A0D-4668-A9F3-74587ECAC969}
 		{515282B6-6EF9-46E0-8EF1-DBD1CD948D9E} = {1A0EFF9F-E699-4303-AE50-BFAF9804EEB6}
 		{02A85F31-A092-4322-A3D9-91E894D9ECD2} = {515282B6-6EF9-46E0-8EF1-DBD1CD948D9E}
 		{33CAD745-5912-47D3-BAF3-5AE580FED275} = {D67E977E-75DF-41EE-8315-6DBF5C2B7357}
@@ -7614,9 +7530,6 @@ Global
 		{A01B523B-35CA-4C14-B792-3887F8741E99} = {48BEABD3-2446-466C-8694-D34EF0949369}
 		{166E48ED-9738-4E13-8618-0D805F6F0F65} = {0ACCEDA7-339C-4B4D-8DD4-1AC271F31C04}
 		{AC0CBDEB-B750-4B81-AEC3-F218A384FB16} = {166E48ED-9738-4E13-8618-0D805F6F0F65}
-		{81AF139E-F3BB-46FD-B8DB-93A645E5222C} = {ED90A0D9-867B-4212-846F-3E09D60A5B7E}
-		{49EAD781-92BF-4863-9159-08674548D1BE} = {81AF139E-F3BB-46FD-B8DB-93A645E5222C}
-		{F7E4CC45-B553-4D58-8B3E-B9F426FAF67F} = {ED90A0D9-867B-4212-846F-3E09D60A5B7E}
 		{5527E368-FD50-4E8C-B8D8-C3D1374BE4F1} = {E5963C9F-20A6-4385-B364-814D2581FADF}
 		{EC7CA990-BB0E-44AF-81B6-44E0E27FDE9B} = {5527E368-FD50-4E8C-B8D8-C3D1374BE4F1}
 		{399AC9FB-7DCA-4868-B299-2EE4C88D41AD} = {5527E368-FD50-4E8C-B8D8-C3D1374BE4F1}
@@ -7633,7 +7546,6 @@ Global
 		{AF964703-404B-4632-9D1F-8EEE646BBA37} = {B06D06BD-DE60-46E8-AC05-0C1D39E40638}
 		{EE65018D-FA12-461D-B2C5-44CA6E385530} = {E5963C9F-20A6-4385-B364-814D2581FADF}
 		{A8E1962B-688E-44B3-81F3-BBB9891534CE} = {EE65018D-FA12-461D-B2C5-44CA6E385530}
-		{81E8CF5B-F285-40C6-B935-6E5F7AA7A072} = {1EBEF6FF-4A0D-4668-A9F3-74587ECAC969}
 		{8A745E35-8098-4EB4-AC55-587B9F0DC4BE} = {EE65018D-FA12-461D-B2C5-44CA6E385530}
 		{884AED21-7931-42A3-B08A-E58F7B0D6E7F} = {017429CC-C5FB-48B4-9C46-034E29EE2F06}
 		{8DA88110-5A13-41A9-9F9D-674D921EB442} = {884AED21-7931-42A3-B08A-E58F7B0D6E7F}

+ 1 - 0
Directory.Build.props

@@ -90,6 +90,7 @@
 
     <!-- Also update the DefaultNetCoreTargetFramework defined at src/Razor/test/testassets/Directory.Build.props -->
     <DefaultNetCoreTargetFramework>net5.0</DefaultNetCoreTargetFramework>
+    <DefaultNetFxTargetFramework>net461</DefaultNetFxTargetFramework>
   </PropertyGroup>
 
   <!-- Warnings and errors -->

+ 42 - 58
eng/Baseline.Designer.props

@@ -8,12 +8,10 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'AspNetCoreRuntime.3.0.x64' ">
     <BaselinePackageVersion>3.0.3</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'AspNetCoreRuntime.3.0.x64' AND '$(TargetFramework)' == 'net461' " />
   <!-- Package: AspNetCoreRuntime.3.0.x86-->
   <PropertyGroup Condition=" '$(PackageId)' == 'AspNetCoreRuntime.3.0.x86' ">
     <BaselinePackageVersion>3.0.3</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'AspNetCoreRuntime.3.0.x86' AND '$(TargetFramework)' == 'net461' " />
   <!-- Package: dotnet-sql-cache-->
   <PropertyGroup Condition=" '$(PackageId)' == 'dotnet-sql-cache' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
@@ -29,7 +27,7 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.ApiAuthorization.IdentityServer' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.ApiAuthorization.IdentityServer' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.ApiAuthorization.IdentityServer' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="[3.1.7, )" />
@@ -48,7 +46,7 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Authentication.AzureAD.UI' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Authentication.AzureAD.UI' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Authentication.AzureAD.UI' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="[3.1.7, )" />
   </ItemGroup>
@@ -56,7 +54,7 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Authentication.AzureADB2C.UI' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Authentication.AzureADB2C.UI' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Authentication.AzureADB2C.UI' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="[3.1.7, )" />
   </ItemGroup>
@@ -64,53 +62,48 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Authentication.Certificate' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Authentication.Certificate' AND '$(TargetFramework)' == 'netcoreapp3.1' " />
   <!-- Package: Microsoft.AspNetCore.Authentication.Facebook-->
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Authentication.Facebook' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Authentication.Facebook' AND '$(TargetFramework)' == 'netcoreapp3.1' " />
   <!-- Package: Microsoft.AspNetCore.Authentication.Google-->
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Authentication.Google' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Authentication.Google' AND '$(TargetFramework)' == 'netcoreapp3.1' " />
   <!-- Package: Microsoft.AspNetCore.Authentication.JwtBearer-->
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Authentication.JwtBearer' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Authentication.JwtBearer' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Authentication.JwtBearer' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="[5.5.0, )" />
   </ItemGroup>
   <!-- Package: Microsoft.AspNetCore.Authentication.MicrosoftAccount-->
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Authentication.MicrosoftAccount' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Authentication.MicrosoftAccount' AND '$(TargetFramework)' == 'netcoreapp3.1' " />
   <!-- Package: Microsoft.AspNetCore.Authentication.Negotiate-->
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Authentication.Negotiate' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Authentication.Negotiate' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Authentication.Negotiate' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.AspNetCore.Connections.Abstractions" Version="[3.1.7, )" />
   </ItemGroup>
   <!-- Package: Microsoft.AspNetCore.Authentication.OpenIdConnect-->
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Authentication.OpenIdConnect' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Authentication.OpenIdConnect' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Authentication.OpenIdConnect' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="[5.5.0, )" />
   </ItemGroup>
   <!-- Package: Microsoft.AspNetCore.Authentication.Twitter-->
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Authentication.Twitter' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Authentication.Twitter' AND '$(TargetFramework)' == 'netcoreapp3.1' " />
   <!-- Package: Microsoft.AspNetCore.Authentication.WsFederation-->
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Authentication.WsFederation' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Authentication.WsFederation' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Authentication.WsFederation' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.IdentityModel.Protocols.WsFederation" Version="[5.5.0, )" />
     <BaselinePackageReference Include="System.IdentityModel.Tokens.Jwt" Version="[5.5.0, )" />
   </ItemGroup>
@@ -118,7 +111,7 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Authorization' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Authorization' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Authorization' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.AspNetCore.Metadata" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.Extensions.Options" Version="[3.1.7, )" />
@@ -132,7 +125,7 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.AzureAppServices.HostingStartup' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.AzureAppServices.HostingStartup' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.AzureAppServices.HostingStartup' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.AspNetCore.AzureAppServicesIntegration" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="[3.1.7, )" />
   </ItemGroup>
@@ -147,7 +140,7 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.AzureAppServicesIntegration' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.AzureAppServicesIntegration' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.AzureAppServicesIntegration' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.Extensions.Logging.AzureAppServices" Version="[3.1.7, )" />
   </ItemGroup>
   <!-- Package: Microsoft.AspNetCore.Components-->
@@ -160,7 +153,7 @@
     <BaselinePackageReference Include="Microsoft.JSInterop" Version="[3.1.7, )" />
     <BaselinePackageReference Include="System.ComponentModel.Annotations" Version="[4.7.0, )" />
   </ItemGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Components' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Components' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.AspNetCore.Components.Analyzers" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.AspNetCore.Authorization" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.JSInterop" Version="[3.1.7, )" />
@@ -173,7 +166,7 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Components.Authorization' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Components.Authorization' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Components.Authorization' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.AspNetCore.Components" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.AspNetCore.Authorization" Version="[3.1.7, )" />
   </ItemGroup>
@@ -185,7 +178,7 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Components.Forms' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Components.Forms' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Components.Forms' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.AspNetCore.Components" Version="[3.1.7, )" />
   </ItemGroup>
   <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Components.Forms' AND '$(TargetFramework)' == 'netstandard2.0' ">
@@ -196,7 +189,7 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Components.Web' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Components.Web' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Components.Web' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.AspNetCore.Components" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.AspNetCore.Components.Forms" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.Extensions.DependencyInjection" Version="[3.1.7, )" />
@@ -230,7 +223,6 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Components.WebAssembly.Server' ">
     <BaselinePackageVersion>3.2.1</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Components.WebAssembly.Server' AND '$(TargetFramework)' == 'netcoreapp3.1' " />
   <!-- Package: Microsoft.AspNetCore.Components.WebAssembly.Authentication-->
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Components.WebAssembly.Authentication' ">
     <BaselinePackageVersion>3.2.1</BaselinePackageVersion>
@@ -243,7 +235,6 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Components.WebAssembly.HttpHandler' ">
     <BaselinePackageVersion>3.2.1</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Components.WebAssembly.HttpHandler' AND '$(TargetFramework)' == 'netstandard2.1' " />
   <!-- Package: Microsoft.JSInterop.WebAssembly-->
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.JSInterop.WebAssembly' ">
     <BaselinePackageVersion>3.2.1</BaselinePackageVersion>
@@ -255,7 +246,7 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.ConcurrencyLimiter' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.ConcurrencyLimiter' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.ConcurrencyLimiter' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.Extensions.Options" Version="[3.1.7, )" />
   </ItemGroup>
@@ -263,7 +254,7 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Connections.Abstractions' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Connections.Abstractions' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Connections.Abstractions' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.AspNetCore.Http.Features" Version="[3.1.7, )" />
     <BaselinePackageReference Include="System.IO.Pipelines" Version="[4.7.1, )" />
   </ItemGroup>
@@ -280,8 +271,6 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Cryptography.Internal' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Cryptography.Internal' AND '$(TargetFramework)' == 'netcoreapp3.1' " />
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Cryptography.Internal' AND '$(TargetFramework)' == 'netstandard2.0' " />
   <!-- Package: Microsoft.AspNetCore.Cryptography.KeyDerivation-->
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Cryptography.KeyDerivation' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
@@ -289,7 +278,7 @@
   <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Cryptography.KeyDerivation' AND '$(TargetFramework)' == 'netcoreapp2.0' ">
     <BaselinePackageReference Include="Microsoft.AspNetCore.Cryptography.Internal" Version="[3.1.7, )" />
   </ItemGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Cryptography.KeyDerivation' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Cryptography.KeyDerivation' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.AspNetCore.Cryptography.Internal" Version="[3.1.7, )" />
   </ItemGroup>
   <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Cryptography.KeyDerivation' AND '$(TargetFramework)' == 'netstandard2.0' ">
@@ -299,7 +288,7 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.DataProtection' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.DataProtection' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.DataProtection' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.AspNetCore.DataProtection.Abstractions" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.AspNetCore.Cryptography.Internal" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="[3.1.7, )" />
@@ -324,8 +313,6 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.DataProtection.Abstractions' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.DataProtection.Abstractions' AND '$(TargetFramework)' == 'netcoreapp3.1' " />
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.DataProtection.Abstractions' AND '$(TargetFramework)' == 'netstandard2.0' " />
   <!-- Package: Microsoft.AspNetCore.DataProtection.AzureKeyVault-->
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.DataProtection.AzureKeyVault' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
@@ -356,7 +343,7 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.DataProtection.Extensions' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.DataProtection.Extensions' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.DataProtection.Extensions' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.AspNetCore.DataProtection" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.Extensions.DependencyInjection" Version="[3.1.7, )" />
   </ItemGroup>
@@ -376,14 +363,14 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="[3.1.7, )" />
   </ItemGroup>
   <!-- Package: Microsoft.AspNetCore.HeaderPropagation-->
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.HeaderPropagation' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.HeaderPropagation' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.HeaderPropagation' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.Extensions.DependencyInjection" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.Extensions.Http" Version="[3.1.7, )" />
   </ItemGroup>
@@ -391,7 +378,7 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Hosting.WindowsServices' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Hosting.WindowsServices' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Hosting.WindowsServices' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="System.ServiceProcess.ServiceController" Version="[4.7.0, )" />
   </ItemGroup>
   <!-- Package: Microsoft.AspNetCore.Http.Connections.Client-->
@@ -412,7 +399,7 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Http.Connections.Common' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Http.Connections.Common' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Http.Connections.Common' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.AspNetCore.Connections.Abstractions" Version="[3.1.7, )" />
   </ItemGroup>
   <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Http.Connections.Common' AND '$(TargetFramework)' == 'netstandard2.0' ">
@@ -423,7 +410,7 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Http.Features' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Http.Features' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Http.Features' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.Extensions.Primitives" Version="[3.1.7, )" />
     <BaselinePackageReference Include="System.IO.Pipelines" Version="[4.7.1, )" />
   </ItemGroup>
@@ -435,7 +422,7 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Identity.EntityFrameworkCore' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Identity.EntityFrameworkCore' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Identity.EntityFrameworkCore' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.Extensions.Identity.Stores" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="[3.1.7, )" />
   </ItemGroup>
@@ -447,7 +434,7 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Identity.Specification.Tests' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Identity.Specification.Tests' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Identity.Specification.Tests' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.Extensions.Configuration" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.Extensions.DependencyInjection" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.Extensions.Logging" Version="[3.1.7, )" />
@@ -458,7 +445,7 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Identity.UI' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Identity.UI' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Identity.UI' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.Extensions.Identity.Stores" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Newtonsoft.Json" Version="[12.0.2, )" />
@@ -475,20 +462,18 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Metadata' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Metadata' AND '$(TargetFramework)' == 'netcoreapp3.1' " />
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Metadata' AND '$(TargetFramework)' == 'netstandard2.0' " />
   <!-- Package: Microsoft.AspNetCore.MiddlewareAnalysis-->
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.MiddlewareAnalysis' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.MiddlewareAnalysis' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.MiddlewareAnalysis' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="[3.1.7, )" />
   </ItemGroup>
   <!-- Package: Microsoft.AspNetCore.Mvc.NewtonsoftJson-->
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Mvc.NewtonsoftJson' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Mvc.NewtonsoftJson' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Mvc.NewtonsoftJson' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.AspNetCore.JsonPatch" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Newtonsoft.Json" Version="[12.0.2, )" />
     <BaselinePackageReference Include="Newtonsoft.Json.Bson" Version="[1.0.2, )" />
@@ -497,7 +482,7 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.AspNetCore.Mvc.Razor.Extensions" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.CodeAnalysis.Razor" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.Extensions.DependencyModel" Version="[3.1.3, )" />
@@ -506,7 +491,7 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Mvc.Testing' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Mvc.Testing' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Mvc.Testing' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.AspNetCore.TestHost" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.Extensions.DependencyModel" Version="[3.1.3, )" />
     <BaselinePackageReference Include="Microsoft.Extensions.Hosting" Version="[3.1.7, )" />
@@ -515,7 +500,7 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.NodeServices' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.NodeServices' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.NodeServices' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.Extensions.Logging.Console" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Newtonsoft.Json" Version="[12.0.2, )" />
   </ItemGroup>
@@ -523,12 +508,11 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Owin' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Owin' AND '$(TargetFramework)' == 'netcoreapp3.1' " />
   <!-- Package: Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv-->
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.AspNetCore.Connections.Abstractions" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Libuv" Version="[1.10.0, )" />
     <BaselinePackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="[3.1.7, )" />
@@ -565,7 +549,7 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.SignalR.Common' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.SignalR.Common' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.SignalR.Common' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.AspNetCore.Connections.Abstractions" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.Extensions.Options" Version="[3.1.7, )" />
   </ItemGroup>
@@ -578,7 +562,7 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.SignalR.Protocols.Json' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.SignalR.Protocols.Json' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.SignalR.Protocols.Json' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.AspNetCore.SignalR.Common" Version="[3.1.7, )" />
   </ItemGroup>
   <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.SignalR.Protocols.Json' AND '$(TargetFramework)' == 'netstandard2.0' ">
@@ -604,7 +588,7 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.SignalR.Specification.Tests' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.SignalR.Specification.Tests' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.SignalR.Specification.Tests' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.Json" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="[3.1.7, )" />
@@ -616,7 +600,7 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.SignalR.StackExchangeRedis' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.SignalR.StackExchangeRedis' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.SignalR.StackExchangeRedis' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="MessagePack" Version="[1.7.3.7, )" />
     <BaselinePackageReference Include="Microsoft.Extensions.Options" Version="[3.1.7, )" />
     <BaselinePackageReference Include="StackExchange.Redis" Version="[2.0.593, )" />
@@ -625,14 +609,14 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.SpaServices' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.SpaServices' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.SpaServices' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.AspNetCore.NodeServices" Version="[3.1.7, )" />
   </ItemGroup>
   <!-- Package: Microsoft.AspNetCore.SpaServices.Extensions-->
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.SpaServices.Extensions' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.SpaServices.Extensions' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.SpaServices.Extensions' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.AspNetCore.SpaServices" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.Extensions.FileProviders.Physical" Version="[3.1.7, )" />
   </ItemGroup>
@@ -640,7 +624,7 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.TestHost' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.TestHost' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.TestHost' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="System.IO.Pipelines" Version="[4.7.1, )" />
   </ItemGroup>
   <!-- Package: Microsoft.dotnet-openapi-->
@@ -684,7 +668,7 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.Extensions.Identity.Core' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.Extensions.Identity.Core' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.Extensions.Identity.Core' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.Extensions.Logging" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.Extensions.Options" Version="[3.1.7, )" />
@@ -698,7 +682,7 @@
   <PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.Extensions.Identity.Stores' ">
     <BaselinePackageVersion>3.1.7</BaselinePackageVersion>
   </PropertyGroup>
-  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.Extensions.Identity.Stores' AND '$(TargetFramework)' == 'netcoreapp3.1' ">
+  <ItemGroup Condition=" '$(PackageId)' == 'Microsoft.Extensions.Identity.Stores' AND ('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR '$(TargetFramework)' == 'netcoreapp3.1') ">
     <BaselinePackageReference Include="Microsoft.Extensions.Identity.Core" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="[3.1.7, )" />
     <BaselinePackageReference Include="Microsoft.Extensions.Logging" Version="[3.1.7, )" />

+ 2 - 0
eng/Dependencies.props

@@ -69,6 +69,7 @@ and are generated based on the last package release.
     <LatestPackageReference Include="System.IO.Pipelines" />
     <LatestPackageReference Include="System.Net.Http" />
     <LatestPackageReference Include="System.Net.Http.Json" />
+    <LatestPackageReference Include="System.Net.Sockets" />
     <LatestPackageReference Include="System.Reflection.Metadata" />
     <LatestPackageReference Include="System.Runtime.CompilerServices.Unsafe" />
     <LatestPackageReference Include="System.Runtime.InteropServices.RuntimeInformation" />
@@ -123,6 +124,7 @@ and are generated based on the last package release.
     <LatestPackageReference Include="Microsoft.Internal.AspNetCore.H2Spec.All" />
     <LatestPackageReference Include="Microsoft.Extensions.Internal.Transport" />
     <LatestPackageReference Include="Microsoft.NETCore.Windows.ApiSets" />
+    <LatestPackageReference Include="Microsoft.NETCore.BrowserDebugHost.Transport" />
     <LatestPackageReference Include="Microsoft.Owin.Security.Cookies" />
     <LatestPackageReference Include="Microsoft.Owin.Testing" />
     <LatestPackageReference Include="Microsoft.Web.Administration" />

+ 0 - 2
eng/ProjectReferences.props

@@ -86,14 +86,12 @@
     <ProjectReferenceProvider Include="Microsoft.AspNetCore.Localization.Routing" ProjectPath="$(RepoRoot)src\Middleware\Localization.Routing\src\Microsoft.AspNetCore.Localization.Routing.csproj" />
     <ProjectReferenceProvider Include="Microsoft.AspNetCore.Localization" ProjectPath="$(RepoRoot)src\Middleware\Localization\src\Microsoft.AspNetCore.Localization.csproj" />
     <ProjectReferenceProvider Include="Microsoft.AspNetCore.MiddlewareAnalysis" ProjectPath="$(RepoRoot)src\Middleware\MiddlewareAnalysis\src\Microsoft.AspNetCore.MiddlewareAnalysis.csproj" />
-    <ProjectReferenceProvider Include="Microsoft.AspNetCore.NodeServices" ProjectPath="$(RepoRoot)src\Middleware\NodeServices\src\Microsoft.AspNetCore.NodeServices.csproj" />
     <ProjectReferenceProvider Include="Microsoft.AspNetCore.ResponseCaching.Abstractions" ProjectPath="$(RepoRoot)src\Middleware\ResponseCaching.Abstractions\src\Microsoft.AspNetCore.ResponseCaching.Abstractions.csproj" />
     <ProjectReferenceProvider Include="Microsoft.AspNetCore.ResponseCaching" ProjectPath="$(RepoRoot)src\Middleware\ResponseCaching\src\Microsoft.AspNetCore.ResponseCaching.csproj" />
     <ProjectReferenceProvider Include="Microsoft.AspNetCore.ResponseCompression" ProjectPath="$(RepoRoot)src\Middleware\ResponseCompression\src\Microsoft.AspNetCore.ResponseCompression.csproj" />
     <ProjectReferenceProvider Include="Microsoft.AspNetCore.Rewrite" ProjectPath="$(RepoRoot)src\Middleware\Rewrite\src\Microsoft.AspNetCore.Rewrite.csproj" />
     <ProjectReferenceProvider Include="Microsoft.AspNetCore.Session" ProjectPath="$(RepoRoot)src\Middleware\Session\src\Microsoft.AspNetCore.Session.csproj" />
     <ProjectReferenceProvider Include="Microsoft.AspNetCore.SpaServices.Extensions" ProjectPath="$(RepoRoot)src\Middleware\SpaServices.Extensions\src\Microsoft.AspNetCore.SpaServices.Extensions.csproj" />
-    <ProjectReferenceProvider Include="Microsoft.AspNetCore.SpaServices" ProjectPath="$(RepoRoot)src\Middleware\SpaServices\src\Microsoft.AspNetCore.SpaServices.csproj" />
     <ProjectReferenceProvider Include="Microsoft.AspNetCore.StaticFiles" ProjectPath="$(RepoRoot)src\Middleware\StaticFiles\src\Microsoft.AspNetCore.StaticFiles.csproj" />
     <ProjectReferenceProvider Include="Microsoft.AspNetCore.WebSockets" ProjectPath="$(RepoRoot)src\Middleware\WebSockets\src\Microsoft.AspNetCore.WebSockets.csproj" />
     <ProjectReferenceProvider Include="Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X" ProjectPath="$(RepoRoot)src\Razor\Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X\src\Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X.csproj" />

+ 4 - 0
eng/Version.Details.xml

@@ -306,6 +306,10 @@
       <Uri>https://github.com/dotnet/runtime</Uri>
       <Sha>907f7da59b40c80941b02ac2a46650adf3f606bc</Sha>
     </Dependency>
+    <Dependency Name="Microsoft.NETCore.BrowserDebugHost.Transport" Version="5.0.0-rc.1.20417.14">
+      <Uri>https://github.com/dotnet/runtime</Uri>
+      <Sha>907f7da59b40c80941b02ac2a46650adf3f606bc</Sha>
+    </Dependency>
   </ProductDependencies>
   <ToolsetDependencies>
     <!-- Listed explicitly to workaround https://github.com/dotnet/cli/issues/10528 -->

+ 5 - 3
eng/Versions.props

@@ -68,6 +68,7 @@
     <MicrosoftNETCoreAppInternalPackageVersion>5.0.0-rc.1.20417.14</MicrosoftNETCoreAppInternalPackageVersion>
     <MicrosoftNETCoreAppRefPackageVersion>5.0.0-rc.1.20417.14</MicrosoftNETCoreAppRefPackageVersion>
     <MicrosoftNETCoreAppRuntimewinx64PackageVersion>5.0.0-rc.1.20417.14</MicrosoftNETCoreAppRuntimewinx64PackageVersion>
+    <MicrosoftNETCoreBrowserDebugHostTransportPackageVersion>5.0.0-rc.1.20417.14</MicrosoftNETCoreBrowserDebugHostTransportPackageVersion>
     <MicrosoftWin32RegistryPackageVersion>5.0.0-rc.1.20417.14</MicrosoftWin32RegistryPackageVersion>
     <MicrosoftWin32SystemEventsPackageVersion>5.0.0-rc.1.20417.14</MicrosoftWin32SystemEventsPackageVersion>
     <MicrosoftExtensionsCachingAbstractionsPackageVersion>5.0.0-rc.1.20417.14</MicrosoftExtensionsCachingAbstractionsPackageVersion>
@@ -203,7 +204,8 @@
     <SystemCodeDomPackageVersion>4.4.0</SystemCodeDomPackageVersion>
     <SystemCommandlineExperimentalPackageVersion>0.3.0-alpha.19317.1</SystemCommandlineExperimentalPackageVersion>
     <SystemComponentModelPackageVersion>4.3.0</SystemComponentModelPackageVersion>
-    <SystemNetHttpPackageVersion>4.3.2</SystemNetHttpPackageVersion>
+    <SystemNetHttpPackageVersion>4.3.4</SystemNetHttpPackageVersion>
+    <SystemNetSocketsPackageVersion>4.3.0</SystemNetSocketsPackageVersion>
     <SystemRuntimeInteropServicesRuntimeInformationPackageVersion>4.3.0</SystemRuntimeInteropServicesRuntimeInformationPackageVersion>
     <SystemThreadingTasksExtensionsPackageVersion>4.5.3</SystemThreadingTasksExtensionsPackageVersion>
     <SystemValueTuplePackageVersion>4.5.0</SystemValueTuplePackageVersion>
@@ -258,8 +260,8 @@
     <IdentityServer4StoragePackageVersion>4.0.4</IdentityServer4StoragePackageVersion>
     <IdentityServer4EntityFrameworkStoragePackageVersion>4.0.4</IdentityServer4EntityFrameworkStoragePackageVersion>
     <MessagePackPackageVersion>2.1.90</MessagePackPackageVersion>
-    <MicrosoftIdentityWebPackageVersion>0.2.1-preview</MicrosoftIdentityWebPackageVersion>
-    <MicrosoftIdentityWebUIPackageVersion>0.2.1-preview</MicrosoftIdentityWebUIPackageVersion>
+    <MicrosoftIdentityWebPackageVersion>0.2.3-preview</MicrosoftIdentityWebPackageVersion>
+    <MicrosoftIdentityWebUIPackageVersion>0.2.3-preview</MicrosoftIdentityWebUIPackageVersion>
     <MicrosoftGraphPackageVersion>3.8.0</MicrosoftGraphPackageVersion>
     <MessagePackAnalyzerPackageVersion>$(MessagePackPackageVersion)</MessagePackAnalyzerPackageVersion>
     <MoqPackageVersion>4.10.0</MoqPackageVersion>

+ 19 - 3
eng/targets/ResolveReferences.targets

@@ -175,9 +175,15 @@
 
       <!-- Identify if any references were present in the last release of this package, but have been removed. -->
       <UnusedBaselinePackageReference Include="@(BaselinePackageReference)"
-          Exclude="@(Reference);@(_ProjectReferenceByAssemblyName);@(PackageReference)" />
-      <!-- Only allow suppressing baseline changes in non-servicing builds. -->
-      <UnusedBaselinePackageReference Remove="@(SuppressBaselineReference)" Condition="'$(IsServicingBuild)' != 'true'"/>
+          Exclude="@(Reference);@(PackageReference);@(ProjectReference->'%(Filename)')" />
+
+      <!-- Handle suppressions needed because above Exclude is not aware of references added in .nuspec files. -->
+      <UnusedBaselinePackageReference Remove="@(SuppressBaselineReference->WithMetadataValue('InNuspecFile', 'true'))"
+          Condition=" '$(IsServicingBuild)' == 'true' " />
+
+      <!-- Allow suppressions of any baseline changes in non-servicing builds. -->
+      <UnusedBaselinePackageReference Remove="@(SuppressBaselineReference)"
+          Condition=" '$(IsServicingBuild)' != 'true' " />
     </ItemGroup>
 
     <JoinItems Left="@(Reference)" Right="@(LatestPackageReference)" LeftMetadata="*" RightMetadata="Version"
@@ -231,6 +237,16 @@
       <_ExplicitPackageReference Remove="@(_ExplicitPackageReference)" />
     </ItemGroup>
 
+    <Warning
+        Condition=" '$(IsServicingBuild)' != 'true' AND '%(UnusedBaselinePackageReference.Identity)' != '' "
+        Code="BUILD001"
+        Text="Reference to '%(UnusedBaselinePackageReference.Identity)' was removed since the last stable release of this package. This could be a breaking change. See docs/ReferenceResolution.md for instructions on how to update changes to references or suppress this warning if the error was intentional." />
+
+    <Error
+        Condition=" '$(IsServicingBuild)' == 'true' AND @(UnusedBaselinePackageReference->Count()) != 0 "
+        Code="BUILD002"
+        Text="Package references changed since the last release. This could be a breaking change and is not allowed in a servicing update. References removed:%0A - @(UnusedBaselinePackageReference, '%0A - ')" />
+
     <Error
         Condition="'$(TargetFrameworkIdentifier)' != '.NETFramework' AND '%(Reference.Identity)' != '' AND ! Exists('%(Reference.Identity)') AND '$(DisablePackageReferenceRestrictions)' != 'true'"
         Code="MSB3245"

+ 34 - 6
eng/tools/BaselineGenerator/Program.cs

@@ -36,7 +36,10 @@ namespace PackageBaselineGenerator
 
         public Program()
         {
-            _source = Option("-s|--package-source <SOURCE>", "The NuGet source of packages to fetch", CommandOptionType.SingleValue);
+            _source = Option(
+                "-s|--package-source <SOURCE>",
+                "The NuGet source of packages to fetch",
+                CommandOptionType.SingleValue);
             _output = Option("-o|--output <OUT>", "The generated file output path", CommandOptionType.SingleValue);
             _update = Option("-u|--update", "Regenerate the input (Baseline.xml) file.", CommandOptionType.NoValue);
 
@@ -45,9 +48,6 @@ namespace PackageBaselineGenerator
 
         private async Task<int> Run()
         {
-            var source = _source.HasValue()
-                ? _source.Value().TrimEnd('/')
-                : "https://api.nuget.org/v3/index.json";
             if (_output.HasValue() && _update.HasValue())
             {
                 await Error.WriteLineAsync("'--output' and '--update' options must not be used together.");
@@ -56,6 +56,7 @@ namespace PackageBaselineGenerator
 
             var inputPath = Path.Combine(Directory.GetCurrentDirectory(), "Baseline.xml");
             var input = XDocument.Load(inputPath);
+            var source = _source.HasValue() ? _source.Value().TrimEnd('/') : "https://api.nuget.org/v3/index.json";
             var packageSource = new PackageSource(source);
             var providers = Repository.Provider.GetCoreV3(); // Get v2 and v3 API support
             var sourceRepository = new SourceRepository(packageSource, providers);
@@ -89,6 +90,11 @@ namespace PackageBaselineGenerator
 
             var baselineVersion = input.Root.Attribute("Version").Value;
 
+            // Baseline and .NET Core versions always align in non-preview releases.
+            var parsedVersion = Version.Parse(baselineVersion);
+            var defaultTarget = ((parsedVersion.Major < 5) ? "netcoreapp" : "net") +
+                $"{parsedVersion.Major}.{parsedVersion.Minor}";
+
             var doc = new XDocument(
                 new XComment(" Auto generated. Do not edit manually, use eng/tools/BaselineGenerator/ to recreate. "),
                 new XElement("Project",
@@ -136,12 +142,34 @@ namespace PackageBaselineGenerator
 
                     foreach (var group in reader.NuspecReader.GetDependencyGroups())
                     {
-                        var itemGroup = new XElement("ItemGroup", new XAttribute("Condition", $" '$(PackageId)' == '{id}' AND '$(TargetFramework)' == '{group.TargetFramework.GetShortFolderName()}' "));
+                        // Don't bother generating empty ItemGroup elements.
+                        if (group.Packages.Count() == 0)
+                        {
+                            continue;
+                        }
+
+                        // Handle changes to $(DefaultNetCoreTargetFramework) even if some projects are held back.
+                        var targetCondition = $"'$(TargetFramework)' == '{group.TargetFramework.GetShortFolderName()}'";
+                        if (string.Equals(
+                            group.TargetFramework.GetShortFolderName(),
+                            defaultTarget,
+                            StringComparison.OrdinalIgnoreCase))
+                        {
+                            targetCondition =
+                                $"('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR {targetCondition})";
+                        }
+
+                        var itemGroup = new XElement(
+                            "ItemGroup",
+                            new XAttribute("Condition", $" '$(PackageId)' == '{id}' AND {targetCondition} "));
                         doc.Root.Add(itemGroup);
 
                         foreach (var dependency in group.Packages)
                         {
-                            itemGroup.Add(new XElement("BaselinePackageReference", new XAttribute("Include", dependency.Id), new XAttribute("Version", dependency.VersionRange.ToString())));
+                            itemGroup.Add(
+                                new XElement("BaselinePackageReference",
+                                new XAttribute("Include", dependency.Id),
+                                new XAttribute("Version", dependency.VersionRange.ToString())));
                         }
                     }
                 }

+ 0 - 1
src/Components/Components.slnf

@@ -104,7 +104,6 @@
       "src\\Components\\Web.Extensions\\test\\Microsoft.AspNetCore.Components.Web.Extensions.Tests.csproj",
       "src\\Components\\WebAssembly\\Server\\test\\Microsoft.AspNetCore.Components.WebAssembly.Server.Tests.csproj",
       "src\\Components\\WebAssembly\\Authentication.Msal\\src\\Microsoft.Authentication.WebAssembly.Msal.csproj",
-      "src\\Components\\WebAssembly\\DebugProxy\\src\\Microsoft.AspNetCore.Components.WebAssembly.DebugProxy.csproj",
       "src\\Components\\WebAssembly\\JSInterop\\src\\Microsoft.JSInterop.WebAssembly.csproj",
       "src\\Components\\WebAssembly\\WebAssembly.Authentication\\src\\Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj",
       "src\\Components\\WebAssembly\\WebAssembly.Authentication\\test\\Microsoft.AspNetCore.Components.WebAssembly.Authentication.Tests.csproj",

+ 10 - 4
src/Components/Components/src/Microsoft.AspNetCore.Components.csproj

@@ -17,11 +17,17 @@
     <Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions" />
   </ItemGroup>
 
-  <!-- These references were removed in 3.0 -->
+  <!--
+    These references exist only in the .nuspec files and baseline checks are not aware of them. Keep suppressions
+    in sync with the two .nuspec files:
+    - Anytime a reference is added to this project file, remove its suppression.
+    - Remove InNuspecFile attributes of references removed from the .nuspec files. Make suppression conditional on
+      Major.Minor during previews. After RTM (and baseline updates), remove suppressions entirely.
+  -->
   <ItemGroup>
-    <SuppressBaselineReference Include="Microsoft.AspNetCore.Components.Analyzers" />
-    <SuppressBaselineReference Include="Microsoft.AspNetCore.Authorization" />
-    <SuppressBaselineReference Include="System.ComponentModel.Annotations" />
+    <SuppressBaselineReference Include="Microsoft.AspNetCore.Components.Analyzers" InNuspecFile="true" />
+    <SuppressBaselineReference Include="Microsoft.AspNetCore.Authorization" InNuspecFile="true" />
+    <SuppressBaselineReference Include="Microsoft.JSInterop" Condition=" '$(AspNetCoreMajorMinorVersion)' == '5.0' " />
   </ItemGroup>
 
   <Target Name="_GetNuspecDependencyPackageVersions">

+ 1 - 2
src/Components/ComponentsNoDeps.slnf

@@ -19,7 +19,6 @@
       "src\\Components\\Web.Extensions\\src\\Microsoft.AspNetCore.Components.Web.Extensions.csproj",
       "src\\Components\\Web.Extensions\\test\\Microsoft.AspNetCore.Components.Web.Extensions.Tests.csproj",
       "src\\Components\\WebAssembly\\Authentication.Msal\\src\\Microsoft.Authentication.WebAssembly.Msal.csproj",
-      "src\\Components\\WebAssembly\\DebugProxy\\src\\Microsoft.AspNetCore.Components.WebAssembly.DebugProxy.csproj",
       "src\\Components\\WebAssembly\\DevServer\\src\\Microsoft.AspNetCore.Components.WebAssembly.DevServer.csproj",
       "src\\Components\\WebAssembly\\JSInterop\\src\\Microsoft.JSInterop.WebAssembly.csproj",
       "src\\Components\\WebAssembly\\Sdk\\integrationtests\\Microsoft.NET.Sdk.BlazorWebAssembly.IntegrationTests.csproj",
@@ -50,4 +49,4 @@
       "src\\Components\\test\\testassets\\TestServer\\Components.TestServer.csproj"
     ]
   }
-}
+}

File diff suppressed because it is too large
+ 0 - 0
src/Components/Web.JS/dist/Release/blazor.webassembly.js


+ 1 - 9
src/Components/Web.JS/src/Platform/Mono/MonoDebugger.ts

@@ -3,17 +3,11 @@ import { WebAssemblyResourceLoader } from '../WebAssemblyResourceLoader';
 const currentBrowserIsChrome = (window as any).chrome
   && navigator.userAgent.indexOf('Edge') < 0; // Edge pretends to be Chrome
 
-let isDebugging = true;
-
-window.addEventListener('load', () => {
-  const params = new URLSearchParams(window.location.search);
-  isDebugging = params.get('_blazor_debug') === 'true';
-})
 
 let hasReferencedPdbs = false;
 
 export function hasDebuggingEnabled() {
-  return isDebugging && hasReferencedPdbs && currentBrowserIsChrome;
+  return hasReferencedPdbs && currentBrowserIsChrome;
 }
 
 export function attachDebuggerHotkey(resourceLoader: WebAssemblyResourceLoader) {
@@ -33,8 +27,6 @@ export function attachDebuggerHotkey(resourceLoader: WebAssemblyResourceLoader)
         console.error('Cannot start debugging, because the application was not compiled with debugging enabled.');
       } else if (!currentBrowserIsChrome) {
         console.error('Currently, only Microsoft Edge (80+), or Google Chrome, are supported for debugging.');
-      } else if (!isDebugging) {
-        console.error(`_blazor_debug query parameter must be set to enable debugging. To enable debugging, go to ${location.href}?_blazor_debug=true.`);
       } else {
         launchDebugger();
       }

+ 0 - 10
src/Components/WebAssembly/DebugProxy/src/DebugProxyOptions.cs

@@ -1,10 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-namespace Microsoft.AspNetCore.Components.WebAssembly.DebugProxy
-{
-    public class DebugProxyOptions
-    {
-        public string BrowserHost { get; set; }
-    }
-}

+ 0 - 65
src/Components/WebAssembly/DebugProxy/src/Hosting/DebugProxyHost.cs

@@ -1,65 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Text;
-using Microsoft.AspNetCore.Hosting;
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Hosting;
-using Microsoft.Extensions.Logging;
-
-namespace Microsoft.AspNetCore.Components.WebAssembly.DebugProxy.Hosting
-{
-    public static class DebugProxyHost
-    {
-        /// <summary>
-        /// Creates a custom HostBuilder for the DebugProxyLauncher so that we can inject
-        /// only the needed configurations.
-        /// </summary>
-        /// <param name="args">Command line arguments passed in</param>
-        /// <param name="browserHost">Host where browser is listening for debug connections</param>
-        /// <returns><see cref="IHostBuilder" /></returns>
-        public static IHostBuilder CreateDefaultBuilder(string[] args, string browserHost)
-        {
-            var builder = new HostBuilder();
-
-            builder.ConfigureAppConfiguration((hostingContext, config) =>
-            {
-                if (args != null)
-                {
-                    config.AddCommandLine(args);
-                }
-                config.SetBasePath(Directory.GetCurrentDirectory());
-                config.AddJsonFile("blazor-debugproxysettings.json", optional: true, reloadOnChange: true);
-            })
-            .ConfigureLogging((hostingContext, logging) =>
-            {
-                logging.AddConfiguration(hostingContext.Configuration.GetSection("Logging"));
-                logging.AddConsole();
-                logging.AddDebug();
-                logging.AddEventSourceLogger();
-            })
-            .ConfigureWebHostDefaults(webBuilder =>
-            {
-                webBuilder.UseStartup<Startup>();
-
-                // By default we bind to a dyamic port
-                // This can be overridden using an option like "--urls http://localhost:9500"
-                webBuilder.UseUrls("http://127.0.0.1:0");
-            })
-            .ConfigureServices(serviceCollection =>
-            {
-                serviceCollection.AddSingleton(new DebugProxyOptions
-                {
-                    BrowserHost = browserHost
-                });
-            });
-
-            return builder;
-
-        }
-    }
-}

+ 0 - 30
src/Components/WebAssembly/DebugProxy/src/Microsoft.AspNetCore.Components.WebAssembly.DebugProxy.csproj

@@ -1,30 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
-  <PropertyGroup>
-    <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
-    <OutputType>Exe</OutputType>
-    <PackageId>Microsoft.AspNetCore.Components.WebAssembly.DebugProxy</PackageId>
-    <IsShippingPackage>true</IsShippingPackage>
-    <Description>Debug proxy for use when building Blazor applications.</Description>
-    <!-- Set this to false because assemblies should not reference this assembly directly, (except for tests, of course). -->
-    <IsProjectReferenceProvider>false</IsProjectReferenceProvider>
-    <NoWarn>$(NoWarn);CS0649</NoWarn>
-    <GenerateDocumentationFile>true</GenerateDocumentationFile>
-  </PropertyGroup>
-
-  <ItemGroup>
-    <Compile Include="$(SharedSourceRoot)CommandLineUtils\**\*.cs" />
-  </ItemGroup>
-
-  <ItemGroup>
-    <Reference Include="Microsoft.AspNetCore" />
-    <Reference Include="Microsoft.AspNetCore.WebSockets" />
-    <Reference Include="Microsoft.Extensions.Hosting" />
-
-    <!-- Dependencies of ws-proxy sources -->
-    <Reference Include="Newtonsoft.Json" />
-    <Reference Include="Mono.Cecil" />
-    <Reference Include="Microsoft.CodeAnalysis.CSharp" />
-  </ItemGroup>
-
-</Project>

+ 0 - 843
src/Components/WebAssembly/DebugProxy/src/MonoDebugProxy/ws-proxy/DebugStore.cs

@@ -1,843 +0,0 @@
-using System;
-using System.IO;
-using System.Collections.Generic;
-using Mono.Cecil;
-using Mono.Cecil.Cil;
-using System.Linq;
-using Newtonsoft.Json.Linq;
-using System.Net.Http;
-using Mono.Cecil.Pdb;
-using Newtonsoft.Json;
-using System.Text.RegularExpressions;
-using System.Threading.Tasks;
-using System.Threading;
-using Microsoft.Extensions.Logging;
-using System.Runtime.CompilerServices;
-using System.Security.Cryptography;
-
-namespace WebAssembly.Net.Debugging {
-	internal class BreakpointRequest {
-		public string Id { get; private set; }
-		public string Assembly { get; private set; }
-		public string File { get; private set; }
-		public int Line { get; private set; }
-		public int Column { get; private set; }
-		public MethodInfo Method { get; private set; }
-
-		JObject request;
-
-		public bool IsResolved => Assembly != null;
-		public List<Breakpoint> Locations { get; } = new List<Breakpoint> ();
-
-		public override string ToString ()
-			=> $"BreakpointRequest Assembly: {Assembly} File: {File} Line: {Line} Column: {Column}";
-
-		public object AsSetBreakpointByUrlResponse (IEnumerable<object> jsloc)
-			=> new { breakpointId = Id, locations = Locations.Select(l => l.Location.AsLocation ()).Concat (jsloc) };
-
-		public BreakpointRequest () {
-		}
-
-		public BreakpointRequest (string id, MethodInfo method) {
-			Id = id;
-			Method = method;
-		}
-
-		public BreakpointRequest (string id, JObject request) {
-			Id = id;
-			this.request = request;
-		}
-
-		public static BreakpointRequest Parse (string id, JObject args)
-		{
-			return new BreakpointRequest (id, args);
-		}
-
-		public BreakpointRequest Clone ()
-			=> new BreakpointRequest { Id = Id, request = request };
-
-		public bool IsMatch (SourceFile sourceFile)
-		{
-			var url = request? ["url"]?.Value<string> ();
-			if (url == null) {
-				var urlRegex = request?["urlRegex"].Value<string>();
-				var regex = new Regex (urlRegex);
-				return regex.IsMatch (sourceFile.Url.ToString ()) || regex.IsMatch (sourceFile.DocUrl);
-			}
-
-			return sourceFile.Url.ToString () == url || sourceFile.DotNetUrl == url;
-		}
-
-		public bool TryResolve (SourceFile sourceFile)
-		{
-			if (!IsMatch (sourceFile))
-				return false;
-
-			var line = request? ["lineNumber"]?.Value<int> ();
-			var column = request? ["columnNumber"]?.Value<int> ();
-
-			if (line == null || column == null)
-				return false;
-
-			Assembly = sourceFile.AssemblyName;
-			File = sourceFile.DebuggerFileName;
-			Line = line.Value;
-			Column = column.Value;
-			return true;
-		}
-
-		public bool TryResolve (DebugStore store)
-		{
-			if (request == null || store == null)
-				return false;
-
-			return store.AllSources().FirstOrDefault (source => TryResolve (source)) != null;
-		}
-	}
-
-	internal class VarInfo {
-		public VarInfo (VariableDebugInformation v)
-		{
-			this.Name = v.Name;
-			this.Index = v.Index;
-		}
-
-		public VarInfo (ParameterDefinition p)
-		{
-			this.Name = p.Name;
-			this.Index = (p.Index + 1) * -1;
-		}
-
-		public string Name { get;  }
-		public int Index { get; }
-
-		public override string ToString ()
-			=> $"(var-info [{Index}] '{Name}')";
-	}
-
-	internal class CliLocation {
-		public CliLocation (MethodInfo method, int offset)
-		{
-			Method = method;
-			Offset = offset;
-		}
-
-		public MethodInfo Method { get; }
-		public int Offset { get; }
-	}
-
-	internal class SourceLocation {
-		SourceId id;
-		int line;
-		int column;
-		CliLocation cliLoc;
-
-		public SourceLocation (SourceId id, int line, int column)
-		{
-			this.id = id;
-			this.line = line;
-			this.column = column;
-		}
-
-		public SourceLocation (MethodInfo mi, SequencePoint sp)
-		{
-			this.id = mi.SourceId;
-			this.line = sp.StartLine - 1;
-			this.column = sp.StartColumn - 1;
-			this.cliLoc = new CliLocation (mi, sp.Offset);
-		}
-
-		public SourceId Id { get => id; }
-		public int Line { get => line; }
-		public int Column { get => column; }
-		public CliLocation CliLocation => this.cliLoc;
-
-		public override string ToString ()
-			=> $"{id}:{Line}:{Column}";
-
-		public static SourceLocation Parse (JObject obj)
-		{
-			if (obj == null)
-				return null;
-
-			if (!SourceId.TryParse (obj ["scriptId"]?.Value<string> (), out var id))
-				return null;
-
-			var line = obj ["lineNumber"]?.Value<int> ();
-			var column = obj ["columnNumber"]?.Value<int> ();
-			if (id == null || line == null || column == null)
-				return null;
-
-			return new SourceLocation (id, line.Value, column.Value);
-		}
-
-
-		internal class LocationComparer : EqualityComparer<SourceLocation>
-		{
-			public override bool Equals (SourceLocation l1, SourceLocation l2)
-			{
-				if (l1 == null && l2 == null)
-						return true;
-				else if (l1 == null || l2 == null)
-						return false;
-
-				return (l1.Line == l2.Line &&
-						l1.Column == l2.Column &&
-						l1.Id == l2.Id);
-			}
-
-			public override int GetHashCode (SourceLocation loc)
-			{
-				int hCode = loc.Line ^ loc.Column;
-				return loc.Id.GetHashCode () ^ hCode.GetHashCode ();
-			}
-		}
-
-		internal object AsLocation ()
-			=> new {
-				scriptId = id.ToString (),
-				lineNumber = line,
-				columnNumber = column
-			};
-	}
-
-	internal class SourceId {
-		const string Scheme = "dotnet://";
-
-		readonly int assembly, document;
-
-		public int Assembly => assembly;
-		public int Document => document;
-
-		internal SourceId (int assembly, int document)
-		{
-			this.assembly = assembly;
-			this.document = document;
-		}
-
-		public SourceId (string id)
-		{
-			if (!TryParse (id, out assembly, out document))
-				throw new ArgumentException ("invalid source identifier", nameof (id));
-		}
-
-		public static bool TryParse (string id, out SourceId source)
-		{
-			source = null;
-			if (!TryParse (id, out var assembly, out var document))
-				return false;
-
-			source = new SourceId (assembly, document);
-			return true;
-		}
-
-		static bool TryParse (string id, out int assembly, out int document)
-		{
-			assembly = document = 0;
-			if (id == null || !id.StartsWith (Scheme, StringComparison.Ordinal))
-				return false;
-
-			var sp = id.Substring (Scheme.Length).Split ('_');
-			if (sp.Length != 2)
-				return false;
-
-			if (!int.TryParse (sp [0], out assembly))
-				return false;
-
-			if (!int.TryParse (sp [1], out document))
-				return false;
-
-			return true;
-		}
-
-		public override string ToString ()
-			=> $"{Scheme}{assembly}_{document}";
-
-		public override bool Equals (object obj)
-		{
-			if (obj == null)
-				return false;
-			SourceId that = obj as SourceId;
-			return that.assembly == this.assembly && that.document == this.document;
-		}
-
-		public override int GetHashCode ()
-			=> assembly.GetHashCode () ^ document.GetHashCode ();
-
-		public static bool operator == (SourceId a, SourceId b)
-			=> ((object)a == null) ? (object)b == null : a.Equals (b);
-
-		public static bool operator != (SourceId a, SourceId b)
-			=> !a.Equals (b);
-	}
-
-	internal class MethodInfo {
-		MethodDefinition methodDef;
-		SourceFile source;
-
-		public SourceId SourceId => source.SourceId;
-
-		public string Name => methodDef.Name;
-		public MethodDebugInformation DebugInformation => methodDef.DebugInformation;
-
-		public SourceLocation StartLocation { get; }
-		public SourceLocation EndLocation { get; }
-		public AssemblyInfo Assembly { get; }
-		public uint Token => methodDef.MetadataToken.RID;
-
-		public MethodInfo (AssemblyInfo assembly, MethodDefinition methodDef, SourceFile source)
-		{
-			this.Assembly = assembly;
-			this.methodDef = methodDef;
-			this.source = source;
-
-			var sps = DebugInformation.SequencePoints;
-			if (sps == null || sps.Count() < 1)
-				return;
-
-			SequencePoint start = sps [0];
-			SequencePoint end = sps [0];
-
-			foreach (var sp in sps) {
-				if (sp.StartLine < start.StartLine)
-						start = sp;
-				else if (sp.StartLine == start.StartLine && sp.StartColumn < start.StartColumn)
-						start = sp;
-
-				if (sp.EndLine > end.EndLine)
-						end = sp;
-				else if (sp.EndLine == end.EndLine && sp.EndColumn > end.EndColumn)
-						end = sp;
-			}
-
-			StartLocation = new SourceLocation (this, start);
-			EndLocation = new SourceLocation (this, end);
-		}
-
-		public SourceLocation GetLocationByIl (int pos)
-		{
-			SequencePoint prev = null;
-			foreach (var sp in DebugInformation.SequencePoints) {
-				if (sp.Offset > pos)
-					break;
-				prev = sp;
-			}
-
-			if (prev != null)
-				return new SourceLocation (this, prev);
-
-			return null;
-		}
-
-		public VarInfo [] GetLiveVarsAt (int offset)
-		{
-			var res = new List<VarInfo> ();
-
-			res.AddRange (methodDef.Parameters.Select (p => new VarInfo (p)));
-			res.AddRange (methodDef.DebugInformation.GetScopes ()
-				.Where (s => s.Start.Offset <= offset && (s.End.IsEndOfMethod || s.End.Offset > offset))
-				.SelectMany (s => s.Variables)
-				.Where (v => !v.IsDebuggerHidden)
-				.Select (v => new VarInfo (v)));
-
-			return res.ToArray ();
-		}
-
-		public override string ToString () => "MethodInfo(" + methodDef.FullName + ")";
-	}
-
-	internal class TypeInfo {
-		AssemblyInfo assembly;
-		TypeDefinition type;
-		List<MethodInfo> methods;
-
-		public TypeInfo (AssemblyInfo assembly, TypeDefinition type) {
-			this.assembly = assembly;
-			this.type = type;
-			methods = new List<MethodInfo> ();
-		}
-
-		public string Name => type.Name;
-		public string FullName => type.FullName;
-		public List<MethodInfo> Methods => methods;
-
-		public override string ToString () => "TypeInfo('" + FullName + "')";
-	}
-
-	class AssemblyInfo {
-		static int next_id;
-		ModuleDefinition image;
-		readonly int id;
-		readonly ILogger logger;
-		Dictionary<uint, MethodInfo> methods = new Dictionary<uint, MethodInfo> ();
-		Dictionary<string, string> sourceLinkMappings = new Dictionary<string, string>();
-		Dictionary<string, TypeInfo> typesByName = new Dictionary<string, TypeInfo> ();
-		readonly List<SourceFile> sources = new List<SourceFile>();
-		internal string Url { get; }
-
-		public AssemblyInfo (string url, byte[] assembly, byte[] pdb)
-		{
-			this.id = Interlocked.Increment (ref next_id);
-
-			try {
-				Url = url;
-				ReaderParameters rp = new ReaderParameters (/*ReadingMode.Immediate*/);
-
-				// set ReadSymbols = true unconditionally in case there
-				// is an embedded pdb then handle ArgumentException
-				// and assume that if pdb == null that is the cause
-				rp.ReadSymbols = true;
-				rp.SymbolReaderProvider = new PdbReaderProvider ();
-				if (pdb != null)
-					rp.SymbolStream = new MemoryStream (pdb);
-				rp.ReadingMode = ReadingMode.Immediate;
-				rp.InMemory = true;
-
-				this.image = ModuleDefinition.ReadModule (new MemoryStream (assembly), rp);
-			} catch (BadImageFormatException ex) {
-				logger.LogWarning ($"Failed to read assembly as portable PDB: {ex.Message}");
-			} catch (ArgumentException) {
-				// if pdb == null this is expected and we
-				// read the assembly without symbols below
-				if (pdb != null)
-					throw;
-			}
-
-			if (this.image == null) {
-				ReaderParameters rp = new ReaderParameters (/*ReadingMode.Immediate*/);
-				if (pdb != null) {
-					rp.ReadSymbols = true;
-					rp.SymbolReaderProvider = new PdbReaderProvider ();
-					rp.SymbolStream = new MemoryStream (pdb);
-				}
-
-				rp.ReadingMode = ReadingMode.Immediate;
-				rp.InMemory = true;
-
-				this.image = ModuleDefinition.ReadModule (new MemoryStream (assembly), rp);
-			}
-
-			Populate ();
-		}
-
-		public AssemblyInfo (ILogger logger)
-		{
-			this.logger = logger;
-		}
-
-		void Populate ()
-		{
-			ProcessSourceLink();
-
-			var d2s = new Dictionary<Document, SourceFile> ();
-
-			SourceFile FindSource (Document doc)
-			{
-				if (doc == null)
-					return null;
-
-				if (d2s.TryGetValue (doc, out var source))
-					return source;
-
-				var src = new SourceFile (this, sources.Count, doc, GetSourceLinkUrl (doc.Url));
-				sources.Add (src);
-				d2s [doc] = src;
-				return src;
-			};
-
-			foreach (var type in image.GetTypes()) {
-				var typeInfo = new TypeInfo (this, type);
-				typesByName [type.FullName] = typeInfo;
-
-				foreach (var method in type.Methods) {
-					foreach (var sp in method.DebugInformation.SequencePoints) {
-						var source = FindSource (sp.Document);
-						var methodInfo = new MethodInfo (this, method, source);
-						methods [method.MetadataToken.RID] = methodInfo;
-						if (source != null)
-							source.AddMethod (methodInfo);
-
-						typeInfo.Methods.Add (methodInfo);
-					}
-				}
-			}
-		}
-
-		private void ProcessSourceLink ()
-		{
-			var sourceLinkDebugInfo = image.CustomDebugInformations.FirstOrDefault (i => i.Kind == CustomDebugInformationKind.SourceLink);
-
-			if (sourceLinkDebugInfo != null) {
-				var sourceLinkContent = ((SourceLinkDebugInformation)sourceLinkDebugInfo).Content;
-
-				if (sourceLinkContent != null) {
-					var jObject = JObject.Parse (sourceLinkContent) ["documents"];
-					sourceLinkMappings = JsonConvert.DeserializeObject<Dictionary<string, string>> (jObject.ToString ());
-				}
-			}
-		}
-
-		private Uri GetSourceLinkUrl (string document)
-		{
-			if (sourceLinkMappings.TryGetValue (document, out string url))
-				return new Uri (url);
-
-			foreach (var sourceLinkDocument in sourceLinkMappings) {
-				string key = sourceLinkDocument.Key;
-
-				if (Path.GetFileName (key) != "*") {
-					continue;
-				}
-
-				var keyTrim = key.TrimEnd ('*');
-
-				if (document.StartsWith(keyTrim, StringComparison.OrdinalIgnoreCase)) {
-					var docUrlPart = document.Replace (keyTrim, "");
-					return new Uri (sourceLinkDocument.Value.TrimEnd ('*') + docUrlPart);
-				}
-			}
-
-			return null;
-		}
-
-		private static string GetRelativePath (string relativeTo, string path)
-		{
-			var uri = new Uri (relativeTo, UriKind.RelativeOrAbsolute);
-			var rel = Uri.UnescapeDataString (uri.MakeRelativeUri (new Uri (path, UriKind.RelativeOrAbsolute)).ToString ()).Replace (Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);
-			if (rel.Contains (Path.DirectorySeparatorChar.ToString ()) == false) {
-				rel = $".{ Path.DirectorySeparatorChar }{ rel }";
-			}
-			return rel;
-		}
-
-		public IEnumerable<SourceFile> Sources
-			=> this.sources;
-
-		public int Id => id;
-		public string Name => image.Name;
-
-		public SourceFile GetDocById (int document)
-		{
-			return sources.FirstOrDefault (s => s.SourceId.Document == document);
-		}
-
-		public MethodInfo GetMethodByToken (uint token)
-		{
-			methods.TryGetValue (token, out var value);
-			return value;
-		}
-
-		public TypeInfo GetTypeByName (string name) {
-			typesByName.TryGetValue (name, out var res);
-			return res;
-		}
-	}
-
-	internal class SourceFile {
-		Dictionary<uint, MethodInfo> methods;
-		AssemblyInfo assembly;
-		int id;
-		Document doc;
-
-		internal SourceFile (AssemblyInfo assembly, int id, Document doc, Uri sourceLinkUri)
-		{
-			this.methods = new Dictionary<uint, MethodInfo> ();
-			this.SourceLinkUri = sourceLinkUri;
-			this.assembly = assembly;
-			this.id = id;
-			this.doc = doc;
-			this.DebuggerFileName = doc.Url.Replace ("\\", "/").Replace (":", "");
-
-			this.SourceUri = new Uri ((Path.IsPathRooted (doc.Url) ? "file://" : "") + doc.Url, UriKind.RelativeOrAbsolute);
-			if (SourceUri.IsFile && File.Exists (SourceUri.LocalPath)) {
-				this.Url = this.SourceUri.ToString ();
-			} else {
-				this.Url = DotNetUrl;
-			}
-		}
-
-		internal void AddMethod (MethodInfo mi)
-		{
-			if (!this.methods.ContainsKey (mi.Token))
-				this.methods [mi.Token] = mi;
-		}
-
-		public string DebuggerFileName { get; }
-		public string Url { get; }
-		public string AssemblyName => assembly.Name;
-		public string DotNetUrl => $"dotnet://{assembly.Name}/{DebuggerFileName}";
-
-		public SourceId SourceId => new SourceId (assembly.Id, this.id);
-		public Uri SourceLinkUri { get; }
-		public Uri SourceUri { get; }
-
-		public IEnumerable<MethodInfo> Methods => this.methods.Values;
-
-		public string DocUrl => doc.Url;
-
-		public (int startLine, int startColumn, int endLine, int endColumn) GetExtents ()
-		{
-			var start = Methods.OrderBy (m => m.StartLocation.Line).ThenBy (m => m.StartLocation.Column).First ();
-			var end = Methods.OrderByDescending (m => m.EndLocation.Line).ThenByDescending (m => m.EndLocation.Column).First ();
-			return (start.StartLocation.Line, start.StartLocation.Column, end.EndLocation.Line, end.EndLocation.Column);
-		}
-
-		async Task<MemoryStream> GetDataAsync (Uri uri, CancellationToken token)
-		{
-			var mem = new MemoryStream ();
-			try {
-				if (uri.IsFile && File.Exists (uri.LocalPath)) {
-					using (var file = File.Open (SourceUri.LocalPath, FileMode.Open)) {
-						await file.CopyToAsync (mem, token);
-						mem.Position = 0;
-					}
-				} else if (uri.Scheme == "http" || uri.Scheme == "https") {
-					var client = new HttpClient ();
-					using (var stream = await client.GetStreamAsync (uri)) {
-						await stream.CopyToAsync (mem, token);
-						mem.Position = 0;
-					}
-				}
-			} catch (Exception) {
-				return null;
-			}
-			return mem;
-		}
-
-		static HashAlgorithm GetHashAlgorithm (DocumentHashAlgorithm algorithm)
-		{
-			switch (algorithm) {
-			case DocumentHashAlgorithm.SHA1: return SHA1.Create ();
-			case DocumentHashAlgorithm.SHA256: return SHA256.Create ();
-			case DocumentHashAlgorithm.MD5: return MD5.Create ();
-			}
-			return null;
-		}
-
-		bool CheckPdbHash (byte [] computedHash)
-		{
-			if (computedHash.Length != doc.Hash.Length)
-				return false;
-
-			for (var i = 0; i < computedHash.Length; i++)
-				if (computedHash[i] != doc.Hash[i])
-					return false;
-
-			return true;
-		}
-
-		byte[] ComputePdbHash (Stream sourceStream)
-		{
-			var algorithm = GetHashAlgorithm (doc.HashAlgorithm);
-			if (algorithm != null)
-				using (algorithm)
-					return algorithm.ComputeHash (sourceStream);
-
-			return Array.Empty<byte> ();
-		}
-
-		public async Task<Stream> GetSourceAsync (bool checkHash, CancellationToken token = default(CancellationToken))
-		{
-			if (doc.EmbeddedSource.Length > 0)
-				return new MemoryStream (doc.EmbeddedSource, false);
-
-			MemoryStream mem;
-
-			mem = await GetDataAsync (SourceUri, token);
-			if (mem != null && (!checkHash || CheckPdbHash (ComputePdbHash (mem)))) {
-				mem.Position = 0;
-				return mem;
-			}
-
-			mem = await GetDataAsync (SourceLinkUri, token);
-			if (mem != null && (!checkHash || CheckPdbHash (ComputePdbHash (mem)))) {
-				mem.Position = 0;
-				return mem;
-			}
-
-			return MemoryStream.Null;
-		}
-
-		public object ToScriptSource (int executionContextId, object executionContextAuxData)
-		{
-			return new {
-				scriptId = SourceId.ToString (),
-				url = Url,
-				executionContextId,
-				executionContextAuxData,
-				//hash:  should be the v8 hash algo, managed implementation is pending
-				dotNetUrl = DotNetUrl,
-			};
-		}
-	}
-
-	internal class DebugStore {
-		List<AssemblyInfo> assemblies = new List<AssemblyInfo> ();
-		readonly HttpClient client;
-		readonly ILogger logger;
-
-		public DebugStore (ILogger logger, HttpClient client) {
-			this.client = client;
-			this.logger = logger;
-		}
-
-		public DebugStore (ILogger logger) : this (logger, new HttpClient ())
-		{
-		}
-
-		class DebugItem {
-			public string Url { get; set; }
-			public Task<byte[][]> Data { get; set; }
-		}
-
-		public async IAsyncEnumerable<SourceFile> Load (SessionId sessionId, string [] loaded_files, [EnumeratorCancellation] CancellationToken token)
-		{
-			static bool MatchPdb (string asm, string pdb)
-				=> Path.ChangeExtension (asm, "pdb") == pdb;
-
-			var asm_files = new List<string> ();
-			var pdb_files = new List<string> ();
-			foreach (var file_name in loaded_files) {
-				if (file_name.EndsWith (".pdb", StringComparison.OrdinalIgnoreCase))
-					pdb_files.Add (file_name);
-				else
-					asm_files.Add (file_name);
-			}
-
-			List<DebugItem> steps = new List<DebugItem> ();
-			foreach (var url in asm_files) {
-				try {
-					var pdb = pdb_files.FirstOrDefault (n => MatchPdb (url, n));
-					steps.Add (
-						new DebugItem {
-								Url = url,
-								Data = Task.WhenAll (client.GetByteArrayAsync (url), pdb != null ? client.GetByteArrayAsync (pdb) : Task.FromResult<byte []> (null))
-						});
-				} catch (Exception e) {
-					logger.LogDebug ($"Failed to read {url} ({e.Message})");
-				}
-			}
-
-			foreach (var step in steps) {
-				AssemblyInfo assembly = null;
-				try {
-					var bytes = await step.Data;
-					assembly = new AssemblyInfo (step.Url, bytes [0], bytes [1]);
-				} catch (Exception e) {
-					logger.LogDebug ($"Failed to load {step.Url} ({e.Message})");
-				}
-				if (assembly == null)
-					continue;
-
-				assemblies.Add (assembly);
-				foreach (var source in assembly.Sources)
-					yield return source;
-			}
-		}
-
-		public IEnumerable<SourceFile> AllSources ()
-			=> assemblies.SelectMany (a => a.Sources);
-
-		public SourceFile GetFileById (SourceId id)
-			=> AllSources ().SingleOrDefault (f => f.SourceId.Equals (id));
-
-		public AssemblyInfo GetAssemblyByName (string name)
-			=> assemblies.FirstOrDefault (a => a.Name.Equals (name, StringComparison.InvariantCultureIgnoreCase));
-
-		/*
-		V8 uses zero based indexing for both line and column.
-		PPDBs uses one based indexing for both line and column.
-		*/
-		static bool Match (SequencePoint sp, SourceLocation start, SourceLocation end)
-		{
-			var spStart = (Line: sp.StartLine - 1, Column: sp.StartColumn - 1);
-			var spEnd = (Line: sp.EndLine - 1, Column: sp.EndColumn - 1);
-
-			if (start.Line > spEnd.Line)
-				return false;
-
-			if (start.Column > spEnd.Column && start.Line == spEnd.Line)
-				return false;
-
-			if (end.Line < spStart.Line)
-				return false;
-
-			if (end.Column < spStart.Column && end.Line == spStart.Line)
-				return false;
-
-			return true;
-		}
-
-		public List<SourceLocation> FindPossibleBreakpoints (SourceLocation start, SourceLocation end)
-		{
-			//XXX FIXME no idea what todo with locations on different files
-			if (start.Id != end.Id) {
-				logger.LogDebug ($"FindPossibleBreakpoints: documents differ (start: {start.Id}) (end {end.Id}");
-				return null;
-			}
-
-			var sourceId = start.Id;
-
-			var doc = GetFileById (sourceId);
-
-			var res = new List<SourceLocation> ();
-			if (doc == null) {
-				logger.LogDebug ($"Could not find document {sourceId}");
-				return res;
-			}
-
-			foreach (var method in doc.Methods) {
-				foreach (var sequencePoint in method.DebugInformation.SequencePoints) {
-					if (!sequencePoint.IsHidden && Match (sequencePoint, start, end))
-						res.Add (new SourceLocation (method, sequencePoint));
-				}
-			}
-			return res;
-		}
-
-		/*
-		V8 uses zero based indexing for both line and column.
-		PPDBs uses one based indexing for both line and column.
-		*/
-		static bool Match (SequencePoint sp, int line, int column)
-		{
-			var bp = (line: line + 1, column: column + 1);
-
-			if (sp.StartLine > bp.line || sp.EndLine < bp.line)
-				return false;
-
-			//Chrome sends a zero column even if getPossibleBreakpoints say something else
-			if (column == 0)
-				return true;
-
-			if (sp.StartColumn > bp.column && sp.StartLine == bp.line)
-				return false;
-
-			if (sp.EndColumn < bp.column && sp.EndLine == bp.line)
-				return false;
-
-			return true;
-		}
-
-		public IEnumerable<SourceLocation> FindBreakpointLocations (BreakpointRequest request)
-		{
-			request.TryResolve (this);
-
-			var asm = assemblies.FirstOrDefault (a => a.Name.Equals (request.Assembly, StringComparison.OrdinalIgnoreCase));
-			var sourceFile = asm?.Sources?.SingleOrDefault (s => s.DebuggerFileName.Equals (request.File, StringComparison.OrdinalIgnoreCase));
-
-			if (sourceFile == null)
-				yield break;
-
-			foreach (var method in sourceFile.Methods) {
-				foreach (var sequencePoint in method.DebugInformation.SequencePoints) {
-					if (!sequencePoint.IsHidden && Match (sequencePoint, request.Line, request.Column))
-						yield return new SourceLocation (method, sequencePoint);
-				}
-			}
-		}
-
-		public string ToUrl (SourceLocation location)
-			=> location != null ? GetFileById (location.Id).Url : "";
-	}
-}

+ 0 - 298
src/Components/WebAssembly/DebugProxy/src/MonoDebugProxy/ws-proxy/DevToolsHelper.cs

@@ -1,298 +0,0 @@
-using System;
-using System.Linq;
-using System.Threading.Tasks;
-using Newtonsoft.Json.Linq;
-
-using System.Threading;
-using System.IO;
-using System.Collections.Generic;
-using System.Net;
-using Microsoft.Extensions.Logging;
-
-namespace WebAssembly.Net.Debugging {
-
-	internal struct SessionId {
-		public readonly string sessionId;
-
-		public SessionId (string sessionId)
-		{
-			this.sessionId = sessionId;
-		}
-
-		// hashset treats 0 as unset
-		public override int GetHashCode ()
-			=> sessionId?.GetHashCode () ?? -1;
-
-		public override bool Equals (object obj)
-			=> (obj is SessionId) ? ((SessionId) obj).sessionId == sessionId : false;
-
-		public static bool operator == (SessionId a, SessionId b)
-			=> a.sessionId == b.sessionId;
-
-		public static bool operator != (SessionId a, SessionId b)
-			=> a.sessionId != b.sessionId;
-
-		public static SessionId Null { get; } = new SessionId ();
-
-		public override string ToString ()
-			=> $"session-{sessionId}";
-	}
-
-	internal struct MessageId {
-		public readonly string sessionId;
-		public readonly int id;
-
-		public MessageId (string sessionId, int id)
-		{
-			this.sessionId = sessionId;
-			this.id = id;
-		}
-
-		public static implicit operator SessionId (MessageId id)
-			=> new SessionId (id.sessionId);
-
-		public override string ToString ()
-			=> $"msg-{sessionId}:::{id}";
-
-		public override int GetHashCode ()
-			=> (sessionId?.GetHashCode () ?? 0) ^ id.GetHashCode ();
-
-		public override bool Equals (object obj)
-			=> (obj is MessageId) ? ((MessageId) obj).sessionId == sessionId && ((MessageId) obj).id == id : false;
-	}
-
-	internal class DotnetObjectId {
-		public string Scheme { get; }
-		public string Value { get; }
-
-		public static bool TryParse (JToken jToken, out DotnetObjectId objectId)
-			=> TryParse (jToken?.Value<string>(), out objectId);
-
-		public static bool TryParse (string id, out DotnetObjectId objectId)
-		{
-			objectId = null;
-			if (id == null)
-				return false;
-
-			if (!id.StartsWith ("dotnet:"))
-				return false;
-
-			var parts = id.Split (":", 3);
-
-			if (parts.Length < 3)
-				return false;
-
-			objectId = new DotnetObjectId (parts[1], parts[2]);
-
-			return true;
-		}
-
-		public DotnetObjectId (string scheme, string value)
-		{
-			Scheme = scheme;
-			Value = value;
-		}
-
-		public override string ToString ()
-			=> $"dotnet:{Scheme}:{Value}";
-	}
-
-	internal struct Result {
-		public JObject Value { get; private set; }
-		public JObject Error { get; private set; }
-
-		public bool IsOk => Value != null;
-		public bool IsErr => Error != null;
-
-		Result (JObject result, JObject error)
-		{
-			if (result != null && error != null)
-				throw new ArgumentException ($"Both {nameof(result)} and {nameof(error)} arguments cannot be non-null.");
-
-			bool resultHasError = String.Compare ((result? ["result"] as JObject)? ["subtype"]?. Value<string> (), "error") == 0;
-			if (result != null && resultHasError) {
-				this.Value = null;
-				this.Error = result;
-			} else {
-				this.Value = result;
-				this.Error = error;
-			}
-		}
-
-		public static Result FromJson (JObject obj)
-		{
-			//Log ("protocol", $"from result: {obj}");
-			return new Result (obj ["result"] as JObject, obj ["error"] as JObject);
-		}
-
-		public static Result Ok (JObject ok)
-			=> new Result (ok, null);
-
-		public static Result OkFromObject (object ok)
-			=> Ok (JObject.FromObject(ok));
-
-		public static Result Err (JObject err)
-			=> new Result (null, err);
-
-		public static Result Err (string msg)
-			=> new Result (null, JObject.FromObject (new { message = msg }));
-
-		public static Result Exception (Exception e)
-			=> new Result (null, JObject.FromObject (new { message = e.Message }));
-
-		public JObject ToJObject (MessageId target) {
-			if (IsOk) {
-				return JObject.FromObject (new {
-					target.id,
-					target.sessionId,
-					result = Value
-				});
-			} else {
-				return JObject.FromObject (new {
-					target.id,
-					target.sessionId,
-					error = Error
-				});
-			}
-		}
-
-		public override string ToString ()
-		{
-			return $"[Result: IsOk: {IsOk}, IsErr: {IsErr}, Value: {Value?.ToString ()}, Error: {Error?.ToString ()} ]";
-		}
-	}
-
-	internal class MonoCommands {
-		public string expression { get; set; }
-		public string objectGroup { get; set; } = "mono-debugger";
-		public bool includeCommandLineAPI { get; set; } = false;
-		public bool silent { get; set; } = false;
-		public bool returnByValue { get; set; } = true;
-
-		public MonoCommands (string expression)
-			=> this.expression = expression;
-
-		public static MonoCommands GetCallStack ()
-			=> new MonoCommands ("MONO.mono_wasm_get_call_stack()");
-
-		public static MonoCommands IsRuntimeReady ()
-			=> new MonoCommands ("MONO.mono_wasm_runtime_is_ready");
-
-		public static MonoCommands StartSingleStepping (StepKind kind)
-			=> new MonoCommands ($"MONO.mono_wasm_start_single_stepping ({(int)kind})");
-
-		public static MonoCommands GetLoadedFiles ()
-			=> new MonoCommands ("MONO.mono_wasm_get_loaded_files()");
-
-		public static MonoCommands ClearAllBreakpoints ()
-			=> new MonoCommands ("MONO.mono_wasm_clear_all_breakpoints()");
-
-		public static MonoCommands GetDetails (DotnetObjectId objectId, JToken args = null)
-			=> new MonoCommands ($"MONO.mono_wasm_get_details ('{objectId}', {(args ?? "{}")})");
-
-		public static MonoCommands GetScopeVariables (int scopeId, params int[] vars)
-			=> new MonoCommands ($"MONO.mono_wasm_get_variables({scopeId}, [ {string.Join (",", vars)} ])");
-
-		public static MonoCommands SetBreakpoint (string assemblyName, uint methodToken, int ilOffset)
-			=> new MonoCommands ($"MONO.mono_wasm_set_breakpoint (\"{assemblyName}\", {methodToken}, {ilOffset})");
-
-		public static MonoCommands RemoveBreakpoint (int breakpointId)
-			=> new MonoCommands ($"MONO.mono_wasm_remove_breakpoint({breakpointId})");
-
-		public static MonoCommands ReleaseObject (DotnetObjectId objectId)
-			=> new MonoCommands ($"MONO.mono_wasm_release_object('{objectId}')");
-
-		public static MonoCommands CallFunctionOn (JToken args)
-			=> new MonoCommands ($"MONO.mono_wasm_call_function_on ({args.ToString ()})");
-	}
-
-	internal enum MonoErrorCodes {
-		BpNotFound = 100000,
-	}
-
-	internal class MonoConstants {
-		public const string RUNTIME_IS_READY = "mono_wasm_runtime_ready";
-	}
-
-	class Frame {
-		public Frame (MethodInfo method, SourceLocation location, int id)
-		{
-			this.Method = method;
-			this.Location = location;
-			this.Id = id;
-		}
-
-		public MethodInfo Method { get; private set; }
-		public SourceLocation Location { get; private set; }
-		public int Id { get; private set; }
-	}
-
-	class Breakpoint {
-		public SourceLocation Location { get; private set; }
-		public int RemoteId { get; set; }
-		public BreakpointState State { get; set; }
-		public string StackId { get; private set; }
-
-		public static bool TryParseId (string stackId, out int id)
-		{
-			id = -1;
-			if (stackId?.StartsWith ("dotnet:", StringComparison.Ordinal) != true)
-				return false;
-
-			return int.TryParse (stackId.Substring ("dotnet:".Length), out id);
-		}
-
-		public Breakpoint (string stackId, SourceLocation loc, BreakpointState state)
-		{
-			this.StackId = stackId;
-			this.Location = loc;
-			this.State = state;
-		}
-	}
-
-	enum BreakpointState {
-		Active,
-		Disabled,
-		Pending
-	}
-
-	enum StepKind {
-		Into,
-		Out,
-		Over
-	}
-
-	internal class ExecutionContext {
-		public string DebuggerId { get; set; }
-		public Dictionary<string,BreakpointRequest> BreakpointRequests { get; } = new Dictionary<string,BreakpointRequest> ();
-
-		public TaskCompletionSource<DebugStore> ready = null;
-		public bool IsRuntimeReady => ready != null && ready.Task.IsCompleted;
-
-		public int Id { get; set; }
-		public object AuxData { get; set; }
-
-		public List<Frame> CallStack { get; set; }
-
-		internal DebugStore store;
-		public TaskCompletionSource<DebugStore> Source { get; } = new TaskCompletionSource<DebugStore> ();
-
-		public Dictionary<string, JToken> LocalsCache = new Dictionary<string, JToken> ();
-
-		public DebugStore Store {
-			get {
-				if (store == null || !Source.Task.IsCompleted)
-					return null;
-
-				return store;
-			}
-		}
-
-		public void ClearState ()
-		{
-			CallStack = null;
-			LocalsCache.Clear ();
-		}
-
-	}
-}

+ 0 - 337
src/Components/WebAssembly/DebugProxy/src/MonoDebugProxy/ws-proxy/DevToolsProxy.cs

@@ -1,337 +0,0 @@
-using System;
-using System.Linq;
-using System.Threading.Tasks;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-
-using System.Net.WebSockets;
-using System.Threading;
-using System.IO;
-using System.Text;
-using System.Collections.Generic;
-using Microsoft.Extensions.Logging;
-
-namespace WebAssembly.Net.Debugging {
-
-	class DevToolsQueue {
-		Task current_send;
-		List<byte []> pending;
-
-		public WebSocket Ws { get; private set; }
-		public Task CurrentSend { get { return current_send; } }
-		public DevToolsQueue (WebSocket sock)
-		{
-			this.Ws = sock;
-			pending = new List<byte []> ();
-		}
-
-		public Task Send (byte [] bytes, CancellationToken token)
-		{
-			pending.Add (bytes);
-			if (pending.Count == 1) {
-				if (current_send != null)
-					throw new Exception ("current_send MUST BE NULL IF THERE'S no pending send");
-				//logger.LogTrace ("sending {0} bytes", bytes.Length);
-				current_send = Ws.SendAsync (new ArraySegment<byte> (bytes), WebSocketMessageType.Text, true, token);
-				return current_send;
-			}
-			return null;
-		}
-
-		public Task Pump (CancellationToken token)
-		{
-			current_send = null;
-			pending.RemoveAt (0);
-
-			if (pending.Count > 0) {
-				if (current_send != null)
-					throw new Exception ("current_send MUST BE NULL IF THERE'S no pending send");
-
-				current_send = Ws.SendAsync (new ArraySegment<byte> (pending [0]), WebSocketMessageType.Text, true, token);
-				return current_send;
-			}
-			return null;
-		}
-	}
-
-	internal class DevToolsProxy {
-		TaskCompletionSource<bool> side_exception = new TaskCompletionSource<bool> ();
-		TaskCompletionSource<bool> client_initiated_close = new TaskCompletionSource<bool> ();
-		Dictionary<MessageId, TaskCompletionSource<Result>> pending_cmds = new Dictionary<MessageId, TaskCompletionSource<Result>> ();
-		ClientWebSocket browser;
-		WebSocket ide;
-		int next_cmd_id;
-		List<Task> pending_ops = new List<Task> ();
-		List<DevToolsQueue> queues = new List<DevToolsQueue> ();
-
-		protected readonly ILogger logger;
-
-		public DevToolsProxy (ILoggerFactory loggerFactory)
-		{
-			logger = loggerFactory.CreateLogger<DevToolsProxy>();
-		}
-
-		protected virtual Task<bool> AcceptEvent (SessionId sessionId, string method, JObject args, CancellationToken token)
-		{
-			return Task.FromResult (false);
-		}
-
-		protected virtual Task<bool> AcceptCommand (MessageId id, string method, JObject args, CancellationToken token)
-		{
-			return Task.FromResult (false);
-		}
-
-		async Task<string> ReadOne (WebSocket socket, CancellationToken token)
-		{
-			byte [] buff = new byte [4000];
-			var mem = new MemoryStream ();
-			while (true) {
-
-				if (socket.State != WebSocketState.Open) {
-					Log ("error", $"DevToolsProxy: Socket is no longer open.");
-					client_initiated_close.TrySetResult (true);
-					return null;
-				}
-
-				var result = await socket.ReceiveAsync (new ArraySegment<byte> (buff), token);
-				if (result.MessageType == WebSocketMessageType.Close) {
-					client_initiated_close.TrySetResult (true);
-					return null;
-				}
-
-				mem.Write (buff, 0, result.Count);
-
-				if (result.EndOfMessage)
-					return Encoding.UTF8.GetString (mem.GetBuffer (), 0, (int)mem.Length);
-			}
-		}
-
-		DevToolsQueue GetQueueForSocket (WebSocket ws)
-		{
-			return queues.FirstOrDefault (q => q.Ws == ws);
-		}
-
-		DevToolsQueue GetQueueForTask (Task task)
-		{
-			return queues.FirstOrDefault (q => q.CurrentSend == task);
-		}
-
-		void Send (WebSocket to, JObject o, CancellationToken token)
-		{
-			var sender = browser == to ? "Send-browser" : "Send-ide";
-
-			var method = o ["method"]?.ToString ();
-			//if (method != "Debugger.scriptParsed" && method != "Runtime.consoleAPICalled")
-				Log ("protocol", $"{sender}: " + JsonConvert.SerializeObject (o));
-			var bytes = Encoding.UTF8.GetBytes (o.ToString ());
-
-			var queue = GetQueueForSocket (to);
-
-			var task = queue.Send (bytes, token);
-			if (task != null)
-				pending_ops.Add (task);
-		}
-
-		async Task OnEvent (SessionId sessionId, string method, JObject args, CancellationToken token)
-		{
-			try {
-				if (!await AcceptEvent (sessionId, method, args, token)) {
-					//logger.LogDebug ("proxy browser: {0}::{1}",method, args);
-					SendEventInternal (sessionId, method, args, token);
-				}
-			} catch (Exception e) {
-				side_exception.TrySetException (e);
-			}
-		}
-
-		async Task OnCommand (MessageId id, string method, JObject args, CancellationToken token)
-		{
-			try {
-				if (!await AcceptCommand (id, method, args, token)) {
-					var res = await SendCommandInternal (id, method, args, token);
-					SendResponseInternal (id, res, token);
-				}
-			} catch (Exception e) {
-				side_exception.TrySetException (e);
-			}
-		}
-
-		void OnResponse (MessageId id, Result result)
-		{
-			//logger.LogTrace ("got id {0} res {1}", id, result);
-			// Fixme
-			if (pending_cmds.Remove (id, out var task)) {
-				task.SetResult (result);
-				return;
-			}
-			logger.LogError ("Cannot respond to command: {id} with result: {result} - command is not pending", id, result);
-		}
-
-		void ProcessBrowserMessage (string msg, CancellationToken token)
-		{
-			var res = JObject.Parse (msg);
-
-			var method = res ["method"]?.ToString ();
-			//if (method != "Debugger.scriptParsed" && method != "Runtime.consoleAPICalled")
-				Log ("protocol", $"browser: {msg}");
-
-			if (res ["id"] == null)
-				pending_ops.Add (OnEvent (new SessionId (res ["sessionId"]?.Value<string> ()), res ["method"].Value<string> (), res ["params"] as JObject, token));
-			else
-				OnResponse (new MessageId (res ["sessionId"]?.Value<string> (), res ["id"].Value<int> ()), Result.FromJson (res));
-		}
-
-		void ProcessIdeMessage (string msg, CancellationToken token)
-		{
-			Log ("protocol", $"ide: {msg}");
-			if (!string.IsNullOrEmpty (msg)) {
-				var res = JObject.Parse (msg);
-				pending_ops.Add (OnCommand (
-						new MessageId (res ["sessionId"]?.Value<string> (), res ["id"].Value<int> ()),
-						res ["method"].Value<string> (),
-						res ["params"] as JObject, token));
-			}
-		}
-
-		internal async Task<Result> SendCommand (SessionId id, string method, JObject args, CancellationToken token) {
-			//Log ("verbose", $"sending command {method}: {args}");
-			return await SendCommandInternal (id, method, args, token);
-		}
-
-		Task<Result> SendCommandInternal (SessionId sessionId, string method, JObject args, CancellationToken token)
-		{
-			int id = Interlocked.Increment (ref next_cmd_id);
-
-			var o = JObject.FromObject (new {
-				id,
-				method,
-				@params = args
-			});
-			if (sessionId.sessionId != null)
-				o["sessionId"] = sessionId.sessionId;
-			var tcs = new TaskCompletionSource<Result> ();
-
-			var msgId = new MessageId (sessionId.sessionId, id);
-			//Log ("verbose", $"add cmd id {sessionId}-{id}");
-			pending_cmds[msgId] = tcs;
-
-			Send (this.browser, o, token);
-			return tcs.Task;
-		}
-
-		public void SendEvent (SessionId sessionId, string method, JObject args, CancellationToken token)
-		{
-			//Log ("verbose", $"sending event {method}: {args}");
-			SendEventInternal (sessionId, method, args, token);
-		}
-
-		void SendEventInternal (SessionId sessionId, string method, JObject args, CancellationToken token)
-		{
-			var o = JObject.FromObject (new {
-				method,
-				@params = args
-			});
-			if (sessionId.sessionId != null)
-				o["sessionId"] = sessionId.sessionId;
-
-			Send (this.ide, o, token);
-		}
-
-		internal void SendResponse (MessageId id, Result result, CancellationToken token)
-		{
-			SendResponseInternal (id, result, token);
-		}
-
-		void SendResponseInternal (MessageId id, Result result, CancellationToken token)
-		{
-			JObject o = result.ToJObject (id);
-			if (result.IsErr)
-				logger.LogError ($"sending error response for id: {id} -> {result}");
-
-			Send (this.ide, o, token);
-		}
-
-		// , HttpContext context)
-		public async Task Run (Uri browserUri, WebSocket ideSocket)
-		{
-			Log ("info", $"DevToolsProxy: Starting on {browserUri}");
-			using (this.ide = ideSocket) {
-				Log ("verbose", $"DevToolsProxy: IDE waiting for connection on {browserUri}");
-				queues.Add (new DevToolsQueue (this.ide));
-				using (this.browser = new ClientWebSocket ()) {
-					this.browser.Options.KeepAliveInterval = Timeout.InfiniteTimeSpan;
-					await this.browser.ConnectAsync (browserUri, CancellationToken.None);
-					queues.Add (new DevToolsQueue (this.browser));
-
-					Log ("verbose", $"DevToolsProxy: Client connected on {browserUri}");
-					var x = new CancellationTokenSource ();
-
-					pending_ops.Add (ReadOne (browser, x.Token));
-					pending_ops.Add (ReadOne (ide, x.Token));
-					pending_ops.Add (side_exception.Task);
-					pending_ops.Add (client_initiated_close.Task);
-
-					try {
-						while (!x.IsCancellationRequested) {
-							var task = await Task.WhenAny (pending_ops.ToArray ());
-							//logger.LogTrace ("pump {0} {1}", task, pending_ops.IndexOf (task));
-							if (task == pending_ops [0]) {
-								var msg = ((Task<string>)task).Result;
-								if (msg != null) {
-									pending_ops [0] = ReadOne (browser, x.Token); //queue next read
-									ProcessBrowserMessage (msg, x.Token);
-								}
-							} else if (task == pending_ops [1]) {
-								var msg = ((Task<string>)task).Result;
-								if (msg != null) {
-									pending_ops [1] = ReadOne (ide, x.Token); //queue next read
-									ProcessIdeMessage (msg, x.Token);
-								}
-							} else if (task == pending_ops [2]) {
-								var res = ((Task<bool>)task).Result;
-								throw new Exception ("side task must always complete with an exception, what's going on???");
-							} else if (task == pending_ops [3]) {
-								var res = ((Task<bool>)task).Result;
-								Log ("verbose", $"DevToolsProxy: Client initiated close from {browserUri}");
-								x.Cancel ();
-							} else {
-								//must be a background task
-								pending_ops.Remove (task);
-								var queue = GetQueueForTask (task);
-								if (queue != null) {
-									var tsk = queue.Pump (x.Token);
-									if (tsk != null)
-										pending_ops.Add (tsk);
-								}
-							}
-						}
-					} catch (Exception e) {
-						Log ("error", $"DevToolsProxy::Run: Exception {e}");
-						//throw;
-					} finally {
-						if (!x.IsCancellationRequested)
-							x.Cancel ();
-					}
-				}
-			}
-		}
-
-		protected void Log (string priority, string msg)
-		{
-			switch (priority) {
-			case "protocol":
-				logger.LogTrace (msg);
-				break;
-			case "verbose":
-				logger.LogDebug (msg);
-				break;
-			case "info":
-			case "warning":
-			case "error":
-			default:
-				logger.LogDebug (msg);
-				break;
-			}
-		}
-	}
-}

+ 0 - 182
src/Components/WebAssembly/DebugProxy/src/MonoDebugProxy/ws-proxy/EvaluateExpression.cs

@@ -1,182 +0,0 @@
-using System;
-using System.Linq;
-using System.Threading.Tasks;
-using Newtonsoft.Json.Linq;
-
-using System.Threading;
-using System.IO;
-using System.Collections.Generic;
-using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.CSharp;
-using Microsoft.CodeAnalysis.Emit;
-using System.Reflection;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
-
-namespace WebAssembly.Net.Debugging {
-
-	internal class EvaluateExpression {
-
-		class FindThisExpression : CSharpSyntaxWalker {
-			public List<string> thisExpressions = new List<string> ();
-			public SyntaxTree syntaxTree;
-			public FindThisExpression (SyntaxTree syntax)
-			{
-				syntaxTree = syntax;
-			}
-			public override void Visit (SyntaxNode node)
-			{
-				if (node is ThisExpressionSyntax) {
-					if (node.Parent is MemberAccessExpressionSyntax thisParent && thisParent.Name is IdentifierNameSyntax) {
-						IdentifierNameSyntax var = thisParent.Name as IdentifierNameSyntax;
-						thisExpressions.Add(var.Identifier.Text);
-						var newRoot = syntaxTree.GetRoot ().ReplaceNode (node.Parent, thisParent.Name);
-						syntaxTree = syntaxTree.WithRootAndOptions (newRoot, syntaxTree.Options);
-						this.Visit (GetExpressionFromSyntaxTree(syntaxTree));
-					}
-				}
-				else
-					base.Visit (node);
-			}
-
-			public async Task CheckIfIsProperty (MonoProxy proxy, MessageId msg_id, int scope_id, CancellationToken token) 
-			{
-				foreach (var var in thisExpressions) {
-					JToken value = await proxy.TryGetVariableValue (msg_id, scope_id, var, true, token);
-					if (value == null)
-						throw new Exception ($"The property {var} does not exist in the current context");
-				}
-			}
-		}
-
-		class FindVariableNMethodCall : CSharpSyntaxWalker {
-			public List<IdentifierNameSyntax> variables = new List<IdentifierNameSyntax> ();
-			public List<ThisExpressionSyntax> thisList = new List<ThisExpressionSyntax> ();
-			public List<InvocationExpressionSyntax> methodCall = new List<InvocationExpressionSyntax> ();
-			public List<object> values = new List<Object> ();
-
-			public override void Visit (SyntaxNode node)
-			{
-				if (node is IdentifierNameSyntax identifier && !variables.Any (x => x.Identifier.Text == identifier.Identifier.Text))
-					variables.Add (identifier);
-				if (node is InvocationExpressionSyntax) {
-					methodCall.Add (node as InvocationExpressionSyntax);
-					throw new Exception ("Method Call is not implemented yet");
-				}
-				if (node is AssignmentExpressionSyntax)
-					throw new Exception ("Assignment is not implemented yet");
-				base.Visit (node);
-			}
-			public async Task<SyntaxTree> ReplaceVars (SyntaxTree syntaxTree, MonoProxy proxy, MessageId msg_id, int scope_id, CancellationToken token)
-			{
-				CompilationUnitSyntax root = syntaxTree.GetCompilationUnitRoot ();
-				foreach (var var in variables) {
-					ClassDeclarationSyntax classDeclaration = root.Members.ElementAt (0) as ClassDeclarationSyntax;
-					MethodDeclarationSyntax method = classDeclaration.Members.ElementAt (0) as MethodDeclarationSyntax;
-
-					JToken value = await proxy.TryGetVariableValue (msg_id, scope_id, var.Identifier.Text, false, token);
-
-					if (value == null)
-						throw new Exception ($"The name {var.Identifier.Text} does not exist in the current context");
-
-					values.Add (ConvertJSToCSharpType (value ["value"] ["value"].ToString (), value ["value"] ["type"].ToString ()));
-
-					var updatedMethod = method.AddParameterListParameters (
-						SyntaxFactory.Parameter (
-							SyntaxFactory.Identifier (var.Identifier.Text))
-							.WithType (SyntaxFactory.ParseTypeName (GetTypeFullName(value["value"]["type"].ToString()))));
-					root = root.ReplaceNode (method, updatedMethod);
-				}
-				syntaxTree = syntaxTree.WithRootAndOptions (root, syntaxTree.Options);
-				return syntaxTree;
-			}
-
-			private object ConvertJSToCSharpType (string v, string type)
-			{
-				switch (type) {
-				case "number":
-					return Convert.ChangeType (v, typeof (int));
-				case "string":
-					return v;
-				}
-
-				throw new Exception ($"Evaluate of this datatype {type} not implemented yet");
-			}
-
-			private string GetTypeFullName (string type)
-			{
-				switch (type) {
-					case "number":
-						return typeof (int).FullName;
-					case "string":
-						return typeof (string).FullName;
-				}
-
-				throw new Exception ($"Evaluate of this datatype {type} not implemented yet");
-			}
-		}
-		static SyntaxNode GetExpressionFromSyntaxTree (SyntaxTree syntaxTree)
-		{
-			CompilationUnitSyntax root = syntaxTree.GetCompilationUnitRoot ();
-			ClassDeclarationSyntax classDeclaration = root.Members.ElementAt (0) as ClassDeclarationSyntax;
-			MethodDeclarationSyntax methodDeclaration = classDeclaration.Members.ElementAt (0) as MethodDeclarationSyntax;
-			BlockSyntax blockValue = methodDeclaration.Body;
-			ReturnStatementSyntax returnValue = blockValue.Statements.ElementAt (0) as ReturnStatementSyntax;
-			InvocationExpressionSyntax expressionInvocation = returnValue.Expression as InvocationExpressionSyntax;
-			MemberAccessExpressionSyntax expressionMember = expressionInvocation.Expression as MemberAccessExpressionSyntax;
-			ParenthesizedExpressionSyntax expressionParenthesized = expressionMember.Expression as ParenthesizedExpressionSyntax;
-			return expressionParenthesized.Expression;
-		}
-		internal static async Task<string> CompileAndRunTheExpression (MonoProxy proxy, MessageId msg_id, int scope_id, string expression, CancellationToken token)
-		{
-			FindVariableNMethodCall findVarNMethodCall = new FindVariableNMethodCall ();
-			string retString;
-			SyntaxTree syntaxTree = CSharpSyntaxTree.ParseText (@"
-				using System;
-				public class CompileAndRunTheExpression
-				{
-					public string Evaluate()
-					{
-						return (" + expression + @").ToString(); 
-					}
-				}");
-
-			FindThisExpression findThisExpression = new FindThisExpression (syntaxTree);
-			var expressionTree = GetExpressionFromSyntaxTree(syntaxTree);
-			findThisExpression.Visit (expressionTree);
-			await findThisExpression.CheckIfIsProperty (proxy, msg_id, scope_id, token);
-			syntaxTree = findThisExpression.syntaxTree;
-
-			expressionTree = GetExpressionFromSyntaxTree (syntaxTree);
-			findVarNMethodCall.Visit (expressionTree);
-
-			syntaxTree = await findVarNMethodCall.ReplaceVars (syntaxTree, proxy, msg_id, scope_id, token);
-
-			MetadataReference [] references = new MetadataReference []
-			{
-				MetadataReference.CreateFromFile(typeof(object).Assembly.Location),
-				MetadataReference.CreateFromFile(typeof(Enumerable).Assembly.Location)
-			};
-
-			CSharpCompilation compilation = CSharpCompilation.Create (
-				"compileAndRunTheExpression",
-				syntaxTrees: new [] { syntaxTree },
-				references: references,
-				options: new CSharpCompilationOptions (OutputKind.DynamicallyLinkedLibrary));
-			using (var ms = new MemoryStream ()) {
-				EmitResult result = compilation.Emit (ms);
-				ms.Seek (0, SeekOrigin.Begin);
-				Assembly assembly = Assembly.Load (ms.ToArray ());
-				Type type = assembly.GetType ("CompileAndRunTheExpression");
-				object obj = Activator.CreateInstance (type);
-				var ret = type.InvokeMember ("Evaluate",
-					BindingFlags.Default | BindingFlags.InvokeMethod,
-					null,
-					obj,
-					//new object [] { 10 }
-					findVarNMethodCall.values.ToArray ());
-				retString = ret.ToString ();
-			}
-			return retString;
-		}
-	}
-}

+ 0 - 885
src/Components/WebAssembly/DebugProxy/src/MonoDebugProxy/ws-proxy/MonoProxy.cs

@@ -1,885 +0,0 @@
-using System;
-using System.Linq;
-using System.Threading.Tasks;
-using Newtonsoft.Json.Linq;
-
-using System.Threading;
-using System.IO;
-using System.Collections.Generic;
-using System.Net;
-using Microsoft.Extensions.Logging;
-using Microsoft.CodeAnalysis;
-
-
-namespace WebAssembly.Net.Debugging {
-
-	internal class MonoProxy : DevToolsProxy {
-		HashSet<SessionId> sessions = new HashSet<SessionId> ();
-		Dictionary<SessionId, ExecutionContext> contexts = new Dictionary<SessionId, ExecutionContext> ();
-
-		public MonoProxy (ILoggerFactory loggerFactory, bool hideWebDriver = true) : base(loggerFactory) { this.hideWebDriver = hideWebDriver; }
-
-		readonly bool hideWebDriver;
-
-		internal ExecutionContext GetContext (SessionId sessionId)
-		{
-			if (contexts.TryGetValue (sessionId, out var context))
-				return context;
-
-			throw new ArgumentException ($"Invalid Session: \"{sessionId}\"", nameof (sessionId));
-		}
-
-		bool UpdateContext (SessionId sessionId, ExecutionContext executionContext, out ExecutionContext previousExecutionContext)
-		{
-			var previous = contexts.TryGetValue (sessionId, out previousExecutionContext);
-			contexts[sessionId] = executionContext;
-			return previous;
-		}
-
-		internal Task<Result> SendMonoCommand (SessionId id, MonoCommands cmd, CancellationToken token)
-			=> SendCommand (id, "Runtime.evaluate", JObject.FromObject (cmd), token);
-
-		protected override async Task<bool> AcceptEvent (SessionId sessionId, string method, JObject args, CancellationToken token)
-		{
-			switch (method) {
-			case "Runtime.consoleAPICalled": {
-					var type = args["type"]?.ToString ();
-					if (type == "debug") {
-						if (args["args"]?[0]?["value"]?.ToString () == MonoConstants.RUNTIME_IS_READY && args["args"]?[1]?["value"]?.ToString () == "fe00e07a-5519-4dfe-b35a-f867dbaf2e28")
-							await RuntimeReady (sessionId, token);
-					}
-					break;
-				}
-
-			case "Runtime.executionContextCreated": {
-					SendEvent (sessionId, method, args, token);
-					var ctx = args? ["context"];
-					var aux_data = ctx? ["auxData"] as JObject;
-					var id = ctx ["id"].Value<int> ();
-					if (aux_data != null) {
-						var is_default = aux_data ["isDefault"]?.Value<bool> ();
-						if (is_default == true) {
-							await OnDefaultContext (sessionId, new ExecutionContext { Id = id, AuxData = aux_data }, token);
-						}
-					}
-					return true;
-				}
-
-			case "Debugger.paused": {
-					//TODO figure out how to stich out more frames and, in particular what happens when real wasm is on the stack
-					var top_func = args? ["callFrames"]? [0]? ["functionName"]?.Value<string> ();
-
-					if (top_func == "mono_wasm_fire_bp" || top_func == "_mono_wasm_fire_bp") {
-						return await OnBreakpointHit (sessionId, args, token);
-					}
-					break;
-				}
-
-			case "Debugger.breakpointResolved": {
-					break;
-				}
-
-			case "Debugger.scriptParsed": {
-					var url = args? ["url"]?.Value<string> () ?? "";
-
-					switch (url) {
-					case var _ when url == "":
-					case var _ when url.StartsWith ("wasm://", StringComparison.Ordinal): {
-							Log ("verbose", $"ignoring wasm: Debugger.scriptParsed {url}");
-							return true;
-						}
-					}
-					Log ("verbose", $"proxying Debugger.scriptParsed ({sessionId.sessionId}) {url} {args}");
-					break;
-				}
-
-			case "Target.attachedToTarget": {
-					if (args["targetInfo"]["type"]?.ToString() == "page")
-						await DeleteWebDriver (new SessionId (args["sessionId"]?.ToString ()), token);
-					break;
-				}
-
-			}
-
-			return false;
-		}
-
-		async Task<bool> IsRuntimeAlreadyReadyAlready (SessionId sessionId, CancellationToken token)
-		{
-			var res = await SendMonoCommand (sessionId, MonoCommands.IsRuntimeReady (), token);
-			return res.Value? ["result"]? ["value"]?.Value<bool> () ?? false;
-		}
-
-		static int bpIdGenerator;
-
-		protected override async Task<bool> AcceptCommand (MessageId id, string method, JObject args, CancellationToken token)
-		{
-			// Inspector doesn't use the Target domain or sessions
-			// so we try to init immediately
-			if (hideWebDriver && id == SessionId.Null)
-				await DeleteWebDriver (id, token);
-
-			if (!contexts.TryGetValue (id, out var context))
-				return false;
-
-			switch (method) {
-			case "Target.attachToTarget": {
-					var resp = await SendCommand (id, method, args, token);
-					await DeleteWebDriver (new SessionId (resp.Value ["sessionId"]?.ToString ()), token);
-					break;
-				}
-
-			case "Debugger.enable": {
-					var resp = await SendCommand (id, method, args, token);
-
-					context.DebuggerId = resp.Value ["debuggerId"]?.ToString ();
-
-					if (await IsRuntimeAlreadyReadyAlready (id, token))
-						await RuntimeReady (id, token);
-
-					SendResponse (id,resp,token);
-					return true;
-				}
-
-			case "Debugger.getScriptSource": {
-					var script = args? ["scriptId"]?.Value<string> ();
-					return await OnGetScriptSource (id, script, token);
-				}
-
-			case "Runtime.compileScript": {
-					var exp = args? ["expression"]?.Value<string> ();
-					if (exp.StartsWith ("//dotnet:", StringComparison.Ordinal)) {
-						OnCompileDotnetScript (id, token);
-						return true;
-					}
-					break;
-				}
-
-			case "Debugger.getPossibleBreakpoints": {
-					var resp = await SendCommand (id, method, args, token);
-					if (resp.IsOk && resp.Value["locations"].HasValues) {
-						SendResponse (id, resp, token);
-						return true;
-					}
-
-					var start = SourceLocation.Parse (args? ["start"] as JObject);
-					//FIXME support variant where restrictToFunction=true and end is omitted
-					var end = SourceLocation.Parse (args? ["end"] as JObject);
-					if (start != null && end != null && await GetPossibleBreakpoints (id, start, end, token))
-						return true;
-
-					SendResponse (id, resp, token);
-					return true;
-				}
-
-			case "Debugger.setBreakpoint": {
-					break;
-				}
-
-			case "Debugger.setBreakpointByUrl": {
-					var resp = await SendCommand (id, method, args, token);
-					if (!resp.IsOk) {
-						SendResponse (id, resp, token);
-						return true;
-					}
-
-					var bpid = resp.Value["breakpointId"]?.ToString ();
-					var locations = resp.Value["locations"]?.Values<object>();
-					var request = BreakpointRequest.Parse (bpid, args);
-
-					// is the store done loading?
-					var loaded = context.Source.Task.IsCompleted;
-					if (!loaded) {
-						// Send and empty response immediately if not
-						// and register the breakpoint for resolution
-						context.BreakpointRequests [bpid] = request;
-						SendResponse (id, resp, token);
-					}
-
-					if (await IsRuntimeAlreadyReadyAlready (id, token)) {
-						var store = await RuntimeReady (id, token);
-
-						Log ("verbose", $"BP req {args}");
-						await SetBreakpoint (id, store, request, !loaded, token);
-					}
-
-					if (loaded) {
-						// we were already loaded so we should send a response
-						// with the locations included and register the request
-						context.BreakpointRequests [bpid] = request;
-						var result = Result.OkFromObject (request.AsSetBreakpointByUrlResponse (locations));
-						SendResponse (id, result, token);
-
-					}
-					return true;
-				}
-
-			case "Debugger.removeBreakpoint": {
-					await RemoveBreakpoint (id, args, token);
-					break;
-				}
-
-			case "Debugger.resume": {
-					await OnResume (id, token);
-					break;
-				}
-
-			case "Debugger.stepInto": {
-					return await Step (id, StepKind.Into, token);
-				}
-
-			case "Debugger.stepOut": {
-					return await Step (id, StepKind.Out, token);
-				}
-
-			case "Debugger.stepOver": {
-					return await Step (id, StepKind.Over, token);
-				}
-
-			case "Debugger.evaluateOnCallFrame": {
-					if (!DotnetObjectId.TryParse (args? ["callFrameId"], out var objectId))
-						return false;
-
-					switch (objectId.Scheme) {
-					case "scope":
-						return await OnEvaluateOnCallFrame (id,
-								int.Parse (objectId.Value),
-								args? ["expression"]?.Value<string> (), token);
-					default:
-						return false;
-					}
-				}
-
-			case "Runtime.getProperties": {
-					if (!DotnetObjectId.TryParse (args? ["objectId"], out var objectId))
-						break;
-
-					var result = await RuntimeGetProperties (id, objectId, args, token);
-					SendResponse (id, result, token);
-					return true;
-				}
-
-			case "Runtime.releaseObject": {
-					if (!(DotnetObjectId.TryParse (args ["objectId"], out var objectId) && objectId.Scheme == "cfo_res"))
-						break;
-
-					await SendMonoCommand (id, MonoCommands.ReleaseObject (objectId), token);
-					SendResponse (id, Result.OkFromObject (new{}), token);
-					return true;
-				}
-
-				// Protocol extensions
-			case "Dotnet-test.setBreakpointByMethod": {
-				Console.WriteLine ("set-breakpoint-by-method: " + id + " " + args);
-
-				var store = await RuntimeReady (id, token);
-				string aname = args ["assemblyName"]?.Value<string> ();
-				string typeName = args ["typeName"]?.Value<string> ();
-				string methodName = args ["methodName"]?.Value<string> ();
-				if (aname == null || typeName == null || methodName == null) {
-					SendResponse (id, Result.Err ("Invalid protocol message '" + args + "'."), token);
-					return true;
-				}
-
-				// GetAssemblyByName seems to work on file names
-				var assembly = store.GetAssemblyByName (aname);
-				if (assembly == null)
-					assembly = store.GetAssemblyByName (aname + ".exe");
-				if (assembly == null)
-					assembly = store.GetAssemblyByName (aname + ".dll");
-				if (assembly == null) {
-					SendResponse (id, Result.Err ("Assembly '" + aname + "' not found."), token);
-					return true;
-				}
-
-				var type = assembly.GetTypeByName (typeName);
-				if (type == null) {
-					SendResponse (id, Result.Err ($"Type '{typeName}' not found."), token);
-					return true;
-				}
-
-				var methodInfo = type.Methods.FirstOrDefault (m => m.Name == methodName);
-				if (methodInfo == null) {
-					SendResponse (id, Result.Err ($"Method '{typeName}:{methodName}' not found."), token);
-					return true;
-				}
-
-				bpIdGenerator ++;
-				string bpid = "by-method-" + bpIdGenerator.ToString ();
-				var request = new BreakpointRequest (bpid, methodInfo);
-				context.BreakpointRequests[bpid] = request;
-
-				var loc = methodInfo.StartLocation;
-				var bp = await SetMonoBreakpoint (id, bpid, loc, token);
-				if (bp.State != BreakpointState.Active) {
-					// FIXME:
-					throw new NotImplementedException ();
-				}
-
-				var resolvedLocation = new {
-					breakpointId = bpid,
-					location = loc.AsLocation ()
-				};
-
-				SendEvent (id, "Debugger.breakpointResolved", JObject.FromObject (resolvedLocation), token);
-
-				SendResponse (id, Result.OkFromObject (new {
-						result = new { breakpointId = bpid, locations = new object [] { loc.AsLocation () }}
-					}), token);
-
-				return true;
-			}
-			case "Runtime.callFunctionOn": {
-					if (!DotnetObjectId.TryParse (args ["objectId"], out var objectId))
-						return false;
-
-					var silent = args ["silent"]?.Value<bool> () ?? false;
-					if (objectId.Scheme == "scope") {
-						var fail = silent ? Result.OkFromObject (new { result = new { } }) : Result.Exception (new ArgumentException ($"Runtime.callFunctionOn not supported with scope ({objectId})."));
-
-						SendResponse (id, fail, token);
-						return true;
-					}
-
-					var returnByValue = args ["returnByValue"]?.Value<bool> () ?? false;
-					var res = await SendMonoCommand (id, MonoCommands.CallFunctionOn (args), token);
-
-					if (!returnByValue &&
-						DotnetObjectId.TryParse (res.Value?["result"]?["value"]?["objectId"], out var resultObjectId) &&
-						resultObjectId.Scheme == "cfo_res")
-						res = Result.OkFromObject (new { result = res.Value ["result"]["value"] });
-
-					if (res.IsErr && silent)
-						res = Result.OkFromObject (new { result = new { } });
-
-					SendResponse (id, res, token);
-					return true;
-				}
-			}
-
-			return false;
-		}
-
-		async Task<Result> RuntimeGetProperties (MessageId id, DotnetObjectId objectId, JToken args, CancellationToken token)
-		{
-			if (objectId.Scheme == "scope")
-				return await GetScopeProperties (id, int.Parse (objectId.Value), token);
-
-			var res = await SendMonoCommand (id, MonoCommands.GetDetails (objectId, args), token);
-			if (res.IsErr)
-				return res;
-
-			if (objectId.Scheme == "cfo_res") {
-				// Runtime.callFunctionOn result object
-				var value_json_str = res.Value ["result"]?["value"]?["__value_as_json_string__"]?.Value<string> ();
-				if (value_json_str != null) {
-					res = Result.OkFromObject (new {
-							result = JArray.Parse (value_json_str.Replace (@"\""", "\""))
-					});
-				} else {
-					res = Result.OkFromObject (new { result = new {} });
-				}
-			} else {
-				res = Result.Ok (JObject.FromObject (new { result = res.Value ["result"] ["value"] }));
-			}
-
-			return res;
-		}
-
-		//static int frame_id=0;
-		async Task<bool> OnBreakpointHit (SessionId sessionId, JObject args, CancellationToken token)
-		{
-			//FIXME we should send release objects every now and then? Or intercept those we inject and deal in the runtime
-			var res = await SendMonoCommand (sessionId, MonoCommands.GetCallStack(), token);
-			var orig_callframes = args? ["callFrames"]?.Values<JObject> ();
-			var context = GetContext (sessionId);
-
-			if (res.IsErr) {
-				//Give up and send the original call stack
-				return false;
-			}
-
-			//step one, figure out where did we hit
-			var res_value = res.Value? ["result"]? ["value"];
-			if (res_value == null || res_value is JValue) {
-				//Give up and send the original call stack
-				return false;
-			}
-
-			Log ("verbose", $"call stack (err is {res.Error} value is:\n{res.Value}");
-			var bp_id = res_value? ["breakpoint_id"]?.Value<int> ();
-			Log ("verbose", $"We just hit bp {bp_id}");
-			if (!bp_id.HasValue) {
-				//Give up and send the original call stack
-				return false;
-			}
-
-			var bp = context.BreakpointRequests.Values.SelectMany (v => v.Locations).FirstOrDefault (b => b.RemoteId == bp_id.Value);
-
-			var callFrames = new List<object> ();
-			foreach (var frame in orig_callframes) {
-				var function_name = frame ["functionName"]?.Value<string> ();
-				var url = frame ["url"]?.Value<string> ();
-				if ("mono_wasm_fire_bp" == function_name || "_mono_wasm_fire_bp" == function_name) {
-					var frames = new List<Frame> ();
-					int frame_id = 0;
-					var the_mono_frames = res.Value? ["result"]? ["value"]? ["frames"]?.Values<JObject> ();
-
-					foreach (var mono_frame in the_mono_frames) {
-						++frame_id;
-						var il_pos = mono_frame ["il_pos"].Value<int> ();
-						var method_token = mono_frame ["method_token"].Value<uint> ();
-						var assembly_name = mono_frame ["assembly_name"].Value<string> ();
-
-						// This can be different than `method.Name`, like in case of generic methods
-						var method_name = mono_frame ["method_name"]?.Value<string> ();
-
-						var store = await LoadStore (sessionId, token);
-						var asm = store.GetAssemblyByName (assembly_name);
-						if (asm == null) {
-							Log ("info",$"Unable to find assembly: {assembly_name}");
-							continue;
-						}
-
-						var method = asm.GetMethodByToken (method_token);
-
-						if (method == null) {
-							Log ("info", $"Unable to find il offset: {il_pos} in method token: {method_token} assembly name: {assembly_name}");
-							continue;
-						}
-
-						var location = method?.GetLocationByIl (il_pos);
-
-						// When hitting a breakpoint on the "IncrementCount" method in the standard
-						// Blazor project template, one of the stack frames is inside mscorlib.dll
-						// and we get location==null for it. It will trigger a NullReferenceException
-						// if we don't skip over that stack frame.
-						if (location == null) {
-							continue;
-						}
-
-						Log ("info", $"frame il offset: {il_pos} method token: {method_token} assembly name: {assembly_name}");
-						Log ("info", $"\tmethod {method_name} location: {location}");
-						frames.Add (new Frame (method, location, frame_id-1));
-
-						callFrames.Add (new {
-							functionName = method_name,
-							callFrameId = $"dotnet:scope:{frame_id-1}",
-							functionLocation = method.StartLocation.AsLocation (),
-
-							location = location.AsLocation (),
-
-							url = store.ToUrl (location),
-
-							scopeChain = new [] {
-								new {
-									type = "local",
-									@object = new {
-										@type = "object",
-										className = "Object",
-										description = "Object",
-										objectId = $"dotnet:scope:{frame_id-1}",
-									},
-									name = method_name,
-									startLocation = method.StartLocation.AsLocation (),
-									endLocation = method.EndLocation.AsLocation (),
-								}}
-						});
-
-						context.CallStack = frames;
-
-					}
-				} else if (!(function_name.StartsWith ("wasm-function", StringComparison.Ordinal)
-					|| url.StartsWith ("wasm://wasm/", StringComparison.Ordinal))) {
-					callFrames.Add (frame);
-				}
-			}
-
-			var bp_list = new string [bp == null ? 0 : 1];
-			if (bp != null)
-				bp_list [0] = bp.StackId;
-
-			var o = JObject.FromObject (new {
-				callFrames,
-				reason = "other", //other means breakpoint
-				hitBreakpoints = bp_list,
-			});
-
-			SendEvent (sessionId, "Debugger.paused", o, token);
-			return true;
-		}
-
-		async Task OnDefaultContext (SessionId sessionId, ExecutionContext context, CancellationToken token)
-		{
-			Log ("verbose", "Default context created, clearing state and sending events");
-			if (UpdateContext (sessionId, context, out var previousContext)) {
-				foreach (var kvp in previousContext.BreakpointRequests) {
-					context.BreakpointRequests[kvp.Key] = kvp.Value.Clone();
-				}
-			}
-
-			if (await IsRuntimeAlreadyReadyAlready (sessionId, token))
-				await RuntimeReady (sessionId, token);
-		}
-
-		async Task OnResume (MessageId msd_id, CancellationToken token)
-		{
-			//discard managed frames
-			GetContext (msd_id).ClearState ();
-			await Task.CompletedTask;
-		}
-
-		async Task<bool> Step (MessageId msg_id, StepKind kind, CancellationToken token)
-		{
-			var context = GetContext (msg_id);
-			if (context.CallStack == null)
-				return false;
-
-			if (context.CallStack.Count <= 1 && kind == StepKind.Out)
-				return false;
-
-			var res = await SendMonoCommand (msg_id, MonoCommands.StartSingleStepping (kind), token);
-
-			var ret_code = res.Value? ["result"]? ["value"]?.Value<int> ();
-
-			if (ret_code.HasValue && ret_code.Value == 0) {
-				context.ClearState ();
-				await SendCommand (msg_id, "Debugger.stepOut", new JObject (), token);
-				return false;
-			}
-
-			SendResponse (msg_id, Result.Ok (new JObject ()), token);
-
-			context.ClearState ();
-
-			await SendCommand (msg_id, "Debugger.resume", new JObject (), token);
-			return true;
-		}
-
-		internal bool TryFindVariableValueInCache(ExecutionContext ctx, string expression, bool only_search_on_this, out JToken obj)
-		{
-			if (ctx.LocalsCache.TryGetValue (expression, out obj)) {
-				if (only_search_on_this && obj["fromThis"] == null)
-					return false;
-				return true;
-			}
-			return false;
-		}
-
-		internal async Task<JToken> TryGetVariableValue (MessageId msg_id, int scope_id, string expression, bool only_search_on_this, CancellationToken token)
-		{
-			JToken thisValue = null;
-			var context = GetContext (msg_id);
-			if (context.CallStack == null)
-				return null;
-
-			if (TryFindVariableValueInCache(context, expression, only_search_on_this, out JToken obj))
-				return obj;
-
-			var scope = context.CallStack.FirstOrDefault (s => s.Id == scope_id);
-			var live_vars = scope.Method.GetLiveVarsAt (scope.Location.CliLocation.Offset);
-			//get_this
-			var res = await SendMonoCommand (msg_id, MonoCommands.GetScopeVariables (scope.Id, live_vars.Select (lv => lv.Index).ToArray ()), token);
-
-			var scope_values = res.Value? ["result"]? ["value"]?.Values<JObject> ()?.ToArray ();
-			thisValue = scope_values?.FirstOrDefault (v => v ["name"]?.Value<string> () == "this");
-
-			if (!only_search_on_this) {
-				if (thisValue != null && expression == "this")
-					return thisValue;
-
-				var value = scope_values.SingleOrDefault (sv => sv ["name"]?.Value<string> () == expression);
-				if (value != null)
-					return value;
-			}
-
-			//search in scope
-			if (thisValue != null) {
-				if (!DotnetObjectId.TryParse (thisValue ["value"] ["objectId"], out var objectId))
-					return null;
-
-				res = await SendMonoCommand (msg_id, MonoCommands.GetDetails (objectId), token);
-				scope_values = res.Value? ["result"]? ["value"]?.Values<JObject> ().ToArray ();
-				var foundValue = scope_values.FirstOrDefault (v => v ["name"].Value<string> () == expression);
-				if (foundValue != null) {
-					foundValue["fromThis"] = true;
-					context.LocalsCache[foundValue ["name"].Value<string> ()] = foundValue;
-					return foundValue;
-				}
-			}
-			return null;
-		}
-
-		async Task<bool> OnEvaluateOnCallFrame (MessageId msg_id, int scope_id, string expression, CancellationToken token)
-		{
-			try {
-				var context = GetContext (msg_id);
-				if (context.CallStack == null)
-					return false;
-
-				var varValue = await TryGetVariableValue (msg_id, scope_id, expression, false, token);
-
-				if (varValue != null) {
-					SendResponse (msg_id, Result.OkFromObject (new {
-						result = varValue ["value"]
-					}), token);
-					return true;
-				}
-
-				string retValue = await EvaluateExpression.CompileAndRunTheExpression (this, msg_id, scope_id, expression, token);
-				SendResponse (msg_id, Result.OkFromObject (new {
-					result = new {
-						value = retValue
-					}
-				}), token);
-				return true;
-			} catch (Exception e) {
-				logger.LogDebug (e, $"Error in EvaluateOnCallFrame for expression '{expression}.");
-			}
-			return false;
-		}
-
-		async Task<Result> GetScopeProperties (MessageId msg_id, int scope_id, CancellationToken token)
-		{
-			try {
-				var ctx = GetContext (msg_id);
-				var scope = ctx.CallStack.FirstOrDefault (s => s.Id == scope_id);
-				if (scope == null)
-					return Result.Err (JObject.FromObject (new { message = $"Could not find scope with id #{scope_id}" }));
-
-				var vars = scope.Method.GetLiveVarsAt (scope.Location.CliLocation.Offset);
-
-				var var_ids = vars.Select (v => v.Index).ToArray ();
-				var res = await SendMonoCommand (msg_id, MonoCommands.GetScopeVariables (scope.Id, var_ids), token);
-
-				//if we fail we just buble that to the IDE (and let it panic over it)
-				if (res.IsErr)
-					return res;
-
-				var values = res.Value? ["result"]? ["value"]?.Values<JObject> ().ToArray ();
-
-				if(values == null)
-					return Result.OkFromObject (new { result = Array.Empty<object> () });
-
-				var var_list = new List<object> ();
-				int i = 0;
-				for (; i < vars.Length && i < values.Length; i ++) {
-					// For async methods, we get locals with names, unlike non-async methods
-					// and the order may not match the var_ids, so, use the names that they
-					// come with
-					if (values [i]["name"] != null)
-						continue;
-
-					ctx.LocalsCache[vars [i].Name] = values [i];
-					var_list.Add (new { name = vars [i].Name, value = values [i]["value"] });
-				}
-				for (; i < values.Length; i ++) {
-					ctx.LocalsCache[values [i]["name"].ToString()] = values [i];
-					var_list.Add (values [i]);
-				}
-
-				return Result.OkFromObject (new { result = var_list });
-			} catch (Exception exception) {
-				Log ("verbose", $"Error resolving scope properties {exception.Message}");
-				return Result.Exception (exception);
-			}
-		}
-
-		async Task<Breakpoint> SetMonoBreakpoint (SessionId sessionId, string reqId, SourceLocation location, CancellationToken token)
-		{
-			var bp = new Breakpoint (reqId, location, BreakpointState.Pending);
-			var asm_name = bp.Location.CliLocation.Method.Assembly.Name;
-			var method_token = bp.Location.CliLocation.Method.Token;
-			var il_offset = bp.Location.CliLocation.Offset;
-
-			var res = await SendMonoCommand (sessionId, MonoCommands.SetBreakpoint (asm_name, method_token, il_offset), token);
-			var ret_code = res.Value? ["result"]? ["value"]?.Value<int> ();
-
-			if (ret_code.HasValue) {
-				bp.RemoteId = ret_code.Value;
-				bp.State = BreakpointState.Active;
-				//Log ("verbose", $"BP local id {bp.LocalId} enabled with remote id {bp.RemoteId}");
-			}
-
-			return bp;
-		}
-
-		async Task<DebugStore> LoadStore (SessionId sessionId, CancellationToken token)
-		{
-			var context = GetContext (sessionId);
-
-			if (Interlocked.CompareExchange (ref context.store, new DebugStore (logger), null) != null)
-				return await context.Source.Task;
-
-			try {
-				var loaded_pdbs = await SendMonoCommand (sessionId, MonoCommands.GetLoadedFiles(), token);
-				var the_value = loaded_pdbs.Value? ["result"]? ["value"];
-				var the_pdbs = the_value?.ToObject<string[]> ();
-
-				await foreach (var source in context.store.Load(sessionId, the_pdbs, token).WithCancellation (token)) {
-					var scriptSource = JObject.FromObject (source.ToScriptSource (context.Id, context.AuxData));
-					Log ("verbose", $"\tsending {source.Url} {context.Id} {sessionId.sessionId}");
-
-					SendEvent (sessionId, "Debugger.scriptParsed", scriptSource, token);
-
-					foreach (var req in context.BreakpointRequests.Values) {
-						if (req.TryResolve (source)) {
-							await SetBreakpoint (sessionId, context.store, req, true, token);
-						}
-					}
-				}
-			} catch (Exception e) {
-				context.Source.SetException (e);
-			}
-
-			if (!context.Source.Task.IsCompleted)
-				context.Source.SetResult (context.store);
-			return context.store;
-		}
-
-		async Task<DebugStore> RuntimeReady (SessionId sessionId, CancellationToken token)
-		{
-			var context = GetContext (sessionId);
-			if (Interlocked.CompareExchange (ref context.ready, new TaskCompletionSource<DebugStore> (), null) != null)
-				return await context.ready.Task;
-
-			var clear_result = await SendMonoCommand (sessionId, MonoCommands.ClearAllBreakpoints (), token);
-			if (clear_result.IsErr) {
-				Log ("verbose", $"Failed to clear breakpoints due to {clear_result}");
-			}
-
-			var store = await LoadStore (sessionId, token);
-
-			context.ready.SetResult (store);
-			SendEvent (sessionId, "Mono.runtimeReady", new JObject (), token);
-			return store;
-		}
-
-		async Task RemoveBreakpoint(MessageId msg_id, JObject args, CancellationToken token) {
-			var bpid = args? ["breakpointId"]?.Value<string> ();
-
-			var context = GetContext (msg_id);
-			if (!context.BreakpointRequests.TryGetValue (bpid, out var breakpointRequest))
-				return;
-
-			foreach (var bp in breakpointRequest.Locations) {
-				var res = await SendMonoCommand (msg_id, MonoCommands.RemoveBreakpoint (bp.RemoteId), token);
-				var ret_code = res.Value? ["result"]? ["value"]?.Value<int> ();
-
-				if (ret_code.HasValue) {
-					bp.RemoteId = -1;
-					bp.State = BreakpointState.Disabled;
-				}
-			}
-			breakpointRequest.Locations.Clear ();
-		}
-
-		async Task SetBreakpoint (SessionId sessionId, DebugStore store, BreakpointRequest req, bool sendResolvedEvent, CancellationToken token)
-		{
-			var context = GetContext (sessionId);
-			if (req.Locations.Any ()) {
-				Log ("debug", $"locations already loaded for {req.Id}");
-				return;
-			}
-
-			var comparer = new SourceLocation.LocationComparer ();
-			// if column is specified the frontend wants the exact matches
-			// and will clear the bp if it isn't close enoug
-			var locations = store.FindBreakpointLocations (req)
-				.Distinct (comparer)
-				.Where (l => l.Line == req.Line && (req.Column == 0 || l.Column == req.Column))
-				.OrderBy (l => l.Column)
-				.GroupBy (l => l.Id);
-
-			logger.LogDebug ("BP request for '{req}' runtime ready {context.RuntimeReady}", req, GetContext (sessionId).IsRuntimeReady);
-
-			var breakpoints = new List<Breakpoint> ();
-
-			foreach (var sourceId in locations) {
-				var loc = sourceId.First ();
-				var bp = await SetMonoBreakpoint (sessionId, req.Id, loc, token);
-
-				// If we didn't successfully enable the breakpoint
-				// don't add it to the list of locations for this id
-				if (bp.State != BreakpointState.Active)
-					continue;
-
-				breakpoints.Add (bp);
-
-				var resolvedLocation = new {
-					breakpointId = req.Id,
-					location = loc.AsLocation ()
-				};
-
-				if (sendResolvedEvent)
-					SendEvent (sessionId, "Debugger.breakpointResolved", JObject.FromObject (resolvedLocation), token);
-			}
-
-			req.Locations.AddRange (breakpoints);
-			return;
-		}
-
-		async Task<bool> GetPossibleBreakpoints (MessageId msg, SourceLocation start, SourceLocation end, CancellationToken token)
-		{
-			var bps = (await RuntimeReady (msg, token)).FindPossibleBreakpoints (start, end);
-
-			if (bps == null)
-				return false;
-
-			var response = new { locations = bps.Select (b => b.AsLocation ()) };
-
-			SendResponse (msg, Result.OkFromObject (response), token);
-			return true;
-		}
-
-		void OnCompileDotnetScript (MessageId msg_id, CancellationToken token)
-		{
-			SendResponse (msg_id, Result.OkFromObject (new { }), token);
-		}
-
-		async Task<bool> OnGetScriptSource (MessageId msg_id, string script_id, CancellationToken token)
-		{
-			if (!SourceId.TryParse (script_id, out var id))
-				return false;
-
-			var src_file = (await LoadStore (msg_id, token)).GetFileById (id);
-
-			try {
-				var uri = new Uri (src_file.Url);
-				string source = $"// Unable to find document {src_file.SourceUri}";
-
-				using (var data = await src_file.GetSourceAsync (checkHash: false, token: token)) {
-						if (data.Length == 0)
-							return false;
-
-						using (var reader = new StreamReader (data))
-							source = await reader.ReadToEndAsync ();
-				}
-				SendResponse (msg_id, Result.OkFromObject (new { scriptSource = source }), token);
-			} catch (Exception e) {
-				var o = new {
-					scriptSource = $"// Unable to read document ({e.Message})\n" +
-								$"Local path: {src_file?.SourceUri}\n" +
-								$"SourceLink path: {src_file?.SourceLinkUri}\n"
-				};
-
-				SendResponse (msg_id, Result.OkFromObject (o), token);
-			}
-			return true;
-		}
-
-		async Task DeleteWebDriver (SessionId sessionId, CancellationToken token)
-		{
-			// see https://github.com/mono/mono/issues/19549 for background
-			if (hideWebDriver && sessions.Add (sessionId)) {
-				var res = await SendCommand (sessionId,
-					"Page.addScriptToEvaluateOnNewDocument",
-					JObject.FromObject (new { source = "delete navigator.constructor.prototype.webdriver"}),
-					token);
-
-				if (sessionId != SessionId.Null && !res.IsOk)
-					sessions.Remove (sessionId);
-			}
-		}
-	}
-}

+ 0 - 71
src/Components/WebAssembly/DebugProxy/src/Program.cs

@@ -1,71 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System;
-using System.Diagnostics;
-using Microsoft.AspNetCore.Components.WebAssembly.DebugProxy.Hosting;
-using Microsoft.AspNetCore.Hosting;
-using Microsoft.Extensions.CommandLineUtils;
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Hosting;
-
-namespace Microsoft.AspNetCore.Components.WebAssembly.DebugProxy
-{
-    public class Program
-    {
-        static int Main(string[] args)
-        {
-            var app = new CommandLineApplication(throwOnUnexpectedArg: false)
-            {
-                Name = "webassembly-debugproxy"
-            };
-            app.HelpOption("-?|-h|--help");
-
-            var browserHostOption = new CommandOption("-b|--browser-host", CommandOptionType.SingleValue)
-            {
-                Description = "Host on which the browser is listening for debug connections. Example: http://localhost:9300"
-            };
-
-            var ownerPidOption = new CommandOption("-op|--owner-pid", CommandOptionType.SingleValue)
-            {
-                Description = "ID of the owner process. The debug proxy will shut down if this process exits."
-            };
-
-            app.Options.Add(browserHostOption);
-            app.Options.Add(ownerPidOption);
-
-            app.OnExecute(() =>
-            {
-                var browserHost = browserHostOption.HasValue() ? browserHostOption.Value(): "http://127.0.0.1:9222";
-                var host = DebugProxyHost.CreateDefaultBuilder(args, browserHost).Build();
-
-                if (ownerPidOption.HasValue())
-                {
-                    var ownerProcess = Process.GetProcessById(int.Parse(ownerPidOption.Value()));
-                    ownerProcess.EnableRaisingEvents = true;
-                    ownerProcess.Exited += async (sender, eventArgs) =>
-                    {
-                        Console.WriteLine("Exiting because parent process has exited");
-                        await host.StopAsync();
-                    };
-                }
-
-                host.Run();
-
-                return 0;
-            });
-
-            try
-            {
-                return app.Execute(args);
-            }
-            catch (CommandParsingException cex)
-            {
-                app.Error.WriteLine(cex.Message);
-                app.ShowHelp();
-                return 1;
-            }
-        }
-    }
-}

+ 0 - 45
src/Components/WebAssembly/DebugProxy/src/Startup.cs

@@ -1,45 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System;
-using System.Net;
-using Microsoft.AspNetCore.Builder;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Logging;
-using WebAssembly.Net.Debugging;
-
-namespace Microsoft.AspNetCore.Components.WebAssembly.DebugProxy
-{
-    public class Startup
-    {
-        public void Configure(IApplicationBuilder app, DebugProxyOptions debugProxyOptions)
-        {
-            app.UseDeveloperExceptionPage();
-            app.UseWebSockets();
-            app.UseRouting();
-
-            app.UseEndpoints(endpoints =>
-            {
-                // At the homepage, we check whether we can uniquely identify the target tab
-                //  - If yes, we redirect directly to the debug tools, proxying to that tab
-                //  - If no, we present a list of available tabs for the user to pick from
-                endpoints.MapGet("/", new TargetPickerUi(debugProxyOptions).Display);
-
-                // At this URL, we wire up the actual WebAssembly proxy
-                endpoints.MapGet("/ws-proxy", async (context) =>
-                {
-                    if (!context.WebSockets.IsWebSocketRequest)
-                    {
-                        context.Response.StatusCode = (int)HttpStatusCode.BadRequest;
-                        return;
-                    }
-
-                    var loggerFactory = context.RequestServices.GetRequiredService<ILoggerFactory>();
-                    var browserUri = new Uri(context.Request.Query["browser"]);
-                    var ideSocket = await context.WebSockets.AcceptWebSocketAsync();
-                    await new MonoProxy(loggerFactory).Run(browserUri, ideSocket);
-                });
-            });
-        }
-    }
-}

+ 1 - 0
src/Components/WebAssembly/Sdk/src/targets/BlazorWasm.web.config

@@ -9,6 +9,7 @@
       <remove fileExtension=".wasm" />
       <remove fileExtension=".woff" />
       <remove fileExtension=".woff2" />
+      <mimeMap fileExtension=".blat" mimeType="application/octet-stream" />
       <mimeMap fileExtension=".dll" mimeType="application/octet-stream" />
       <mimeMap fileExtension=".dat" mimeType="application/octet-stream" />
       <mimeMap fileExtension=".json" mimeType="application/json" />

+ 14 - 5
src/Components/WebAssembly/Server/src/DebugProxyLauncher.cs

@@ -10,7 +10,9 @@ using System.Reflection;
 using System.Text.RegularExpressions;
 using System.Threading;
 using System.Threading.Tasks;
+using System.Web;
 using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Http;
 using Microsoft.Extensions.CommandLineUtils;
 using Microsoft.Extensions.DependencyInjection;
 
@@ -24,20 +26,20 @@ namespace Microsoft.AspNetCore.Builder
         private static readonly Regex NowListeningRegex = new Regex(@"^\s*Now listening on: (?<url>.*)$", RegexOptions.None, TimeSpan.FromSeconds(10));
         private static readonly Regex ApplicationStartedRegex = new Regex(@"^\s*Application started\. Press Ctrl\+C to shut down\.$", RegexOptions.None, TimeSpan.FromSeconds(10));
 
-        public static Task<string> EnsureLaunchedAndGetUrl(IServiceProvider serviceProvider)
+        public static Task<string> EnsureLaunchedAndGetUrl(IServiceProvider serviceProvider, string devToolsHost)
         {
             lock (LaunchLock)
             {
                 if (LaunchedDebugProxyUrl == null)
                 {
-                    LaunchedDebugProxyUrl = LaunchAndGetUrl(serviceProvider);
+                    LaunchedDebugProxyUrl = LaunchAndGetUrl(serviceProvider, devToolsHost);
                 }
 
                 return LaunchedDebugProxyUrl;
             }
         }
 
-        private static async Task<string> LaunchAndGetUrl(IServiceProvider serviceProvider)
+        private static async Task<string> LaunchAndGetUrl(IServiceProvider serviceProvider, string devToolsHost)
         {
             var tcs = new TaskCompletionSource<string>();
 
@@ -45,10 +47,11 @@ namespace Microsoft.AspNetCore.Builder
             var executablePath = LocateDebugProxyExecutable(environment);
             var muxerPath = DotNetMuxer.MuxerPathOrDefault();
             var ownerPid = Process.GetCurrentProcess().Id;
+
             var processStartInfo = new ProcessStartInfo
             {
                 FileName = muxerPath,
-                Arguments = $"exec \"{executablePath}\" --owner-pid {ownerPid}",
+                Arguments = $"exec \"{executablePath}\" --owner-pid {ownerPid} --DevToolsUrl {devToolsHost}",
                 UseShellExecute = false,
                 RedirectStandardOutput = true,
             };
@@ -87,7 +90,7 @@ namespace Microsoft.AspNetCore.Builder
             var debugProxyPath = Path.Combine(
                 Path.GetDirectoryName(assembly.Location),
                 "BlazorDebugProxy",
-                "Microsoft.AspNetCore.Components.WebAssembly.DebugProxy.dll");
+                "BrowserDebugHost.dll");
 
             if (!File.Exists(debugProxyPath))
             {
@@ -114,6 +117,12 @@ namespace Microsoft.AspNetCore.Builder
 
             void OnOutputDataReceived(object sender, DataReceivedEventArgs eventArgs)
             {
+                if (String.IsNullOrEmpty(eventArgs.Data))
+                {
+                    taskCompletionSource.TrySetException(new InvalidOperationException(
+                            "No output has been recevied from the application."));
+                }
+
                 if (ApplicationStartedRegex.IsMatch(eventArgs.Data))
                 {
                     aspNetProcess.OutputDataReceived -= OnOutputDataReceived;

+ 3 - 25
src/Components/WebAssembly/Server/src/Microsoft.AspNetCore.Components.WebAssembly.Server.csproj

@@ -12,6 +12,7 @@
 
   <ItemGroup>
     <Reference Include="Microsoft.AspNetCore.StaticFiles" />
+    <Reference Include="Microsoft.NETCore.BrowserDebugHost.Transport" GeneratePathProperty="true" />
   </ItemGroup>
 
   <ItemGroup>
@@ -22,38 +23,15 @@
     <Compile Include="$(ComponentsSharedSourceRoot)\src\CacheHeaderSettings.cs" Link="Shared\CacheHeaderSettings.cs" />
     <Compile Include="$(SharedSourceRoot)\CommandLineUtils\Utilities\DotNetMuxer.cs" Link="Shared\DotNetMuxer.cs" />
 
-    <!-- Ensure debug proxy is built first, but don't create an actual reference, since we don't want its transitive dependencies. -->
-    <ProjectReference
-      Include="..\..\DebugProxy\src\Microsoft.AspNetCore.Components.WebAssembly.DebugProxy.csproj"
-      ReferenceOutputAssembly="false" />
-
     <Content Include="build\**" Pack="true" PackagePath="build\%(RecursiveDir)%(FileName)%(Extension)" />
   </ItemGroup>
 
   <!-- Emit debug proxy binaries to output directory. This lets us launch it as a separate process while keeping the build output self-contained.  -->
   <Target Name="IncludeDebugProxyBinariesAsContent" BeforeTargets="AssignTargetPaths">
     <ItemGroup>
-      <DebugProxyBinaries Include="$(ArtifactsBinDir)Microsoft.AspNetCore.Components.WebAssembly.DebugProxy\$(Configuration)\$(DefaultNetCoreTargetFramework)\**" />
-
-      <!--
-        For when we're building a package, we use Pack and PackagePath to bundle the debug proxy binaries into 'tools'.
-        Then we have a custom build target that converts these items into content files in consuming projects. We *don't*
-        use PackageCopyToOutput because that creates entries that show up in Solution Explorer in consuming projects.
-
-        For when we're consuming this from source in this repo, we use Link and CopyToOutputDirectory to produce the
-        same effect without having the custom build target.
-      -->
-      <Content
-        Include="@(DebugProxyBinaries)"
-        Pack="true"
-        PackagePath="tools\BlazorDebugProxy\%(RecursiveDir)%(FileName)%(Extension)"
-        Link="BlazorDebugProxy\%(RecursiveDir)%(FileName)%(Extension)"
-        CopyToOutputDirectory="PreserveNewest" />
+      <DebugProxyBinaries Include="$(PkgMicrosoft_NETCore_BrowserDebugHost_Transport)\tools\$(DefaultNetCoreTargetFramework)\**" />
+      <Content Include="@(DebugProxyBinaries)" Pack="true" PackagePath="tools\BlazorDebugProxy\%(RecursiveDir)%(FileName)%(Extension)" Link="BlazorDebugProxy\%(RecursiveDir)%(FileName)%(Extension)" CopyToOutputDirectory="PreserveNewest" />
     </ItemGroup>
-
-    <Error
-      Text="Debugger proxy files were not found in $(ArtifactsBinDir)Microsoft.AspNetCore.Components.WebAssembly.DebugProxy\$(Configuration)\$(DefaultNetCoreTargetFramework)"
-      Condition="'@(DebugProxyBinaries->Count())' == '0'" />
   </Target>
 
 </Project>

+ 14 - 12
src/Components/WebAssembly/DebugProxy/src/TargetPickerUi.cs → src/Components/WebAssembly/Server/src/TargetPickerUi.cs

@@ -12,7 +12,7 @@ using System.Text.Json;
 using System.Threading.Tasks;
 using Microsoft.AspNetCore.Http;
 
-namespace Microsoft.AspNetCore.Components.WebAssembly.DebugProxy
+namespace Microsoft.AspNetCore.Components.WebAssembly.Server
 {
     public class TargetPickerUi
     {
@@ -23,11 +23,13 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.DebugProxy
             IgnoreNullValues = true
         };
 
-        private readonly DebugProxyOptions _options;
+        private string _browserHost;
+        private string _debugProxyUrl;
 
-        public TargetPickerUi(DebugProxyOptions options)
+        public TargetPickerUi(string debugProxyUrl, string devToolsHost)
         {
-            _options = options ?? throw new ArgumentNullException(nameof(options));
+            _debugProxyUrl = debugProxyUrl;
+            _browserHost = devToolsHost;
         }
 
         public async Task Display(HttpContext context)
@@ -37,7 +39,7 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.DebugProxy
             var request = context.Request;
             var targetApplicationUrl = request.Query["url"];
 
-            var debuggerTabsListUrl = $"{_options.BrowserHost}/json";
+            var debuggerTabsListUrl = $"{_browserHost}/json";
             IEnumerable<BrowserTab> availableTabs;
 
             try
@@ -134,17 +136,17 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.DebugProxy
 
         private string GetDevToolsUrlWithProxy(HttpRequest request, BrowserTab tabToDebug)
         {
-            var underlyingV8Endpoint = tabToDebug.WebSocketDebuggerUrl;
-            var proxyEndpoint = GetProxyEndpoint(request, underlyingV8Endpoint);
-            var devToolsUrlAbsolute = new Uri(_options.BrowserHost + tabToDebug.DevtoolsFrontendUrl);
-            var devToolsUrlWithProxy = $"{devToolsUrlAbsolute.Scheme}://{devToolsUrlAbsolute.Authority}{devToolsUrlAbsolute.AbsolutePath}?{proxyEndpoint.Scheme}={proxyEndpoint.Authority}{proxyEndpoint.PathAndQuery}";
+            var underlyingV8Endpoint = new Uri(tabToDebug.WebSocketDebuggerUrl);
+            var proxyEndpoint = new Uri(_debugProxyUrl);
+            var devToolsUrlAbsolute = new Uri(_browserHost + tabToDebug.DevtoolsFrontendUrl);
+            var devToolsUrlWithProxy = $"{devToolsUrlAbsolute.Scheme}://{devToolsUrlAbsolute.Authority}{devToolsUrlAbsolute.AbsolutePath}?{underlyingV8Endpoint.Scheme}={proxyEndpoint.Authority}{underlyingV8Endpoint.PathAndQuery}";
             return devToolsUrlWithProxy;
         }
 
         private string GetLaunchChromeInstructions(string targetApplicationUrl)
         {
             var profilePath = Path.Combine(Path.GetTempPath(), "blazor-chrome-debug");
-            var debuggerPort = new Uri(_options.BrowserHost).Port;
+            var debuggerPort = new Uri(_browserHost).Port;
 
             if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
             {
@@ -170,7 +172,7 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.DebugProxy
         private string GetLaunchEdgeInstructions(string targetApplicationUrl)
         {
             var profilePath = Path.Combine(Path.GetTempPath(), "blazor-edge-debug");
-            var debuggerPort = new Uri(_options.BrowserHost).Port;
+            var debuggerPort = new Uri(_browserHost).Port;
 
             if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
             {
@@ -209,7 +211,7 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.DebugProxy
         private async Task<IEnumerable<BrowserTab>> GetOpenedBrowserTabs()
         {
             using var httpClient = new HttpClient { Timeout = TimeSpan.FromSeconds(5) };
-            var jsonResponse = await httpClient.GetStringAsync($"{_options.BrowserHost}/json");
+            var jsonResponse = await httpClient.GetStringAsync($"{_browserHost}/json");
             return JsonSerializer.Deserialize<BrowserTab[]>(jsonResponse, JsonOptions);
         }
 

+ 18 - 4
src/Components/WebAssembly/Server/src/WebAssemblyNetDebugProxyAppBuilderExtensions.cs

@@ -1,7 +1,10 @@
 // Copyright (c) .NET Foundation. All rights reserved.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
+using System;
 using System.Net;
+using System.Web;
+using Microsoft.AspNetCore.Components.WebAssembly.Server;
 
 namespace Microsoft.AspNetCore.Builder
 {
@@ -20,20 +23,31 @@ namespace Microsoft.AspNetCore.Builder
             {
                 app.Use(async (context, next) =>
                 {
-                    var debugProxyBaseUrl = await DebugProxyLauncher.EnsureLaunchedAndGetUrl(context.RequestServices);
+                    var queryParams = HttpUtility.ParseQueryString(context.Request.QueryString.Value);
+                    var browserParam = queryParams.Get("browser");
+                    Uri browserUrl = null;
+                    var devToolsHost = "http://localhost:9222";
+                    if (browserParam != null)
+                    {
+                        browserUrl = new Uri(browserParam);
+                        devToolsHost = $"http://{browserUrl.Host}:{browserUrl.Port}";
+                    }
+
+                    var debugProxyBaseUrl = await DebugProxyLauncher.EnsureLaunchedAndGetUrl(context.RequestServices, devToolsHost);
                     var requestPath = context.Request.Path.ToString();
                     if (requestPath == string.Empty)
                     {
                         requestPath = "/";
                     }
 
-                    // Although we could redirect for every URL we see here, we filter the allowed set
-                    // to ensure this doesn't get misused as some kind of more general redirector
                     switch (requestPath)
                     {
                         case "/":
+                            var targetPickerUi = new TargetPickerUi(debugProxyBaseUrl, devToolsHost);
+                            await targetPickerUi.Display(context);
+                            break;
                         case "/ws-proxy":
-                            context.Response.Redirect($"{debugProxyBaseUrl}{requestPath}{context.Request.QueryString}");
+                            context.Response.Redirect($"{debugProxyBaseUrl}{browserUrl.PathAndQuery}");
                             break;
                         default:
                             context.Response.StatusCode = (int)HttpStatusCode.NotFound;

+ 8 - 4
src/Components/WebAssembly/WebAssembly/src/Microsoft.AspNetCore.Components.WebAssembly.csproj

@@ -1,4 +1,4 @@
-<Project Sdk="Microsoft.NET.Sdk">
+<Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
     <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
@@ -15,9 +15,13 @@
     <Reference Include="Microsoft.Extensions.Logging" />
     <Reference Include="Microsoft.JSInterop.WebAssembly" />
 
-    <ProjectReference Include="..\..\..\Web.JS\Microsoft.AspNetCore.Components.Web.JS.npmproj" ReferenceOutputAssemblies="false" SkipGetTargetFrameworkProperties="true" UndefineProperties="TargetFramework" Private="false" Condition="'$(BuildNodeJS)' != 'false' and '$(BuildingInsideVisualStudio)' != 'true'" />
-
-    <SuppressBaselineReference Include="Microsoft.AspNetCore.Components.WebAssembly.HttpHandler" />
+    <ProjectReference
+      Include="..\..\..\Web.JS\Microsoft.AspNetCore.Components.Web.JS.npmproj"
+      ReferenceOutputAssemblies="false"
+      SkipGetTargetFrameworkProperties="true"
+      UndefineProperties="TargetFramework"
+      Private="false"
+      Condition="'$(BuildNodeJS)' != 'false' and '$(BuildingInsideVisualStudio)' != 'true'" />
   </ItemGroup>
 
   <ItemGroup>

+ 1 - 1
src/Configuration.KeyPerFile/src/Microsoft.Extensions.Configuration.KeyPerFile.csproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <Description>Configuration provider that uses files in a directory for Microsoft.Extensions.Configuration.</Description>
-    <TargetFrameworks>netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
+    <TargetFrameworks>$(DefaultNetFxTargetFramework);netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <IsAspNetCoreApp>true</IsAspNetCoreApp>
     <GenerateDocumentationFile>true</GenerateDocumentationFile>

+ 1 - 1
src/Configuration.KeyPerFile/test/Microsoft.Extensions.Configuration.KeyPerFile.Tests.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFrameworks>$(DefaultNetCoreTargetFramework);net472</TargetFrameworks>
+    <TargetFrameworks>$(DefaultNetCoreTargetFramework);$(DefaultNetFxTargetFramework)</TargetFrameworks>
   </PropertyGroup>
 
   <ItemGroup>

+ 1 - 1
src/DataProtection/Abstractions/src/Microsoft.AspNetCore.DataProtection.Abstractions.csproj

@@ -5,7 +5,7 @@
 Commonly used types:
 Microsoft.AspNetCore.DataProtection.IDataProtectionProvider
 Microsoft.AspNetCore.DataProtection.IDataProtector</Description>
-    <TargetFrameworks>netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
+    <TargetFrameworks>$(DefaultNetFxTargetFramework);netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <IsAspNetCoreApp>true</IsAspNetCoreApp>
     <GenerateDocumentationFile>true</GenerateDocumentationFile>
     <PackageTags>aspnetcore;dataprotection</PackageTags>

+ 1 - 1
src/DataProtection/Abstractions/test/Microsoft.AspNetCore.DataProtection.Abstractions.Tests.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
+    <TargetFrameworks>$(DefaultNetFxTargetFramework);$(DefaultNetCoreTargetFramework)</TargetFrameworks>
   </PropertyGroup>
 
   <ItemGroup>

+ 1 - 1
src/DataProtection/Cryptography.Internal/src/Microsoft.AspNetCore.Cryptography.Internal.csproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <Description>Infrastructure for ASP.NET Core cryptographic packages. Applications and libraries should not reference this package directly.</Description>
-    <TargetFrameworks>netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
+    <TargetFrameworks>$(DefaultNetFxTargetFramework);netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <IsAspNetCoreApp>true</IsAspNetCoreApp>
     <NoWarn>$(NoWarn);CS1591</NoWarn>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>

+ 1 - 1
src/DataProtection/Cryptography.Internal/test/Microsoft.AspNetCore.Cryptography.Internal.Tests.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
+    <TargetFrameworks>$(DefaultNetFxTargetFramework);$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
 

+ 1 - 1
src/DataProtection/Cryptography.KeyDerivation/src/Microsoft.AspNetCore.Cryptography.KeyDerivation.csproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <Description>ASP.NET Core utilities for key derivation.</Description>
-    <TargetFrameworks>netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
+    <TargetFrameworks>$(DefaultNetFxTargetFramework);netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <IsAspNetCoreApp>true</IsAspNetCoreApp>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <GenerateDocumentationFile>true</GenerateDocumentationFile>

+ 1 - 1
src/DataProtection/Cryptography.KeyDerivation/src/PBKDF2/Pbkdf2Util.cs

@@ -27,7 +27,7 @@ namespace Microsoft.AspNetCore.Cryptography.KeyDerivation.PBKDF2
             }
             else
             {
-#if NETSTANDARD2_0
+#if NETSTANDARD2_0 || NET461
                 return new ManagedPbkdf2Provider();
 #elif NETCOREAPP
                 // fastest implementation on .NET Core for Linux/macOS.

+ 1 - 1
src/DataProtection/Cryptography.KeyDerivation/test/Microsoft.AspNetCore.Cryptography.KeyDerivation.Tests.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
+    <TargetFrameworks>$(DefaultNetFxTargetFramework);$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
 

+ 19 - 0
src/DataProtection/Cryptography.KeyDerivation/test/Pbkdf2Tests.cs

@@ -37,7 +37,13 @@ namespace Microsoft.AspNetCore.Cryptography.KeyDerivation
             }
 
             // Act & assert
+#if NET461
+            TestProvider<ManagedPbkdf2Provider>(password, salt, prf, iterationCount, numBytesRequested, expectedValueAsBase64);
+#elif NETCOREAPP
             TestProvider<NetCorePbkdf2Provider>(password, salt, prf, iterationCount, numBytesRequested, expectedValueAsBase64);
+#else
+#error Update target frameworks
+#endif
         }
 
         [Fact]
@@ -47,7 +53,13 @@ namespace Microsoft.AspNetCore.Cryptography.KeyDerivation
             byte[] salt = Encoding.UTF8.GetBytes("salt");
             const string expectedDerivedKeyBase64 = "Sc+V/c3fiZq5Z5qH3iavAiojTsW97FAp2eBNmCQAwCNzA8hfhFFYyQLIMK65qPnBFHOHXQPwAxNQNhaEAH9hzfiaNBSRJpF9V4rpl02d5ZpI6cZbsQFF7TJW7XJzQVpYoPDgJlg0xVmYLhn1E9qMtUVUuXsBjOOdd7K1M+ZI00c=";
 
+#if NET461
+            RunTest_WithLongPassword_Impl<ManagedPbkdf2Provider>(salt, expectedDerivedKeyBase64);
+#elif NETCOREAPP
             RunTest_WithLongPassword_Impl<NetCorePbkdf2Provider>(salt, expectedDerivedKeyBase64);
+#else
+#error Update target frameworks
+#endif
         }
 
         [Fact]
@@ -55,7 +67,14 @@ namespace Microsoft.AspNetCore.Cryptography.KeyDerivation
         {
             // salt longer than 8 bytes
             var salt = Encoding.UTF8.GetBytes("abcdefghijkl");
+
+#if NET461
+            RunTest_WithLongPassword_Impl<ManagedPbkdf2Provider>(salt, "NGJtFzYUaaSxu+3ZsMeZO5d/qPJDUYW4caLkFlaY0cLSYdh1PN4+nHUVp4pUUubJWu3UeXNMnHKNDfnn8GMfnDVrAGTv1lldszsvUJ0JQ6p4+daQEYBc//Tj/ejuB3luwW0IinyE7U/ViOQKbfi5pCZFMQ0FFx9I+eXRlyT+I74=");
+#elif NETCOREAPP
             RunTest_WithLongPassword_Impl<NetCorePbkdf2Provider>(salt, "NGJtFzYUaaSxu+3ZsMeZO5d/qPJDUYW4caLkFlaY0cLSYdh1PN4+nHUVp4pUUubJWu3UeXNMnHKNDfnn8GMfnDVrAGTv1lldszsvUJ0JQ6p4+daQEYBc//Tj/ejuB3luwW0IinyE7U/ViOQKbfi5pCZFMQ0FFx9I+eXRlyT+I74=");
+#else
+#error Update target frameworks
+#endif
         }
 
         // The 'numBytesRequested' parameters below are chosen to exercise code paths where

+ 2 - 2
src/DataProtection/DataProtection/src/Managed/ManagedGenRandomImpl.cs

@@ -8,7 +8,7 @@ namespace Microsoft.AspNetCore.DataProtection.Managed
 {
     internal unsafe sealed class ManagedGenRandomImpl : IManagedGenRandom
     {
-#if NETSTANDARD2_0
+#if NETSTANDARD2_0 || NET461
         private static readonly RandomNumberGenerator _rng = RandomNumberGenerator.Create();
 #endif
         public static readonly ManagedGenRandomImpl Instance = new ManagedGenRandomImpl();
@@ -20,7 +20,7 @@ namespace Microsoft.AspNetCore.DataProtection.Managed
         public byte[] GenRandom(int numBytes)
         {
             var bytes = new byte[numBytes];
-#if NETSTANDARD2_0
+#if NETSTANDARD2_0 || NET461
             _rng.GetBytes(bytes);
 #else
             RandomNumberGenerator.Fill(bytes);

+ 5 - 2
src/DataProtection/DataProtection/src/Microsoft.AspNetCore.DataProtection.csproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <Description>ASP.NET Core logic to protect and unprotect data, similar to DPAPI.</Description>
-    <TargetFrameworks>netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
+    <TargetFrameworks>$(DefaultNetFxTargetFramework);netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <IsAspNetCoreApp>true</IsAspNetCoreApp>
     <NoWarn>$(NoWarn);CS1591</NoWarn>
@@ -29,7 +29,10 @@
 
   <ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
     <Reference Include="System.Security.Principal.Windows" />
-    <SuppressBaselineReference Include="Microsoft.AspNetCore.Hosting.Abstractions" />
+  </ItemGroup>
+
+  <ItemGroup Condition="'$(TargetFramework)' == '$(DefaultNetFxTargetFramework)'">
+    <Reference Include="System.Runtime.InteropServices.RuntimeInformation" />
   </ItemGroup>
 
 </Project>

+ 1 - 1
src/DataProtection/Extensions/src/Microsoft.AspNetCore.DataProtection.Extensions.csproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <Description>Additional APIs for ASP.NET Core data protection.</Description>
-    <TargetFrameworks>netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
+    <TargetFrameworks>$(DefaultNetFxTargetFramework);netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <IsAspNetCoreApp>true</IsAspNetCoreApp>
     <GenerateDocumentationFile>true</GenerateDocumentationFile>

+ 1 - 1
src/DataProtection/Extensions/test/Microsoft.AspNetCore.DataProtection.Extensions.Tests.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
+    <TargetFrameworks>$(DefaultNetFxTargetFramework);$(DefaultNetCoreTargetFramework)</TargetFrameworks>
   </PropertyGroup>
 
   <ItemGroup>

+ 1 - 1
src/DataProtection/StackExchangeRedis/src/Microsoft.AspNetCore.DataProtection.StackExchangeRedis.csproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <Description>Support for storing data protection keys in Redis.</Description>
-    <TargetFramework>netstandard2.0</TargetFramework>
+    <TargetFrameworks>$(DefaultNetFxTargetFramework);netstandard2.0</TargetFrameworks>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <GenerateDocumentationFile>true</GenerateDocumentationFile>
     <PackageTags>aspnetcore;dataprotection;redis</PackageTags>

+ 1 - 1
src/DataProtection/StackExchangeRedis/test/Microsoft.AspNetCore.DataProtection.StackExchangeRedis.Tests.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
+    <TargetFrameworks>$(DefaultNetFxTargetFramework);$(DefaultNetCoreTargetFramework)</TargetFrameworks>
   </PropertyGroup>
 
   <ItemGroup>

+ 1 - 1
src/Features/JsonPatch/src/Microsoft.AspNetCore.JsonPatch.csproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <Description>ASP.NET Core support for JSON PATCH.</Description>
-    <TargetFramework>netstandard2.0</TargetFramework>
+    <TargetFrameworks>$(DefaultNetFxTargetFramework);netstandard2.0</TargetFrameworks>
     <NoWarn>$(NoWarn);CS1591</NoWarn>
     <GenerateDocumentationFile>true</GenerateDocumentationFile>
     <PackageTags>aspnetcore;json;jsonpatch</PackageTags>

+ 1 - 1
src/Features/JsonPatch/test/Microsoft.AspNetCore.JsonPatch.Tests.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFrameworks>$(DefaultNetCoreTargetFramework)</TargetFrameworks>
+    <TargetFrameworks>$(DefaultNetFxTargetFramework);$(DefaultNetCoreTargetFramework)</TargetFrameworks>
   </PropertyGroup>
 
   <ItemGroup>

+ 1 - 1
src/FileProviders/Embedded/src/Microsoft.Extensions.FileProviders.Embedded.csproj

@@ -3,7 +3,7 @@
   <PropertyGroup>
     <RootNamespace>Microsoft.Extensions.FileProviders</RootNamespace>
     <Description>File provider for files in embedded resources for Microsoft.Extensions.FileProviders.</Description>
-    <TargetFrameworks>netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
+    <TargetFrameworks>$(DefaultNetFxTargetFramework);netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <NuspecFile>$(MSBuildProjectName).multitarget.nuspec</NuspecFile>
     <TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <NuspecFile Condition="'$(DotNetBuildFromSource)' == 'true'">$(MSBuildProjectName).netcoreapp.nuspec</NuspecFile>

+ 1 - 1
src/FileProviders/Embedded/test/Microsoft.Extensions.FileProviders.Embedded.Tests.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFrameworks>$(DefaultNetCoreTargetFramework);net472</TargetFrameworks>
+    <TargetFrameworks>$(DefaultNetCoreTargetFramework);$(DefaultNetFxTargetFramework)</TargetFrameworks>
   </PropertyGroup>
 
   <ItemGroup>

+ 1 - 1
src/HealthChecks/Abstractions/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions.csproj

@@ -7,7 +7,7 @@ Commonly Used Types
 Microsoft.Extensions.Diagnostics.HealthChecks.IHealthCheck
     </Description>
     <RootNamespace>Microsoft.Extensions.Diagnostics.HealthChecks</RootNamespace>
-    <TargetFrameworks>netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
+    <TargetFrameworks>$(DefaultNetFxTargetFramework);netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <NoWarn>$(NoWarn);CS1591</NoWarn>
     <GenerateDocumentationFile>true</GenerateDocumentationFile>

+ 1 - 1
src/HealthChecks/HealthChecks/src/Microsoft.Extensions.Diagnostics.HealthChecks.csproj

@@ -6,7 +6,7 @@ Commonly Used Types:
 Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckService
 Microsoft.Extensions.Diagnostics.HealthChecks.IHealthChecksBuilder
     </Description>
-    <TargetFrameworks>netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
+    <TargetFrameworks>$(DefaultNetFxTargetFramework);netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <NoWarn>$(NoWarn);CS1591</NoWarn>
     <GenerateDocumentationFile>true</GenerateDocumentationFile>

+ 1 - 1
src/HealthChecks/HealthChecks/test/Microsoft.Extensions.Diagnostics.HealthChecks.Tests.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFrameworks>$(DefaultNetCoreTargetFramework);net472</TargetFrameworks>
+    <TargetFrameworks>$(DefaultNetCoreTargetFramework);$(DefaultNetFxTargetFramework)</TargetFrameworks>
     <RootNamespace>Microsoft.Extensions.Diagnostics.HealthChecks</RootNamespace>
     <Nullable>enable</Nullable>
   </PropertyGroup>

+ 5 - 0
src/Hosting/TestHost/src/Microsoft.AspNetCore.TestHost.csproj

@@ -13,4 +13,9 @@
     <Reference Include="Microsoft.Extensions.HostFactoryResolver.Sources" />
   </ItemGroup>
 
+  <ItemGroup Condition=" '$(AspNetCoreMajorMinorVersion)' == '5.0' ">
+    <!-- Dependency (now in shared Fx) was removed in 5.0. Suppression can be removed after 5.0 RTM is released. -->
+    <SuppressBaselineReference Include="System.IO.Pipelines" />
+  </ItemGroup>
+
 </Project>

+ 10 - 2
src/Http/Http.Features/src/Microsoft.AspNetCore.Http.Features.csproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <Description>ASP.NET Core HTTP feature interface definitions.</Description>
-    <TargetFrameworks>netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
+    <TargetFrameworks>$(DefaultNetFxTargetFramework);netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <IsAspNetCoreApp>true</IsAspNetCoreApp>
     <NoWarn>$(NoWarn);CS1591</NoWarn>
@@ -14,7 +14,15 @@
 
   <ItemGroup>
     <Reference Include="Microsoft.Extensions.Primitives" />
-    <Reference Include="System.IO.Pipelines" Condition="'$(TargetFramework)' == 'netstandard2.0'" />
+  </ItemGroup>
+
+  <ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == '$(DefaultNetFxTargetFramework)'">
+    <Reference Include="System.IO.Pipelines" />
+  </ItemGroup>
+
+  <ItemGroup Condition=" '$(AspNetCoreMajorMinorVersion)' == '5.0' AND '$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' ">
+    <!-- Dependency (now in shared Fx) was removed in 5.0. Suppression can be removed after 5.0 RTM is released. -->
+    <SuppressBaselineReference Include="System.IO.Pipelines" />
   </ItemGroup>
 
 </Project>

+ 1 - 1
src/Http/Http.Features/test/Microsoft.AspNetCore.Http.Features.Tests.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
+    <TargetFrameworks>$(DefaultNetFxTargetFramework);$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <Nullable>enable</Nullable>
   </PropertyGroup>
 

+ 1 - 1
src/Http/Metadata/src/Microsoft.AspNetCore.Metadata.csproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <Description>ASP.NET Core metadata.</Description>
-    <TargetFrameworks>netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
+    <TargetFrameworks>$(DefaultNetFxTargetFramework);netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <IsAspNetCoreApp>true</IsAspNetCoreApp>
     <NoWarn>$(NoWarn);CS1591</NoWarn>
     <GenerateDocumentationFile>true</GenerateDocumentationFile>

+ 4 - 2
src/Identity/Extensions.Core/src/Microsoft.Extensions.Identity.Core.csproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <Description>ASP.NET Core Identity is the membership system for building ASP.NET Core web applications, including membership, login, and user data. ASP.NET Core Identity allows you to add login features to your application and makes it easy to customize data about the logged in user.</Description>
-    <TargetFrameworks>netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
+    <TargetFrameworks>$(DefaultNetFxTargetFramework);netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <IsAspNetCoreApp>true</IsAspNetCoreApp>
     <GenerateDocumentationFile>true</GenerateDocumentationFile>
@@ -13,8 +13,10 @@
     <Reference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" />
     <Reference Include="Microsoft.Extensions.Logging" />
     <Reference Include="Microsoft.Extensions.Options" />
+  </ItemGroup>
 
-    <Reference Include="System.ComponentModel.Annotations" Condition="'$(TargetFramework)' == 'netstandard2.0'"/>
+  <ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == '$(DefaultNetFxTargetFramework)'">
+    <Reference Include="System.ComponentModel.Annotations" />
   </ItemGroup>
 
 </Project>

+ 3 - 3
src/Identity/Extensions.Core/src/PasswordHasher.cs

@@ -65,7 +65,7 @@ namespace Microsoft.AspNetCore.Identity
             _rng = options.Rng;
         }
 
-#if NETSTANDARD2_0
+#if NETSTANDARD2_0 || NET461
         // Compares two byte arrays for equality. The method is specifically written so that the loop is not optimized.
         [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
         private static bool ByteArraysEqual(byte[] a, byte[] b)
@@ -244,7 +244,7 @@ namespace Microsoft.AspNetCore.Identity
 
             // Hash the incoming password and verify it
             byte[] actualSubkey = KeyDerivation.Pbkdf2(password, salt, Pbkdf2Prf, Pbkdf2IterCount, Pbkdf2SubkeyLength);
-#if NETSTANDARD2_0
+#if NETSTANDARD2_0 || NET461
             return ByteArraysEqual(actualSubkey, expectedSubkey);
 #elif NETCOREAPP
             return CryptographicOperations.FixedTimeEquals(actualSubkey, expectedSubkey);
@@ -283,7 +283,7 @@ namespace Microsoft.AspNetCore.Identity
 
                 // Hash the incoming password and verify it
                 byte[] actualSubkey = KeyDerivation.Pbkdf2(password, salt, prf, iterCount, subkeyLength);
-#if NETSTANDARD2_0
+#if NETSTANDARD2_0 || NET461
                 return ByteArraysEqual(actualSubkey, expectedSubkey);
 #elif NETCOREAPP
                 return CryptographicOperations.FixedTimeEquals(actualSubkey, expectedSubkey);

+ 3 - 3
src/Identity/Extensions.Core/src/Rfc6238AuthenticationService.cs

@@ -13,7 +13,7 @@ namespace Microsoft.AspNetCore.Identity
     {
         private static readonly TimeSpan _timestep = TimeSpan.FromMinutes(3);
         private static readonly Encoding _encoding = new UTF8Encoding(false, true);
-#if NETSTANDARD2_0
+#if NETSTANDARD2_0 || NET461
         private static readonly DateTime _unixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
         private static readonly RandomNumberGenerator _rng = RandomNumberGenerator.Create();
 #endif
@@ -22,7 +22,7 @@ namespace Microsoft.AspNetCore.Identity
         public static byte[] GenerateRandomKey()
         {
             byte[] bytes = new byte[20];
-#if NETSTANDARD2_0
+#if NETSTANDARD2_0 || NET461
             _rng.GetBytes(bytes);
 #else
             RandomNumberGenerator.Fill(bytes);
@@ -68,7 +68,7 @@ namespace Microsoft.AspNetCore.Identity
         // More info: https://tools.ietf.org/html/rfc6238#section-4
         private static ulong GetCurrentTimeStepNumber()
         {
-#if NETSTANDARD2_0
+#if NETSTANDARD2_0 || NET461
             var delta = DateTime.UtcNow - _unixEpoch;
 #else
             var delta = DateTimeOffset.UtcNow - DateTimeOffset.UnixEpoch;

+ 2 - 2
src/Identity/Extensions.Core/src/UserManager.cs

@@ -43,7 +43,7 @@ namespace Microsoft.AspNetCore.Identity
 
         private TimeSpan _defaultLockout = TimeSpan.Zero;
         private bool _disposed;
-#if NETSTANDARD2_0
+#if NETSTANDARD2_0 || NET461
         private static readonly RandomNumberGenerator _rng = RandomNumberGenerator.Create();
 #endif
         private IServiceProvider _services;
@@ -2430,7 +2430,7 @@ namespace Microsoft.AspNetCore.Identity
         private static string NewSecurityStamp()
         {
             byte[] bytes = new byte[20];
-#if NETSTANDARD2_0
+#if NETSTANDARD2_0 || NET461
             _rng.GetBytes(bytes);
 #else
             RandomNumberGenerator.Fill(bytes);

+ 1 - 2
src/Identity/Extensions.Stores/src/Microsoft.Extensions.Identity.Stores.csproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <Description>ASP.NET Core Identity is the membership system for building ASP.NET Core web applications, including membership, login, and user data. ASP.NET Core Identity allows you to add login features to your application and makes it easy to customize data about the logged in user.</Description>
-    <TargetFrameworks>netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
+    <TargetFrameworks>$(DefaultNetFxTargetFramework);netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <IsAspNetCoreApp>true</IsAspNetCoreApp>
     <GenerateDocumentationFile>true</GenerateDocumentationFile>
@@ -13,7 +13,6 @@
     <Reference Include="Microsoft.Extensions.Caching.Abstractions" />
     <Reference Include="Microsoft.Extensions.Logging" />
     <Reference Include="Microsoft.Extensions.Identity.Core" />
-    <SuppressBaselineReference Include="System.ComponentModel.Annotations" />
   </ItemGroup>
 
 </Project>

+ 0 - 4
src/Identity/Specification.Tests/src/Microsoft.AspNetCore.Identity.Specification.Tests.csproj

@@ -20,8 +20,4 @@
     <Reference Include="xunit.analyzers" PrivateAssets="All" />
   </ItemGroup>
 
-  <ItemGroup>
-    <!-- Removing nonexistent package -->
-    <SuppressBaselineReference Include="Microsoft.AspNetCore.Testing" />
-  </ItemGroup>
 </Project>

+ 5 - 0
src/Identity/UI/src/Microsoft.AspNetCore.Identity.UI.csproj

@@ -42,6 +42,11 @@
     <Reference Include="Microsoft.Extensions.Identity.Stores" />
   </ItemGroup>
 
+  <ItemGroup Condition=" '$(AspNetCoreMajorMinorVersion)' == '5.0' ">
+    <!-- This dependency was removed in 5.0. The suppression can be removed after 5.0 RTM is released. -->
+    <SuppressBaselineReference Include="Newtonsoft.Json" />
+  </ItemGroup>
+
   <ItemGroup>
     <UIFrameworkVersionMoniker Include="V4" />
   </ItemGroup>

+ 1 - 1
src/Localization/Abstractions/src/Microsoft.Extensions.Localization.Abstractions.csproj

@@ -6,7 +6,7 @@
 Commonly used types:
 Microsoft.Extensions.Localization.IStringLocalizer
 Microsoft.Extensions.Localization.IStringLocalizer&lt;T&gt;</Description>
-    <TargetFrameworks>netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
+    <TargetFrameworks>$(DefaultNetFxTargetFramework);netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <NoWarn>$(NoWarn);CS1591</NoWarn>
     <GenerateDocumentationFile>true</GenerateDocumentationFile>

+ 1 - 1
src/Localization/Localization/src/Microsoft.Extensions.Localization.csproj

@@ -3,7 +3,7 @@
   <PropertyGroup>
     <Product>Microsoft .NET Extensions</Product>
     <Description>Application localization services and default implementation based on ResourceManager to load localized assembly resources.</Description>
-    <TargetFrameworks>netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
+    <TargetFrameworks>$(DefaultNetFxTargetFramework);netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <NoWarn>$(NoWarn);CS1591</NoWarn>
     <GenerateDocumentationFile>true</GenerateDocumentationFile>

+ 1 - 1
src/Localization/Localization/test/Microsoft.Extensions.Localization.RootNamespace.Tests/Microsoft.Extensions.Localization.RootNamespace.Tests.csproj

@@ -1,6 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
-    <TargetFrameworks>$(DefaultNetCoreTargetFramework);net472</TargetFrameworks>
+    <TargetFrameworks>$(DefaultNetCoreTargetFramework);$(DefaultNetFxTargetFramework)</TargetFrameworks>
     <RootNamespace>LocalizationTest.Abc</RootNamespace>
     <Nullable>enable</Nullable>
   </PropertyGroup>

+ 1 - 1
src/Localization/Localization/test/Microsoft.Extensions.Localization.Tests/Microsoft.Extensions.Localization.Tests.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFrameworks>$(DefaultNetCoreTargetFramework);net472</TargetFrameworks>
+    <TargetFrameworks>$(DefaultNetCoreTargetFramework);$(DefaultNetFxTargetFramework)</TargetFrameworks>
     <Nullable>enable</Nullable>
   </PropertyGroup>
 

+ 5 - 1
src/Logging.AzureAppServices/src/Microsoft.Extensions.Logging.AzureAppServices.csproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <Description>Logger implementation to support Azure App Services 'Diagnostics logs' and 'Log stream' features.</Description>
-    <TargetFramework>netstandard2.0</TargetFramework>
+    <TargetFrameworks>$(DefaultNetFxTargetFramework);netstandard2.0</TargetFrameworks>
     <NoWarn>$(NoWarn);CS1591</NoWarn>
     <IsShipping>true</IsShipping>
   </PropertyGroup>
@@ -20,4 +20,8 @@
     <Reference Include="System.ValueTuple" />
   </ItemGroup>
 
+  <ItemGroup Condition="'$(TargetFramework)' == '$(DefaultNetFxTargetFramework)'">
+    <Reference Include="System.Net.Http" />
+  </ItemGroup>
+
 </Project>

+ 1 - 1
src/Logging.AzureAppServices/test/Microsoft.Extensions.Logging.AzureAppServices.Tests.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFrameworks>$(DefaultNetCoreTargetFramework);net472</TargetFrameworks>
+    <TargetFrameworks>$(DefaultNetCoreTargetFramework);$(DefaultNetFxTargetFramework)</TargetFrameworks>
   </PropertyGroup>
 
   <ItemGroup>

+ 0 - 340
src/Middleware/NodeServices/README.md

@@ -1,340 +0,0 @@
-# Microsoft.AspNetCore.NodeServices
-
-This NuGet package provides a fast and robust way to invoke Node.js code from a .NET application (typically ASP.NET Core web apps). You can use this whenever you want to use Node/NPM-supplied functionality at runtime in ASP.NET. For example,
-
- * Executing arbitrary JavaScript
- * Runtime integration with JavaScript build or packaging tools, e.g., transpiling code via Babel
- * Using of NPM modules for image resizing, audio compression, language recognition, etc.
- * Calling third-party services that supply Node-based APIs but don't yet ship native .NET ones
-
-It is the underlying mechanism supporting the following packages:
-
- * [`Microsoft.AspNetCore.SpaServices`](/src/Middleware/SpaServices/) - builds on NodeServices, adding functionality commonly used in Single Page Applications, such as server-side prerendering, webpack middleware, and integration between server-side and client-side routing.
-
-### Requirements
-
-* [Node.js](https://nodejs.org/en/)
-  * To test this is installed and can be found, run `node -v` on a command line
-  * Note: If you're deploying to an Azure web site, you don't need to do anything here - Node is already installed and available in the server environments
-* [.NET](https://dot.net)
-  * For .NET Core (e.g., ASP.NET Core apps), you need at least 1.0 RC2
-  * For .NET Framework, you need at least version 4.5.1.
-
-### Installation
-
-For .NET Core apps:
-
- * Add `Microsoft.AspNetCore.NodeServices` to the dependencies list in your `project.json` file
- * Run `dotnet restore` (or if you use Visual Studio, just wait a moment - it will restore dependencies automatically)
-
-For .NET Framework apps:
-
- * `nuget install Microsoft.AspNetCore.NodeServices`
-
-### Do you just want to build an ASP.NET Core app with Angular / React / Knockout / etc.?
-
-In that case, you don't need to use NodeServices directly (or install it manually). You can either:
-
-* **Recommended:** Use the `aspnetcore-spa` Yeoman generator to get a ready-to-go starting point using your choice of client-side framework. [Instructions here.](http://blog.stevensanderson.com/2016/05/02/angular2-react-knockout-apps-on-aspnet-core/)
-* Or set up your ASP.NET Core and client-side Angular/React/KO/etc. app manually, and then use the [`Microsoft.AspNetCore.SpaServices`](/src/Middleware/SpaServices/) package to add features like server-side prerendering or Webpack middleware. But really, at least try using the `aspnetcore-spa` generator first.
-
-# Simple usage example
-
-## For ASP.NET Core apps
-
-.NET Core has a built-in dependency injection (DI) system. NodeServices is designed to work with this, so you don't have to manage the creation or disposal of instances.
-
-Enable NodeServices in your application by first adding the following to your `ConfigureServices` method in `Startup.cs`:
-
-```csharp
-public void ConfigureServices(IServiceCollection services)
-{
-    // ... all your existing configuration is here ...
-
-    // Enable Node Services
-    services.AddNodeServices();
-}
-```
-
-Now you can receive an instance of `NodeServices` as an action method parameter to any MVC action, and then use it to make calls into Node.js code, e.g.:
-
-```csharp
-public async Task<IActionResult> MyAction([FromServices] INodeServices nodeServices)
-{
-    var result = await nodeServices.InvokeAsync<int>("./addNumbers", 1, 2);
-    return Content("1 + 2 = " + result);
-}
-```
-
-Of course, you also need to supply the Node.js code you want to invoke. Create a file called `addNumbers.js` at the root of your ASP.NET Core application, and add the following code:
-
-```javascript
-module.exports = function (callback, first, second) {
-    var result = first + second;
-    callback(/* error */ null, result);
-};
-```
-
-As you can see, the exported JavaScript function will receive the arguments you pass from .NET (as long as they are JSON-serializable), along with a Node-style callback you can use to send back a result or error when you are ready.
-
-When the `InvokeAsync<T>` method receives the result back from Node, the result will be JSON-deserialized to whatever generic type you specified when calling `InvokeAsync<T>` (e.g., above, that type is `int`). If `InvokeAsync<T>` receives an error from your Node code, it will throw an exception describing that error.
-
-If you want to put `addNumber.js` inside a subfolder rather than the root of your app, then also amend the path in the `_nodeServices.Invoke` call to match that path.
-
-## For non-ASP.NET apps
-
-In other types of .NET Core app, where you don't have ASP.NET supplying an `IServiceCollection` to you, you'll need to instantiate your own DI container. For example, add a reference to the .NET package `Microsoft.Extensions.DependencyInjection`, and then you can construct an `IServiceCollection`, then register NodeServices as usual:
-
-```csharp
-var services = new ServiceCollection();
-services.AddNodeServices(options => {
-    // Set any properties that you want on 'options' here
-});
-```
-
-Now you can ask it to supply the shared `INodeServices` instance:
-
-```csharp
-var serviceProvider = services.BuildServiceProvider();
-var nodeServices = serviceProvider.GetRequiredService<INodeServices>();
-```
-
-Or, if you want to obtain a separate (non-shared) `INodeServices` instance:
-
-```csharp
-var options = new NodeServicesOptions(serviceProvider) { /* Assign/override any other options here */ };
-var nodeServices = NodeServicesFactory.CreateNodeServices(options);
-```
-
-Besides this, the usage is the same as described for ASP.NET above, so you can now call `nodeServices.InvokeAsync<T>(...)` etc.
-
-You can dispose the `nodeServices` object whenever you are done with it (and it will shut down the associated Node.js instance), but because these instances are expensive to create, you should whenever possible retain and reuse instances. Don't dispose the shared instance returned from `serviceProvider.GetRequiredService` (except perhaps if you know your application is shutting down, although .NET's finalizers will dispose it anyway if the shutdown is graceful).
-
-NodeServices instances are thread-safe - you can call `InvokeAsync<T>` simultaneously from multiple threads. Also, they are smart enough to detect if the associated Node instance has died and will automatically start a new Node instance if needed.
-
-# API Reference
-
-### AddNodeServices
-
-**Signatures:**
-
-```csharp
-AddNodeServices()
-AddNodeServices(Action<NodeServicesOptions> setupAction)
-```
-
-This is an extension method on `IServiceCollection`. It registers NodeServices with ASP.NET Core's DI system. Typically you should call this from the `ConfigureServices` method in your `Startup.cs` file.
-
-To access this extension method, you'll need to add the following namespace import to the top of your file, if it isn't already there:
-
-```csharp
-using Microsoft.Extensions.DependencyInjection;
-```
-
-**Examples**
-
-Using default options:
-
-```csharp
-services.AddNodeServices();
-```
-
-Or, specifying options:
-
-```csharp
-services.AddNodeServices(options =>
-{
-    options.WatchFileExtensions = new[] { ".coffee", ".sass" };
-    // ... etc. - see other properties below
-});
-```
-
-**Parameters**
-
- * `setupAction` - type: `Action<NodeServicesOptions>`
-   * Optional. If not specified, defaults will be used.
-   * Properties on `NodeServicesOptions`:
-     * `HostingModel` - an `NodeHostingModel` enum value. See: [hosting models](#hosting-models)
-     * `ProjectPath` - if specified, controls the working directory used when launching Node instances. This affects, for example, the location that `require` statements resolve relative paths against. If not specified, your application root directory is used.
-     * `WatchFileExtensions` - if specified, the launched Node instance will watch for changes to any files with these extensions, and auto-restarts when any are changed. The default array includes `.js`, `.jsx`, `.ts`, `.tsx`, `.json`, and `.html`.
-
-**Return type**: None. But once you've done this, you can get `NodeServices` instances out of ASP.NET's DI system. Typically it will be a singleton instance.
-
-### CreateNodeServices
-
-**Signature:**
-
-```csharp
-CreateNodeServices(NodeServicesOptions options)
-```
-
-Supplies a new (non-shared) instance of `NodeServices`.
-
-**Example**
-
-```csharp
-var options = new NodeServicesOptions(serviceProvider); // Obtains default options from DI config
-var nodeServices = NodeServicesFactory.CreateNodeServices(options);
-```
-
-**Parameters**
- * `options` - type: `NodeServicesOptions`.
-   * Configures the returned `NodeServices` instance.
-   * Properties:
-     * `HostingModel` - an `NodeHostingModel` enum value. See: [hosting models](#hosting-models)
-     * `ProjectPath` - if specified, controls the working directory used when launching Node instances. This affects, for example, the location that `require` statements resolve relative paths against. If not specified, your application root directory is used.
-     * `WatchFileExtensions` - if specified, the launched Node instance will watch for changes to any files with these extension, and auto-restarts when any are changed.
-
-**Return type:** `NodeServices`
-
-If you create a `NodeServices` instance this way, you can also dispose it (call `nodeServiceInstance.Dispose();`) and it will shut down the associated Node instance. But because these instances are expensive to create, you should whenever possible retain and reuse your `NodeServices` object. They are thread-safe - you can call `nodeServiceInstance.InvokeAsync<T>(...)` simultaneously from multiple threads.
-
-### InvokeAsync&lt;T&gt;
-
-**Signature:**
-
-```csharp
-InvokeAsync<T>(string moduleName, params object[] args)
-```
-
-Asynchronously calls a JavaScript function and returns the result, or throws an exception if the result was an error.
-
-**Example 1: Getting a JSON-serializable object from Node (the most common use case)**
-
-```csharp
-var result = await myNodeServicesInstance.InvokeAsync<TranspilerResult>(
-    "./Node/transpile",
-    pathOfSomeFileToBeTranspiled);
-```
-
-... where `TranspilerResult` might be defined as follows:
-
-```csharp
-public class TranspilerResult
-{
-    public string Code { get; set; }
-    public string[] Warnings { get; set; }
-}
-```
-
-... and the corresponding JavaScript module (in `Node/transpile.js`) could be implemented as follows:
-
-```javascript
-module.exports = function (callback, filePath) {
-    // Invoke some external transpiler (e.g., an NPM module) then:
-    callback(null, {
-        code: theTranspiledCodeAsAString,
-        warnings: someArrayOfStrings
-    });
-};
-```
-
-**Example 2: Getting a stream of binary data from Node**
-
-```csharp
-var imageStream = await myNodeServicesInstance.InvokeAsync<Stream>(
-    "./Node/resizeImage",
-    fullImagePath,
-    width,
-    height);
-
-// In an MVC action method, you can pipe the result to the response as follows
-return File(imageStream, someContentType);
-```
-
-... where the corresponding JavaScript module (in `Node/resizeImage.js`) could be implemented as follows:
-
-```javascript
-var sharp = require('sharp'); // A popular image manipulation package on NPM
-
-module.exports = function(result, physicalPath, maxWidth, maxHeight) {
-    // Invoke the 'sharp' NPM module, and have it pipe the resulting image data back to .NET
-    sharp(physicalPath)
-        .resize(maxWidth || null, maxHeight || null)
-        .pipe(result.stream);
-}
-```
-
-**Parameters**
-
-* `moduleName` - type: `string`
-  * The name of a JavaScript module that Node.js must be able to resolve by calling `require(moduleName)`. This can be a relative path such as `"./Some/Directory/mymodule"`. If you don't specify the `.js` filename extension, Node.js will infer it anyway.
-* `params`
-  * Any set of JSON-serializable objects you want to pass to the exported JavaScript function
-
-**Return type:** `T`, which must be:
-
- * A JSON-serializable .NET type, if your JavaScript code uses the `callback(error, result)` pattern to return an object, as in example 1 above
- * Or, the type `System.IO.Stream`, if your JavaScript code writes data to the `result.stream` object (which is a [Node `Duplex` stream](https://nodejs.org/api/stream.html#stream_class_stream_duplex)), as in example 2 above
-
-### InvokeExportAsync&lt;T&gt;
-
-**Signature**
-
-```csharp
-InvokeExportAsync<T>(string moduleName, string exportName, params object[] args)
-```
-
-This is exactly the same as `InvokeAsync<T>`, except that it also takes an `exportName` parameter. You can use this if you want your JavaScript module to export more than one function.
-
-**Example**
-
-```csharp
-var someString = await myNodeServicesInstance.InvokeExportAsync<string>(
-    "./Node/myNodeApis",
-    "getMeAString");
-
-var someStringInFrench = await myNodeServicesInstance.InvokeExportAsync<string>(
-    "./Node/myNodeApis",
-    "convertLanguage"
-    someString,
-    "fr-FR");
-```
-
-... where  the corresponding JavaScript module (in `Node/myNodeApis.js`) could be implemented as follows:
-
-```javascript
-module.exports = {
-
-    getMeAString: function (callback) {
-        callback(null, 'Here is a string');
-    },
-
-    convertLanguage: function (callback, sourceString, targetLanguage) {
-        // Implementation detail left as an exercise for the reader
-        doMachineTranslation(sourceString, targetLanguage, function(error, result) {
-            callback(error, result);
-        });
-    }
-
-};
-```
-
-**Parameters, return type, etc.** For all other details, see the docs for [`InvokeAsync<T>`](#invokeasynct)
-
-## Hosting models
-
-NodeServices has a pluggable hosting/transport mechanism, because it is an abstraction over various possible ways to invoke Node.js from .NET. This allows more high-level facilities (e.g., for Angular prerendering) to be agnostic to the details of launching Node and communicating with it - those high-level facilities can just trust that *somehow* we can invoke code in Node for them.
-
-Using this abstraction, we could run Node inside the .NET process, in a separate process on the same machine, or even on a different machine altogether. At the time of writing, all the built-in hosting mechanisms work by launching Node as a separate process on the same machine as your .NET code.
-
-**What about Edge.js?**
-
-[Edge.js](http://tjanczuk.github.io/edge/#/) hosts Node.js inside a .NET process, or vice-versa, and lets you interoperate between the two.
-
-NodeServices is not meant to compete with Edge.js. Instead, NodeServices is an abstraction over all possible ways to invoke Node from .NET. Eventually we may offer an in-process Node hosting mechanism via Edge.js, without you needing to change your higher-level code. This can be done when Edge.js supports hosting Node in cross-platform .NET Core processes ([discussion](https://github.com/tjanczuk/edge/issues/279)).
-
-**What about VroomJS?**
-
-People have asked about using [VroomJS](https://github.com/fogzot/vroomjs) as a hosting mechanism. We don't currently plan to implement that, because Vroom only supplies a V8 runtime environment, not a complete Node environment. The difference is that, with a true Node environment, *all* NPM modules and Node code will work exactly as expected, whereas in a Vroom environment, code will only work if it doesn't use any Node primitives, which rules out large portions of the NPM landscape.
-
-### Custom hosting models
-
-If you implement a custom hosting model (by implementing `INodeInstance`), then you can cause it to be used by populating `NodeInstanceFactory` on your options:
-
-```csharp
-services.AddNodeServices(options =>
-{
-    options.NodeInstanceFactory = () => new MyCustomNodeInstance();
-});
-```

+ 0 - 47
src/Middleware/NodeServices/samples/NodeServicesExamples/Controllers/HomeController.cs

@@ -1,47 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System.Threading.Tasks;
-using Microsoft.AspNetCore.Mvc;
-using Microsoft.AspNetCore.NodeServices;
-
-namespace NodeServicesExamples.Controllers
-{
-    public class HomeController : Controller
-    {
-        public IActionResult Index(int pageIndex)
-        {
-            return View();
-        }
-
-        public IActionResult ES2015Transpilation()
-        {
-            return View();
-        }
-
-#pragma warning disable 0618
-        public async Task<IActionResult> Chart([FromServices] INodeServices nodeServices)
-#pragma warning restore 0618
-        {
-            var options = new { width = 400, height = 200, showArea = true, showPoint = true, fullWidth = true };
-            var data = new
-            {
-                labels = new[] { "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" },
-                series = new[] {
-                    new[] { 1, 5, 2, 5, 4, 3 },
-                    new[] { 2, 3, 4, 8, 1, 2 },
-                    new[] { 5, 4, 3, 2, 1, 0 }
-                }
-            };
-
-            ViewData["ChartMarkup"] = await nodeServices.InvokeAsync<string>("./Node/renderChart", "line", options, data);
-
-            return View();
-        }
-
-        public IActionResult Error()
-        {
-            return View("~/Views/Shared/Error.cshtml");
-        }
-    }
-}

+ 0 - 14
src/Middleware/NodeServices/samples/NodeServicesExamples/Node/prerenderPage.js

@@ -1,14 +0,0 @@
-var createServerRenderer = require('aspnet-prerendering').createServerRenderer;
-
-module.exports = createServerRenderer(function(params) {
-    return new Promise(function (resolve, reject) {
-        var message = 'The HTML was returned by the prerendering boot function. '
-            + 'The boot function received the following params:'
-            + '<pre>' + JSON.stringify(params, null, 4) + '</pre>';
-
-        resolve({
-            html: '<h3>Hello, world!</h3>' + message,
-            globals: { sampleData: { nodeVersion: process.version } }
-        });
-    });
-});

+ 0 - 8
src/Middleware/NodeServices/samples/NodeServicesExamples/Node/renderChart.js

@@ -1,8 +0,0 @@
-var generate = require('node-chartist');
-
-module.exports = function (callback, type, options, data) {
-    generate(type, options, data).then(
-        result => callback(null, result), // Success case
-        error => callback(error)          // Error case
-    );
-};

+ 0 - 12
src/Middleware/NodeServices/samples/NodeServicesExamples/Node/transpilation.js

@@ -1,12 +0,0 @@
-var fs = require('fs');
-var babelCore = require('babel-core');
-
-module.exports = function(cb, physicalPath, requestPath) {
-    var originalContents = fs.readFileSync(physicalPath);
-    var result = babelCore.transform(originalContents, {
-        presets: ['es2015'],
-    	sourceMaps: 'inline',
-    	sourceFileName: '/sourcemapped' + requestPath
-    });
-    cb(null, result.code);
-}

+ 0 - 24
src/Middleware/NodeServices/samples/NodeServicesExamples/NodeServicesExamples.csproj

@@ -1,24 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk.Web">
-
-  <PropertyGroup>
-    <TargetFrameworks>$(DefaultNetCoreTargetFramework)</TargetFrameworks>
-    <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
-  </PropertyGroup>
-
-  <ItemGroup>
-    <Reference Include="Microsoft.AspNetCore.Mvc" />
-    <Reference Include="Microsoft.AspNetCore.Diagnostics" />
-    <Reference Include="Microsoft.AspNetCore.Hosting" />
-    <Reference Include="Microsoft.AspNetCore.NodeServices" />
-    <Reference Include="Microsoft.AspNetCore.Server.IISIntegration" />
-    <Reference Include="Microsoft.AspNetCore.Server.Kestrel" />
-    <Reference Include="Microsoft.AspNetCore.StaticFiles" />
-    <Reference Include="Microsoft.Extensions.Logging.Debug" />
-    <Reference Include="Microsoft.Extensions.Logging.Console" />
-  </ItemGroup>
-
-  <Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
-    <Exec Command="npm install" />
-  </Target>
-
-</Project>

+ 0 - 25
src/Middleware/NodeServices/samples/NodeServicesExamples/Properties/launchSettings.json

@@ -1,25 +0,0 @@
-{
-  "iisSettings": {
-    "windowsAuthentication": false,
-    "anonymousAuthentication": true,
-    "iisExpress": {
-      "applicationUrl": "http://localhost:51463/",
-      "sslPort": 0
-    }
-  },
-  "profiles": {
-    "IIS Express": {
-      "commandName": "IISExpress",
-      "launchBrowser": true,
-      "environmentVariables": {
-        "ASPNETCORE_ENVIRONMENT": "Development"
-      }
-    },
-    "dotnet cli": {
-      "commandName": "Project",
-      "environmentVariables": {
-        "ASPNETCORE_ENVIRONMENT": "Development"
-      }
-    }
-  }
-}

+ 0 - 83
src/Middleware/NodeServices/samples/NodeServicesExamples/Startup.cs

@@ -1,83 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System;
-using System.IO;
-using System.Threading.Tasks;
-using Microsoft.AspNetCore.Builder;
-using Microsoft.AspNetCore.Hosting;
-using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.NodeServices;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Hosting;
-using Microsoft.Extensions.Logging;
-
-namespace NodeServicesExamples
-{
-    public class Startup
-    {
-#pragma warning disable 0618
-        // This method gets called by the runtime. Use this method to add services to the container.
-        public void ConfigureServices(IServiceCollection services)
-        {
-            services.AddMvc();
-
-            // Enable Node Services
-            services.AddNodeServices();
-        }
-
-        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
-        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, INodeServices nodeServices)
-        {
-            app.UseDeveloperExceptionPage();
-
-            // Dynamically transpile any .js files under the '/js/' directory
-            app.Use(next => async context =>
-            {
-                var requestPath = context.Request.Path.Value;
-                if (requestPath.StartsWith("/js/") && requestPath.EndsWith(".js"))
-                {
-                    var fileInfo = env.WebRootFileProvider.GetFileInfo(requestPath);
-                    if (fileInfo.Exists)
-                    {
-                        var transpiled = await nodeServices.InvokeAsync<string>("./Node/transpilation.js", fileInfo.PhysicalPath, requestPath);
-                        await context.Response.WriteAsync(transpiled);
-                        return;
-                    }
-                }
-
-                // Not a JS file, or doesn't exist - let some other middleware handle it
-                await next.Invoke(context);
-            });
-
-            app.UseStaticFiles();
-            app.UseRouting();
-
-            app.UseEndpoints(endpoints =>
-            {
-                endpoints.MapDefaultControllerRoute();
-            });
-        }
-#pragma warning restore 0618
-
-        public static Task Main(string[] args)
-        {
-            var host = new HostBuilder()
-                .ConfigureWebHost(webHostBuilder =>
-                {
-                    webHostBuilder
-                    .ConfigureLogging(factory =>
-                    {
-                        factory.AddConsole();
-                        factory.AddDebug();
-                    })
-                    .UseContentRoot(Directory.GetCurrentDirectory())
-                    .UseIISIntegration()
-                    .UseKestrel()
-                    .UseStartup<Startup>();
-                }).Build();
-
-            return host.RunAsync();
-        }
-    }
-}

+ 0 - 12
src/Middleware/NodeServices/samples/NodeServicesExamples/Views/Home/Chart.cshtml

@@ -1,12 +0,0 @@
-<h1>Server-rendered chart</h1>
-
-<p>
-    This sample demonstrates how arbitrary NPM modules can be invoked from .NET code.
-</p>
-<p>
-    In this case, we use <code>node-chartist</code> to render the following chart on the server. The output is
-    identical to what you'd get if you used <a href='https://gionkunz.github.io/chartist-js/'>chartist.js</a>
-    on the client, except that in this example, we're not executing any client-side code at all.
-</p>
-
[email protected](ViewData["ChartMarkup"])

+ 0 - 16
src/Middleware/NodeServices/samples/NodeServicesExamples/Views/Home/ES2015Transpilation.cshtml

@@ -1,16 +0,0 @@
-<h1>ES2015 Transpilation</h1>
-
-<p>
-    This sample demonstrates a way of intercepting requests for .js files and dynamically transpiling them
-    from ES2015 code to browser-compatible ES5 code using the Babel library.
-</p>
-
-<p>
-    To see that it's working, open your browser's 'Debug' console and look for the log message. This is
-    produced by the file <a href='/js/main.js'>/js/main.js</a>, which is transpiled from ES2015 dynamically
-    when requested.
-</p>
-
-@section scripts {
-    <script src='/js/main.js'></script>
-}

+ 0 - 13
src/Middleware/NodeServices/samples/NodeServicesExamples/Views/Home/Index.cshtml

@@ -1,13 +0,0 @@
-<h1>NodeServices examples</h1>
-
-<p>
-    These examples demonstrate the direct use of the NodeServices package, independently of the usual SPA scenarios.
-    In general, NodeServices offers an efficient way to use Node-provided functionality (e.g., NPM modules) from inside
-    a .NET application.
-</p>
-
-<ul>
-    <li><a asp-action="ES2015Transpilation">ES2015 transpilation</a></li>
-    <li><a asp-action="Chart">Server-side chart rendering</a></li>
-    <li><a asp-action="Prerendering">Server-side SPA prerendering</a></li>
-</ul>

+ 0 - 21
src/Middleware/NodeServices/samples/NodeServicesExamples/Views/Home/Prerendering.cshtml

@@ -1,21 +0,0 @@
-<h1>Server-side prerendering</h1>
-
-<p>
-    This sample demonstrates how you can invoke a JavaScript module that contains
-    prerendering logic for a Single-Page Application framework.
-</p>
-<p>
-    Your prerendering boot function will receive parameters that describe the page
-    being rendered and any data supplied by the .NET code. The return value should be
-    a promise that resolves with data to be injected into the page, such as the
-    rendered HTML and any global data that should be made available to client-side code.
-</p>
-
[email protected](ViewData["PrerenderedHtml"])
-
-<script>@Html.Raw(ViewData["PrerenderedGlobals"])</script>
-
-<script>
-    // Demonstrates how client-side code can receive data from the prerendering process
-    console.log('Received Node version from prerendering logic: ' + sampleData.nodeVersion);
-</script>

+ 0 - 6
src/Middleware/NodeServices/samples/NodeServicesExamples/Views/Shared/Error.cshtml

@@ -1,6 +0,0 @@
-@{
-    ViewData["Title"] = "Error";
-}
-
-<h1 class="text-danger">Error.</h1>
-<h2 class="text-danger">An error occurred while processing your request.</h2>

+ 0 - 12
src/Middleware/NodeServices/samples/NodeServicesExamples/Views/Shared/_Layout.cshtml

@@ -1,12 +0,0 @@
-<!doctype html>
-<html>
-    <head>
-        <meta charset="utf-8" />
-        <title>NodeServices Examples</title>
-        <link rel="stylesheet" href="~/css/chartist.min.css" />
-    </head>
-    <body>
-        @RenderBody()
-        @RenderSection("scripts", required: false)
-    </body>
-</html>

+ 0 - 2
src/Middleware/NodeServices/samples/NodeServicesExamples/Views/_ViewImports.cshtml

@@ -1,2 +0,0 @@
-@using NodeServicesExamples
-@addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers"

+ 0 - 3
src/Middleware/NodeServices/samples/NodeServicesExamples/Views/_ViewStart.cshtml

@@ -1,3 +0,0 @@
-@{
-    Layout = "_Layout";
-}

+ 0 - 1
src/Middleware/NodeServices/samples/NodeServicesExamples/appsettings.json

@@ -1 +0,0 @@
-{}

+ 0 - 6
src/Middleware/NodeServices/samples/NodeServicesExamples/jsconfig.json

@@ -1,6 +0,0 @@
-{
-    "compilerOptions": {
-        "target": "ES6",
-        "module": "commonjs"
-    }
-}

+ 0 - 10
src/Middleware/NodeServices/samples/NodeServicesExamples/package.json

@@ -1,10 +0,0 @@
-{
-  "name": "nodeservicesexamples",
-  "version": "0.0.0",
-  "dependencies": {
-    "aspnet-prerendering": "^2.0.6",
-    "babel-core": "^6.7.4",
-    "babel-preset-es2015": "^6.6.0",
-    "node-chartist": "^1.0.2"
-  }
-}

File diff suppressed because it is too large
+ 0 - 0
src/Middleware/NodeServices/samples/NodeServicesExamples/wwwroot/css/chartist.min.css


BIN
src/Middleware/NodeServices/samples/NodeServicesExamples/wwwroot/favicon.ico


+ 0 - 7
src/Middleware/NodeServices/samples/NodeServicesExamples/wwwroot/js/main.js

@@ -1,7 +0,0 @@
-class Greeting {
-    getMessage() {
-        return 'Hello from the ES2015 class';
-    }
-}
-
-console.log(new Greeting().getMessage());

+ 0 - 9
src/Middleware/NodeServices/samples/NodeServicesExamples/wwwroot/web.config

@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<configuration>
-  <system.webServer>
-    <handlers>
-      <add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
-    </handlers>
-    <httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" stdoutLogEnabled="false" forwardWindowsAuthToken="false" startupTimeLimit="3600" />
-  </system.webServer>
-</configuration>

+ 0 - 30
src/Middleware/NodeServices/src/Configuration/NodeServicesFactory.cs

@@ -1,30 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System;
-
-namespace Microsoft.AspNetCore.NodeServices
-{
-    /// <summary>
-    /// Supplies INodeServices instances.
-    /// </summary>
-    [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")]
-    public static class NodeServicesFactory
-    {
-        /// <summary>
-        /// Create an <see cref="INodeServices"/> instance according to the supplied options.
-        /// </summary>
-        /// <param name="options">Options for creating the <see cref="INodeServices"/> instance.</param>
-        /// <returns>An <see cref="INodeServices"/> instance.</returns>
-        [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")]
-        public static INodeServices CreateNodeServices(NodeServicesOptions options)
-        {
-            if (options == null)
-            {
-                throw new ArgumentNullException(nameof (options));
-            }
-
-            return new NodeServicesImpl(options.NodeInstanceFactory);
-        }
-    }
-}

+ 0 - 118
src/Middleware/NodeServices/src/Configuration/NodeServicesOptions.cs

@@ -1,118 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Threading;
-using Microsoft.AspNetCore.NodeServices.HostingModels;
-using Microsoft.Extensions.Logging;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.AspNetCore.Hosting;
-using Microsoft.Extensions.Logging.Abstractions;
-using Microsoft.Extensions.Hosting;
-
-namespace Microsoft.AspNetCore.NodeServices
-{
-    /// <summary>
-    /// Describes options used to configure an <see cref="INodeServices"/> instance.
-    /// </summary>
-    [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")]
-    public class NodeServicesOptions
-    {
-        internal const string TimeoutConfigPropertyName = nameof(InvocationTimeoutMilliseconds);
-        private const int DefaultInvocationTimeoutMilliseconds = 60 * 1000;
-        private const string LogCategoryName = "Microsoft.AspNetCore.NodeServices";
-        private static readonly string[] DefaultWatchFileExtensions = { ".js", ".jsx", ".ts", ".tsx", ".json", ".html" };
-
-        /// <summary>
-        /// Creates a new instance of <see cref="NodeServicesOptions"/>.
-        /// </summary>
-        /// <param name="serviceProvider">The <see cref="IServiceProvider"/>.</param>
-        public NodeServicesOptions(IServiceProvider serviceProvider)
-        {
-            if (serviceProvider == null)
-            {
-                throw new ArgumentNullException(nameof (serviceProvider));
-            }
-
-            EnvironmentVariables = new Dictionary<string, string>();
-            InvocationTimeoutMilliseconds = DefaultInvocationTimeoutMilliseconds;
-            WatchFileExtensions = (string[])DefaultWatchFileExtensions.Clone();
-
-            var hostEnv = serviceProvider.GetService<IWebHostEnvironment>();
-            if (hostEnv != null)
-            {
-                // In an ASP.NET environment, we can use the IHostingEnvironment data to auto-populate a few
-                // things that you'd otherwise have to specify manually
-                ProjectPath = hostEnv.ContentRootPath;
-                EnvironmentVariables["NODE_ENV"] = hostEnv.IsDevelopment() ? "development" : "production"; // De-facto standard values for Node
-            }
-            else
-            {
-                ProjectPath = Directory.GetCurrentDirectory();
-            }
-
-            var applicationLifetime = serviceProvider.GetService<IHostApplicationLifetime>();
-            if (applicationLifetime != null)
-            {
-                ApplicationStoppingToken = applicationLifetime.ApplicationStopping;
-            }
-
-            // If the DI system gives us a logger, use it. Otherwise, set up a default one.
-            var loggerFactory = serviceProvider.GetService<ILoggerFactory>();
-            NodeInstanceOutputLogger = loggerFactory != null
-                ? loggerFactory.CreateLogger(LogCategoryName)
-                : NullLogger.Instance;
-            // By default, we use this package's built-in out-of-process-via-HTTP hosting/transport
-            this.UseHttpHosting();
-        }
-
-        /// <summary>
-        /// Specifies how to construct Node.js instances. An <see cref="INodeInstance"/> encapsulates all details about
-        /// how Node.js instances are launched and communicated with. A new <see cref="INodeInstance"/> will be created
-        /// automatically if the previous instance has terminated (e.g., because a source file changed).
-        /// </summary>
-        public Func<INodeInstance> NodeInstanceFactory { get; set; }
-
-        /// <summary>
-        /// If set, overrides the path to the root of your application. This path is used when locating Node.js modules relative to your project.
-        /// </summary>
-        public string ProjectPath { get; set; }
-
-        /// <summary>
-        /// If set, the Node.js instance should restart when any matching file on disk within your project changes.
-        /// </summary>
-        public string[] WatchFileExtensions { get; set; }
-
-        /// <summary>
-        /// The Node.js instance's stdout/stderr will be redirected to this <see cref="ILogger"/>.
-        /// </summary>
-        public ILogger NodeInstanceOutputLogger { get; set; }
-
-        /// <summary>
-        /// If true, the Node.js instance will accept incoming V8 debugger connections (e.g., from node-inspector).
-        /// </summary>
-        public bool LaunchWithDebugging { get; set; }
-
-        /// <summary>
-        /// If <see cref="LaunchWithDebugging"/> is true, the Node.js instance will listen for V8 debugger connections on this port.
-        /// </summary>
-        public int DebuggingPort { get; set; }
-
-        /// <summary>
-        /// If set, starts the Node.js instance with the specified environment variables.
-        /// </summary>
-        public IDictionary<string, string> EnvironmentVariables { get; set; }
-
-        /// <summary>
-        /// Specifies the maximum duration, in milliseconds, that your .NET code should wait for Node.js RPC calls to return.
-        /// </summary>
-        public int InvocationTimeoutMilliseconds { get; set; }
-
-        /// <summary>
-        /// A token that indicates when the host application is stopping.
-        /// </summary>
-        public CancellationToken ApplicationStoppingToken { get; set; }
-    }
-}

+ 0 - 47
src/Middleware/NodeServices/src/Configuration/NodeServicesServiceCollectionExtensions.cs

@@ -1,47 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System;
-using Microsoft.AspNetCore.NodeServices;
-
-namespace Microsoft.Extensions.DependencyInjection
-{
-    /// <summary>
-    /// Extension methods for setting up NodeServices in an <see cref="IServiceCollection" />.
-    /// </summary>
-    [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")]
-    public static class NodeServicesServiceCollectionExtensions
-    {
-        /// <summary>
-        /// Adds NodeServices support to the <paramref name="serviceCollection"/>.
-        /// </summary>
-        /// <param name="serviceCollection">The <see cref="IServiceCollection"/>.</param>
-        [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")]
-        public static void AddNodeServices(this IServiceCollection serviceCollection)
-            => AddNodeServices(serviceCollection, _ => {});
-
-        /// <summary>
-        /// Adds NodeServices support to the <paramref name="serviceCollection"/>.
-        /// </summary>
-        /// <param name="serviceCollection">The <see cref="IServiceCollection"/>.</param>
-        /// <param name="setupAction">A callback that will be invoked to populate the <see cref="NodeServicesOptions"/>.</param>
-        [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")]
-        public static void AddNodeServices(this IServiceCollection serviceCollection, Action<NodeServicesOptions> setupAction)
-        {
-            if (setupAction == null)
-            {
-                throw new ArgumentNullException(nameof (setupAction));
-            }
-
-            serviceCollection.AddSingleton(typeof(INodeServices), serviceProvider =>
-            {
-                // First we let NodeServicesOptions take its defaults from the IServiceProvider,
-                // then we let the developer override those options
-                var options = new NodeServicesOptions(serviceProvider);
-                setupAction(options);
-
-                return NodeServicesFactory.CreateNodeServices(options);
-            });
-        }
-    }
-}

+ 0 - 416
src/Middleware/NodeServices/src/Content/Node/entrypoint-http.js

@@ -1,416 +0,0 @@
-(function(e, a) { for(var i in a) e[i] = a[i]; }(exports, /******/ (function(modules) { // webpackBootstrap
-/******/ 	// The module cache
-/******/ 	var installedModules = {};
-/******/
-/******/ 	// The require function
-/******/ 	function __webpack_require__(moduleId) {
-/******/
-/******/ 		// Check if module is in cache
-/******/ 		if(installedModules[moduleId]) {
-/******/ 			return installedModules[moduleId].exports;
-/******/ 		}
-/******/ 		// Create a new module (and put it into the cache)
-/******/ 		var module = installedModules[moduleId] = {
-/******/ 			i: moduleId,
-/******/ 			l: false,
-/******/ 			exports: {}
-/******/ 		};
-/******/
-/******/ 		// Execute the module function
-/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
-/******/
-/******/ 		// Flag the module as loaded
-/******/ 		module.l = true;
-/******/
-/******/ 		// Return the exports of the module
-/******/ 		return module.exports;
-/******/ 	}
-/******/
-/******/
-/******/ 	// expose the modules object (__webpack_modules__)
-/******/ 	__webpack_require__.m = modules;
-/******/
-/******/ 	// expose the module cache
-/******/ 	__webpack_require__.c = installedModules;
-/******/
-/******/ 	// define getter function for harmony exports
-/******/ 	__webpack_require__.d = function(exports, name, getter) {
-/******/ 		if(!__webpack_require__.o(exports, name)) {
-/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
-/******/ 		}
-/******/ 	};
-/******/
-/******/ 	// define __esModule on exports
-/******/ 	__webpack_require__.r = function(exports) {
-/******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
-/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
-/******/ 		}
-/******/ 		Object.defineProperty(exports, '__esModule', { value: true });
-/******/ 	};
-/******/
-/******/ 	// create a fake namespace object
-/******/ 	// mode & 1: value is a module id, require it
-/******/ 	// mode & 2: merge all properties of value into the ns
-/******/ 	// mode & 4: return value when already ns object
-/******/ 	// mode & 8|1: behave like require
-/******/ 	__webpack_require__.t = function(value, mode) {
-/******/ 		if(mode & 1) value = __webpack_require__(value);
-/******/ 		if(mode & 8) return value;
-/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
-/******/ 		var ns = Object.create(null);
-/******/ 		__webpack_require__.r(ns);
-/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
-/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
-/******/ 		return ns;
-/******/ 	};
-/******/
-/******/ 	// getDefaultExport function for compatibility with non-harmony modules
-/******/ 	__webpack_require__.n = function(module) {
-/******/ 		var getter = module && module.__esModule ?
-/******/ 			function getDefault() { return module['default']; } :
-/******/ 			function getModuleExports() { return module; };
-/******/ 		__webpack_require__.d(getter, 'a', getter);
-/******/ 		return getter;
-/******/ 	};
-/******/
-/******/ 	// Object.prototype.hasOwnProperty.call
-/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
-/******/
-/******/ 	// __webpack_public_path__
-/******/ 	__webpack_require__.p = "";
-/******/
-/******/
-/******/ 	// Load entry module and return exports
-/******/ 	return __webpack_require__(__webpack_require__.s = 1);
-/******/ })
-/************************************************************************/
-/******/ ([
-/* 0 */
-/***/ (function(module, exports) {
-
-module.exports = require("path");
-
-/***/ }),
-/* 1 */
-/***/ (function(module, exports, __webpack_require__) {
-
-module.exports = __webpack_require__(2);
-
-
-/***/ }),
-/* 2 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-exports.__esModule = true;
-// Limit dependencies to core Node modules. This means the code in this file has to be very low-level and unattractive,
-// but simplifies things for the consumer of this module.
-__webpack_require__(3);
-__webpack_require__(4);
-var http = __webpack_require__(5);
-var path = __webpack_require__(0);
-var ArgsUtil_1 = __webpack_require__(6);
-var ExitWhenParentExits_1 = __webpack_require__(7);
-// Webpack doesn't support dynamic requires for files not present at compile time, so grab a direct
-// reference to Node's runtime 'require' function.
-var dynamicRequire = eval('require');
-var server = http.createServer(function (req, res) {
-    readRequestBodyAsJson(req, function (bodyJson) {
-        var hasSentResult = false;
-        var callback = function (errorValue, successValue) {
-            if (!hasSentResult) {
-                hasSentResult = true;
-                if (errorValue) {
-                    respondWithError(res, errorValue);
-                }
-                else if (typeof successValue !== 'string') {
-                    // Arbitrary object/number/etc - JSON-serialize it
-                    var successValueJson = void 0;
-                    try {
-                        successValueJson = JSON.stringify(successValue);
-                    }
-                    catch (ex) {
-                        // JSON serialization error - pass it back to .NET
-                        respondWithError(res, ex);
-                        return;
-                    }
-                    res.setHeader('Content-Type', 'application/json');
-                    res.end(successValueJson);
-                }
-                else {
-                    // String - can bypass JSON-serialization altogether
-                    res.setHeader('Content-Type', 'text/plain');
-                    res.end(successValue);
-                }
-            }
-        };
-        // Support streamed responses
-        Object.defineProperty(callback, 'stream', {
-            enumerable: true,
-            get: function () {
-                if (!hasSentResult) {
-                    hasSentResult = true;
-                    res.setHeader('Content-Type', 'application/octet-stream');
-                }
-                return res;
-            }
-        });
-        try {
-            var resolvedPath = path.resolve(process.cwd(), bodyJson.moduleName);
-            var invokedModule = dynamicRequire(resolvedPath);
-            var func = bodyJson.exportedFunctionName ? invokedModule[bodyJson.exportedFunctionName] : invokedModule;
-            if (!func) {
-                throw new Error('The module "' + resolvedPath + '" has no export named "' + bodyJson.exportedFunctionName + '"');
-            }
-            func.apply(null, [callback].concat(bodyJson.args));
-        }
-        catch (synchronousException) {
-            callback(synchronousException, null);
-        }
-    });
-});
-var parsedArgs = ArgsUtil_1.parseArgs(process.argv);
-var requestedPortOrZero = parsedArgs.port || 0; // 0 means 'let the OS decide'
-server.listen(requestedPortOrZero, 'localhost', function () {
-    var addressInfo = server.address();
-    // Signal to HttpNodeHost which loopback IP address (IPv4 or IPv6) and port it should make its HTTP connections on
-    console.log('[Microsoft.AspNetCore.NodeServices.HttpNodeHost:Listening on {' + addressInfo.address + '} port ' + addressInfo.port + '\]');
-    // Signal to the NodeServices base class that we're ready to accept invocations
-    console.log('[Microsoft.AspNetCore.NodeServices:Listening]');
-});
-ExitWhenParentExits_1.exitWhenParentExits(parseInt(parsedArgs.parentPid), /* ignoreSigint */ true);
-function readRequestBodyAsJson(request, callback) {
-    var requestBodyAsString = '';
-    request.on('data', function (chunk) { requestBodyAsString += chunk; });
-    request.on('end', function () { callback(JSON.parse(requestBodyAsString)); });
-}
-function respondWithError(res, errorValue) {
-    res.statusCode = 500;
-    res.end(JSON.stringify({
-        errorMessage: errorValue.message || errorValue,
-        errorDetails: errorValue.stack || null
-    }));
-}
-
-
-/***/ }),
-/* 3 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-exports.__esModule = true;
-var path = __webpack_require__(0);
-var startsWith = function (str, prefix) { return str.substring(0, prefix.length) === prefix; };
-var appRootDir = process.cwd();
-function patchedLStat(pathToStatLong, fsReqWrap) {
-    try {
-        // If the lstat completes without errors, we don't modify its behavior at all
-        return origLStat.apply(this, arguments);
-    }
-    catch (ex) {
-        var shouldOverrideError = startsWith(ex.message, 'EPERM') // It's a permissions error
-            && typeof appRootDirLong === 'string'
-            && startsWith(appRootDirLong, pathToStatLong) // ... for an ancestor directory
-            && ex.stack.indexOf('Object.realpathSync ') >= 0; // ... during symlink resolution
-        if (shouldOverrideError) {
-            // Fake the result to give the same result as an 'lstat' on the app root dir.
-            // This stops Node failing to load modules just because it doesn't know whether
-            // ancestor directories are symlinks or not. If there's a genuine file
-            // permissions issue, it will still surface later when Node actually
-            // tries to read the file.
-            return origLStat.call(this, appRootDir, fsReqWrap);
-        }
-        else {
-            // In any other case, preserve the original error
-            throw ex;
-        }
-    }
-}
-;
-// It's only necessary to apply this workaround on Windows
-var appRootDirLong = null;
-var origLStat = null;
-if (/^win/.test(process.platform)) {
-    try {
-        // Get the app's root dir in Node's internal "long" format (e.g., \\?\C:\dir\subdir)
-        appRootDirLong = path._makeLong(appRootDir);
-        // Actually apply the patch, being as defensive as possible
-        var bindingFs = process.binding('fs');
-        origLStat = bindingFs.lstat;
-        if (typeof origLStat === 'function') {
-            bindingFs.lstat = patchedLStat;
-        }
-    }
-    catch (ex) {
-        // If some future version of Node throws (e.g., to prevent use of process.binding()),
-        // don't apply the patch, but still let the application run.
-    }
-}
-
-
-/***/ }),
-/* 4 */
-/***/ (function(module, exports) {
-
-// When Node writes to stdout/strerr, we capture that and convert the lines into calls on the
-// active .NET ILogger. But by default, stdout/stderr don't have any way of distinguishing
-// linebreaks inside log messages from the linebreaks that delimit separate log messages,
-// so multiline strings will end up being written to the ILogger as multiple independent
-// log messages. This makes them very hard to make sense of, especially when they represent
-// something like stack traces.
-//
-// To fix this, we intercept stdout/stderr writes, and replace internal linebreaks with a
-// marker token. When .NET receives the lines, it converts the marker tokens back to regular
-// linebreaks within the logged messages.
-//
-// Note that it's better to do the interception at the stdout/stderr level, rather than at
-// the console.log/console.error (etc.) level, because this takes place after any native
-// message formatting has taken place (e.g., inserting values for % placeholders).
-var findInternalNewlinesRegex = /\n(?!$)/g;
-var encodedNewline = '__ns_newline__';
-encodeNewlinesWrittenToStream(process.stdout);
-encodeNewlinesWrittenToStream(process.stderr);
-function encodeNewlinesWrittenToStream(outputStream) {
-    var origWriteFunction = outputStream.write;
-    outputStream.write = function (value) {
-        // Only interfere with the write if it's definitely a string
-        if (typeof value === 'string') {
-            var argsClone = Array.prototype.slice.call(arguments, 0);
-            argsClone[0] = encodeNewlinesInString(value);
-            origWriteFunction.apply(this, argsClone);
-        }
-        else {
-            origWriteFunction.apply(this, arguments);
-        }
-    };
-}
-function encodeNewlinesInString(str) {
-    return str.replace(findInternalNewlinesRegex, encodedNewline);
-}
-
-
-/***/ }),
-/* 5 */
-/***/ (function(module, exports) {
-
-module.exports = require("http");
-
-/***/ }),
-/* 6 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-exports.__esModule = true;
-function parseArgs(args) {
-    // Very simplistic parsing which is sufficient for the cases needed. We don't want to bring in any external
-    // dependencies (such as an args-parsing library) to this file.
-    var result = {};
-    var currentKey = null;
-    args.forEach(function (arg) {
-        if (arg.indexOf('--') === 0) {
-            var argName = arg.substring(2);
-            result[argName] = undefined;
-            currentKey = argName;
-        }
-        else if (currentKey) {
-            result[currentKey] = arg;
-            currentKey = null;
-        }
-    });
-    return result;
-}
-exports.parseArgs = parseArgs;
-
-
-/***/ }),
-/* 7 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-/*
-In general, we want the Node child processes to be terminated as soon as the parent .NET processes exit,
-because we have no further use for them. If the .NET process shuts down gracefully, it will run its
-finalizers, one of which (in OutOfProcessNodeInstance.cs) will kill its associated Node process immediately.
-
-But if the .NET process is terminated forcefully (e.g., on Linux/OSX with 'kill -9'), then it won't have
-any opportunity to shut down its child processes, and by default they will keep running. In this case, it's
-up to the child process to detect this has happened and terminate itself.
-
-There are many possible approaches to detecting when a parent process has exited, most of which behave
-differently between Windows and Linux/OS X:
-
- - On Windows, the parent process can mark its child as being a 'job' that should auto-terminate when
-   the parent does (http://stackoverflow.com/a/4657392). Not cross-platform.
- - The child Node process can get a callback when the parent disconnects (process.on('disconnect', ...)).
-   But despite http://stackoverflow.com/a/16487966, no callback fires in any case I've tested (Windows / OS X).
- - The child Node process can get a callback when its stdin/stdout are disconnected, as described at
-   http://stackoverflow.com/a/15693934. This works well on OS X, but calling stdout.resume() on Windows
-   causes the process to terminate prematurely.
- - I don't know why, but on Windows, it's enough to invoke process.stdin.resume(). For some reason this causes
-   the child Node process to exit as soon as the parent one does, but I don't see this documented anywhere.
- - You can poll to see if the parent process, or your stdin/stdout connection to it, is gone
-   - You can directly pass a parent process PID to the child, and then have the child poll to see if it's
-     still running (e.g., using process.kill(pid, 0), which doesn't kill it but just tests whether it exists,
-     as per https://nodejs.org/api/process.html#process_process_kill_pid_signal)
-   - Or, on each poll, you can try writing to process.stdout. If the parent has died, then this will throw.
-     However I don't see this documented anywhere. It would be nice if you could just poll for whether or not
-     process.stdout is still connected (without actually writing to it) but I haven't found any property whose
-     value changes until you actually try to write to it.
-
-Of these, the only cross-platform approach that is actually documented as a valid strategy is simply polling
-to check whether the parent PID is still running. So that's what we do here.
-*/
-exports.__esModule = true;
-var pollIntervalMs = 1000;
-function exitWhenParentExits(parentPid, ignoreSigint) {
-    setInterval(function () {
-        if (!processExists(parentPid)) {
-            // Can't log anything at this point, because out stdout was connected to the parent,
-            // but the parent is gone.
-            process.exit();
-        }
-    }, pollIntervalMs);
-    if (ignoreSigint) {
-        // Pressing ctrl+c in the terminal sends a SIGINT to all processes in the foreground process tree.
-        // By default, the Node process would then exit before the .NET process, because ASP.NET implements
-        // a delayed shutdown to allow ongoing requests to complete.
-        //
-        // This is problematic, because if Node exits first, the CopyToAsync code in ConditionalProxyMiddleware
-        // will experience a read fault, and logs a huge load of errors. Fortunately, since the Node process is
-        // already set up to shut itself down if it detects the .NET process is terminated, all we have to do is
-        // ignore the SIGINT. The Node process will then terminate automatically after the .NET process does.
-        //
-        // A better solution would be to have WebpackDevMiddleware listen for SIGINT and gracefully close any
-        // ongoing EventSource connections before letting the Node process exit, independently of the .NET
-        // process exiting. However, doing this well in general is very nontrivial (see all the discussion at
-        // https://github.com/nodejs/node/issues/2642).
-        process.on('SIGINT', function () {
-            console.log('Received SIGINT. Waiting for .NET process to exit...');
-        });
-    }
-}
-exports.exitWhenParentExits = exitWhenParentExits;
-function processExists(pid) {
-    try {
-        // Sending signal 0 - on all platforms - tests whether the process exists. As long as it doesn't
-        // throw, that means it does exist.
-        process.kill(pid, 0);
-        return true;
-    }
-    catch (ex) {
-        // If the reason for the error is that we don't have permission to ask about this process,
-        // report that as a separate problem.
-        if (ex.code === 'EPERM') {
-            throw new Error("Attempted to check whether process " + pid + " was running, but got a permissions error.");
-        }
-        return false;
-    }
-}
-
-
-/***/ })
-/******/ ])));

+ 0 - 161
src/Middleware/NodeServices/src/HostingModels/HttpNodeInstance.cs

@@ -1,161 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System;
-using System.IO;
-using System.Net.Http;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Threading;
-using System.Threading.Tasks;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Serialization;
-
-namespace Microsoft.AspNetCore.NodeServices.HostingModels
-{
-    /// <summary>
-    /// A specialisation of the OutOfProcessNodeInstance base class that uses HTTP to perform RPC invocations.
-    ///
-    /// The Node child process starts an HTTP listener on an arbitrary available port (except where a nonzero
-    /// port number is specified as a constructor parameter), and signals which port was selected using the same
-    /// input/output-based mechanism that the base class uses to determine when the child process is ready to
-    /// accept RPC invocations.
-    /// </summary>
-    /// <seealso cref="Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance" />
-    [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")]
-    internal class HttpNodeInstance : OutOfProcessNodeInstance
-    {
-        private static readonly Regex EndpointMessageRegex =
-            new Regex(@"^\[Microsoft.AspNetCore.NodeServices.HttpNodeHost:Listening on {(.*?)} port (\d+)\]$");
-
-        private static readonly JsonSerializerSettings jsonSerializerSettings = new JsonSerializerSettings
-        {
-            ContractResolver = new CamelCasePropertyNamesContractResolver(),
-            TypeNameHandling = TypeNameHandling.None
-        };
-
-        private readonly HttpClient _client;
-        private bool _disposed;
-        private string _endpoint;
-
-        public HttpNodeInstance(NodeServicesOptions options, int port = 0)
-        : base(
-                EmbeddedResourceReader.Read(
-                    typeof(HttpNodeInstance),
-                    "/Content/Node/entrypoint-http.js"),
-                options.ProjectPath,
-                options.WatchFileExtensions,
-                MakeCommandLineOptions(port),
-                options.ApplicationStoppingToken,
-                options.NodeInstanceOutputLogger,
-                options.EnvironmentVariables,
-                options.InvocationTimeoutMilliseconds,
-                options.LaunchWithDebugging,
-                options.DebuggingPort)
-        {
-            _client = new HttpClient();
-            _client.Timeout = TimeSpan.FromMilliseconds(options.InvocationTimeoutMilliseconds + 1000);
-        }
-
-        private static string MakeCommandLineOptions(int port)
-        {
-            return $"--port {port}";
-        }
-
-        protected override async Task<T> InvokeExportAsync<T>(
-            NodeInvocationInfo invocationInfo, CancellationToken cancellationToken)
-        {
-            var payloadJson = JsonConvert.SerializeObject(invocationInfo, jsonSerializerSettings);
-            var payload = new StringContent(payloadJson, Encoding.UTF8, "application/json");
-            var response = await _client.PostAsync(_endpoint, payload, cancellationToken);
-
-            if (!response.IsSuccessStatusCode)
-            {
-                // Unfortunately there's no true way to cancel ReadAsStringAsync calls, hence AbandonIfCancelled
-                var responseJson = await response.Content.ReadAsStringAsync().OrThrowOnCancellation(cancellationToken);
-                var responseError = JsonConvert.DeserializeObject<RpcJsonResponse>(responseJson, jsonSerializerSettings);
-
-                throw new NodeInvocationException(responseError.ErrorMessage, responseError.ErrorDetails);
-            }
-
-            var responseContentType = response.Content.Headers.ContentType;
-            switch (responseContentType.MediaType)
-            {
-                case "text/plain":
-                    // String responses can skip JSON encoding/decoding
-                    if (typeof(T) != typeof(string))
-                    {
-                        throw new ArgumentException(
-                            "Node module responded with non-JSON string. This cannot be converted to the requested generic type: " +
-                            typeof(T).FullName);
-                    }
-
-                    var responseString = await response.Content.ReadAsStringAsync().OrThrowOnCancellation(cancellationToken);
-                    return (T)(object)responseString;
-
-                case "application/json":
-                    var responseJson = await response.Content.ReadAsStringAsync().OrThrowOnCancellation(cancellationToken);
-                    return JsonConvert.DeserializeObject<T>(responseJson, jsonSerializerSettings);
-
-                case "application/octet-stream":
-                    // Streamed responses have to be received as System.IO.Stream instances
-                    if (typeof(T) != typeof(Stream) && typeof(T) != typeof(object))
-                    {
-                        throw new ArgumentException(
-                            "Node module responded with binary stream. This cannot be converted to the requested generic type: " +
-                            typeof(T).FullName + ". Instead you must use the generic type System.IO.Stream.");
-                    }
-
-                    return (T)(object)(await response.Content.ReadAsStreamAsync().OrThrowOnCancellation(cancellationToken));
-
-                default:
-                    throw new InvalidOperationException("Unexpected response content type: " + responseContentType.MediaType);
-            }
-        }
-
-        protected override void OnOutputDataReceived(string outputData)
-        {
-            // Watch for "port selected" messages, and when observed, 
-            // store the IP (IPv4/IPv6) and port number
-            // so we can use it when making HTTP requests. The child process will always send
-            // one of these messages before it sends a "ready for connections" message.
-            var match = string.IsNullOrEmpty(_endpoint) ? EndpointMessageRegex.Match(outputData) : null;
-            if (match != null && match.Success)
-            {
-                var port = int.Parse(match.Groups[2].Captures[0].Value);
-                var resolvedIpAddress = match.Groups[1].Captures[0].Value;
-
-                //IPv6 must be wrapped with [] brackets
-                resolvedIpAddress = resolvedIpAddress == "::1" ? $"[{resolvedIpAddress}]" : resolvedIpAddress;
-                _endpoint = $"http://{resolvedIpAddress}:{port}";
-            }
-            else
-            {
-                base.OnOutputDataReceived(outputData);
-            }
-        }
-
-        protected override void Dispose(bool disposing)
-        {
-            base.Dispose(disposing);
-
-            if (!_disposed)
-            {
-                if (disposing)
-                {
-                    _client.Dispose();
-                }
-
-                _disposed = true;
-            }
-        }
-
-#pragma warning disable 649 // These properties are populated via JSON deserialization
-        private class RpcJsonResponse
-        {
-            public string ErrorMessage { get; set; }
-            public string ErrorDetails { get; set; }
-        }
-#pragma warning restore 649
-    }
-}

+ 0 - 27
src/Middleware/NodeServices/src/HostingModels/INodeInstance.cs

@@ -1,27 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace Microsoft.AspNetCore.NodeServices.HostingModels
-{
-    /// <summary>
-    /// Represents an instance of Node.js to which Remote Procedure Calls (RPC) may be sent.
-    /// </summary>
-    [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")]
-    public interface INodeInstance : IDisposable
-    {
-        /// <summary>
-        /// Asynchronously invokes code in the Node.js instance.
-        /// </summary>
-        /// <typeparam name="T">The JSON-serializable data type that the Node.js code will asynchronously return.</typeparam>
-        /// <param name="cancellationToken">A <see cref="CancellationToken"/> that can be used to cancel the invocation.</param>
-        /// <param name="moduleName">The path to the Node.js module (i.e., JavaScript file) relative to your project root that contains the code to be invoked.</param>
-        /// <param name="exportNameOrNull">If set, specifies the CommonJS export to be invoked. If not set, the module's default CommonJS export itself must be a function to be invoked.</param>
-        /// <param name="args">Any sequence of JSON-serializable arguments to be passed to the Node.js function.</param>
-        /// <returns>A <see cref="Task{TResult}"/> representing the completion of the RPC call.</returns>
-        Task<T> InvokeExportAsync<T>(CancellationToken cancellationToken, string moduleName, string exportNameOrNull, params object[] args);
-    }
-}

+ 0 - 59
src/Middleware/NodeServices/src/HostingModels/NodeInvocationException.cs

@@ -1,59 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System;
-
-namespace Microsoft.AspNetCore.NodeServices.HostingModels
-{
-    /// <summary>
-    /// Represents an exception caused by invoking Node.js code.
-    /// </summary>
-    [Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")]
-    public class NodeInvocationException : Exception
-    {
-        /// <summary>
-        /// If true, indicates that the invocation failed because the Node.js instance could not be reached. For example,
-        /// it might have already shut down or previously crashed.
-        /// </summary>
-        public bool NodeInstanceUnavailable { get; private set; }
-
-        /// <summary>
-        /// If true, indicates that even though the invocation failed because the Node.js instance could not be reached
-        /// or needs to be restarted, that Node.js instance may remain alive for a period in order to complete any
-        /// outstanding requests.
-        /// </summary>
-        public bool AllowConnectionDraining { get; private set;}
-
-        /// <summary>
-        /// Creates a new instance of <see cref="NodeInvocationException"/>.
-        /// </summary>
-        /// <param name="message">A description of the exception.</param>
-        /// <param name="details">Additional information, such as a Node.js stack trace, representing the exception.</param>
-        public NodeInvocationException(string message, string details)
-            : base(message + Environment.NewLine + details)
-        {
-        }
-
-        /// <summary>
-        /// Creates a new instance of <see cref="NodeInvocationException"/>.
-        /// </summary>
-        /// <param name="message">A description of the exception.</param>
-        /// <param name="details">Additional information, such as a Node.js stack trace, representing the exception.</param>
-        /// <param name="nodeInstanceUnavailable">Specifies a value for the <see cref="NodeInstanceUnavailable"/> flag.</param>
-        /// <param name="allowConnectionDraining">Specifies a value for the <see cref="AllowConnectionDraining"/> flag.</param>
-        public NodeInvocationException(string message, string details, bool nodeInstanceUnavailable, bool allowConnectionDraining)
-            : this(message, details)
-        {
-            // Reject a meaningless combination of flags
-            if (allowConnectionDraining && !nodeInstanceUnavailable)
-            {
-                throw new ArgumentException(
-                    $"The '${ nameof(allowConnectionDraining) }' parameter cannot be true " +
-                    $"unless the '${ nameof(nodeInstanceUnavailable) }' parameter is also true.");
-            }
-
-            NodeInstanceUnavailable = nodeInstanceUnavailable;
-            AllowConnectionDraining = allowConnectionDraining;
-        }
-    }
-}

Some files were not shown because too many files changed in this diff