Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/aspnetcore.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSafia Abdalla <safia@safia.rocks>2022-09-07 20:25:28 +0300
committerSafia Abdalla <safia@safia.rocks>2022-09-07 20:25:28 +0300
commitd01f69661926899a66f774dd6a027c6cddf0e970 (patch)
tree4dcd7df8faa52ff1ba8af7a4831815b45b08a510
parentcdc815a985806cf4e458ed2475ca7c7b085cf2d4 (diff)
Address feedback from peer reviewsafia/apidesc-fixes
-rw-r--r--src/Tools/GetDocumentInsider/src/Commands/GetDocumentCommand.cs4
-rw-r--r--src/Tools/GetDocumentInsider/src/Commands/GetDocumentCommandWorker.cs12
-rw-r--r--src/Tools/dotnet-getdocument/src/Commands/InvokeCommand.cs4
3 files changed, 10 insertions, 10 deletions
diff --git a/src/Tools/GetDocumentInsider/src/Commands/GetDocumentCommand.cs b/src/Tools/GetDocumentInsider/src/Commands/GetDocumentCommand.cs
index a6a195a30e..26ef4958c3 100644
--- a/src/Tools/GetDocumentInsider/src/Commands/GetDocumentCommand.cs
+++ b/src/Tools/GetDocumentInsider/src/Commands/GetDocumentCommand.cs
@@ -5,7 +5,7 @@ using System;
using System.IO;
using System.Linq;
using System.Reflection;
-#if NETCOREAPP2_1 || NET7_0_OR_GREATER
+#if NETCOREAPP
using System.Runtime.Loader;
#endif
using Microsoft.Extensions.CommandLineUtils;
@@ -69,7 +69,7 @@ internal sealed class GetDocumentCommand : ProjectCommandBase
}
}
-#if NETCOREAPP2_1 || NET7_0_OR_GREATER
+#if NETCOREAPP
AssemblyLoadContext.Default.Resolving += (loadContext, assemblyName) =>
{
var name = assemblyName.Name;
diff --git a/src/Tools/GetDocumentInsider/src/Commands/GetDocumentCommandWorker.cs b/src/Tools/GetDocumentInsider/src/Commands/GetDocumentCommandWorker.cs
index 13432ef196..b5f63acd84 100644
--- a/src/Tools/GetDocumentInsider/src/Commands/GetDocumentCommandWorker.cs
+++ b/src/Tools/GetDocumentInsider/src/Commands/GetDocumentCommandWorker.cs
@@ -75,7 +75,7 @@ internal sealed class GetDocumentCommandWorker
// Register a TCS to be invoked when the entrypoint (aka Program.Main)
// has finished running. For minimal APIs, this means that all app.X
// calls about the host has been built have been executed.
- var waitForStartTcs = new TaskCompletionSource<object>();
+ var waitForStartTcs = new TaskCompletionSource<object>(TaskCreationOptions.RunContinuationsAsynchronously);
void OnEntryPointExit(Exception exception)
{
// If the entry point exited, we'll try to complete the wait
@@ -104,7 +104,7 @@ internal sealed class GetDocumentCommandWorker
HostFactoryResolver.CreateWebHostBuilder,
entryPointType));
- return 4;
+ return 8;
}
try
@@ -120,10 +120,10 @@ internal sealed class GetDocumentCommandWorker
HostFactoryResolver.CreateWebHostBuilder,
entryPointType));
- return 5;
+ return 9;
}
- // Wait for th application to start to ensure that all configurations
+ // Wait for the application to start to ensure that all configurations
// on the WebApplicationBuilder have been processed.
var applicationLifetime = services.GetRequiredService<IHostApplicationLifetime>();
using (var registration = applicationLifetime.ApplicationStarted.Register(() => waitForStartTcs.TrySetResult(null)))
@@ -132,14 +132,14 @@ internal sealed class GetDocumentCommandWorker
var success = GetDocuments(services);
if (!success)
{
- return 6;
+ return 10;
}
}
}
catch (Exception ex)
{
_reporter.WriteError(ex.ToString());
- return 7;
+ return 11;
}
#else
try
diff --git a/src/Tools/dotnet-getdocument/src/Commands/InvokeCommand.cs b/src/Tools/dotnet-getdocument/src/Commands/InvokeCommand.cs
index 17d15ea0e6..5937197929 100644
--- a/src/Tools/dotnet-getdocument/src/Commands/InvokeCommand.cs
+++ b/src/Tools/dotnet-getdocument/src/Commands/InvokeCommand.cs
@@ -79,9 +79,9 @@ internal sealed class InvokeCommand : HelpCommandBase
projectName,
targetFramework.Version));
}
- else if (targetFramework.Version > new Version(7, 0))
+ else if (targetFramework.Version >= new Version(7, 0))
{
- toolsDirectory = Path.Combine(thisPath, "net7.0");
+ toolsDirectory = Path.Combine(thisPath, $"net{targetFramework.Version}");
}
else
{