Skip to content

Commit e8da458

Browse files
feat(host): 宿主用户可见文案品牌化为 CodeNet
- 安装/更新提示、下载引导、SDK 解析错误、用法与 --info 说明 - 同步更新 HostActivation / AppHost 测试中对应的字符串断言 - 保留 aka.ms 下载与信息 URL(宿主错误对话框的下载协议依赖其查询参数)
1 parent b909b9a commit e8da458

12 files changed

Lines changed: 34 additions & 34 deletions

File tree

‎src/installer/tests/AppHost.Bundle.Tests/AppLaunch.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public void FrameworkDependent_NoBundleEntryPoint()
170170
.DotNetRoot(dotnet.BinPath)
171171
.Execute()
172172
.Should().Fail()
173-
.And.HaveStdErrContaining("You must install or update .NET to run this application.")
173+
.And.HaveStdErrContaining("You must install or update CodeNet to run this application.")
174174
.And.HaveStdErrContaining("App host version:")
175175
.And.HaveStdErrContaining("apphost_version=");
176176
}

‎src/installer/tests/HostActivation.Tests/FrameworkDependentAppLaunch.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ public void AppHost_GUI_NoCustomErrorWriter_FrameworkMissing_ErrorReportedInDial
508508
command.WaitForExit()
509509
.Should().Fail()
510510
.And.HaveStdErrContaining($"Showing error dialog for application: '{Path.GetFileName(appExe)}' - error code: 0x{expectedErrorCode}")
511-
.And.HaveStdErrContaining("You must install or update .NET to run this application.")
511+
.And.HaveStdErrContaining("You must install or update CodeNet to run this application.")
512512
.And.HaveStdErrContaining("App host version:")
513513
.And.HaveStdErrContaining("apphost_version=");
514514
}

‎src/installer/tests/HostActivation.Tests/FrameworkResolution/FrameworkResolutionCommandResultExtensions.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static AndConstraint<CommandResultAssertions> ShouldHaveResolvedFramework
4848

4949
public static AndConstraint<CommandResultAssertions> DidNotFindCompatibleFrameworkVersion(this CommandResultAssertions assertion, string frameworkName, string requestedVersion)
5050
{
51-
var constraint = assertion.HaveStdErrContaining("You must install or update .NET to run this application.");
51+
var constraint = assertion.HaveStdErrContaining("You must install or update CodeNet to run this application.");
5252
if (frameworkName is not null)
5353
{
5454
constraint = constraint.And.HaveStdErrContaining($"Framework: '{frameworkName}', {(requestedVersion is null ? "" : $"version '{requestedVersion}'")}");

‎src/installer/tests/HostActivation.Tests/SDKResolutionCommandResultExtensions.cs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ internal static class SDKResolutionCommandResultExtensions
1010
{
1111
public static AndConstraint<CommandResultAssertions> FindAnySdk(this CommandResultAssertions assertion, bool shouldFindAnySdk)
1212
{
13-
string noSdkMessage = "No .NET SDKs were found";
13+
string noSdkMessage = "No CodeNet SDKs were found";
1414
return shouldFindAnySdk
1515
? assertion.NotHaveStdErrContaining(noSdkMessage)
1616
: assertion.HaveStdErrContaining(noSdkMessage)
17-
.And.HaveStdErrContaining("Download a .NET SDK:");
17+
.And.HaveStdErrContaining("Download a CodeNet SDK:");
1818
}
1919

2020
public static AndConstraint<CommandResultAssertions> NotFindCompatibleSdk(this CommandResultAssertions assertion, string globalJsonPath = null, string requestedVersion = null)
2121
{
22-
var constraint = assertion.HaveStdErrContaining("compatible .NET SDK was not found");
22+
var constraint = assertion.HaveStdErrContaining("compatible CodeNet SDK was not found");
2323

2424
if (globalJsonPath is not null)
2525
{
@@ -33,7 +33,7 @@ public static AndConstraint<CommandResultAssertions> NotFindCompatibleSdk(this C
3333

3434
if (globalJsonPath is not null && requestedVersion is not null)
3535
{
36-
constraint = constraint.And.HaveStdErrContaining($"Install the [{requestedVersion}] .NET SDK or update [{globalJsonPath}] to match an installed SDK.");
36+
constraint = constraint.And.HaveStdErrContaining($"Install the [{requestedVersion}] CodeNet SDK or update [{globalJsonPath}] to match an installed SDK.");
3737
}
3838

3939
return constraint;

‎src/native/corehost/apphost/apphost.windows.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ namespace
4242
auto eventSource = ::RegisterEventSourceW(nullptr, _X("CodeNet Runtime"));
4343
const DWORD traceErrorID = 1023; // Matches CoreCLR ERT_UnmanagedFailFast
4444
pal::string_t message;
45-
message.append(_X("Description: A .NET application failed.\n"));
45+
message.append(_X("Description: A CodeNet application failed.\n"));
4646
message.append(_X("Application: ")).append(executable_name).append(_X("\n"));
4747
message.append(_X("Path: ")).append(executable_path).append(_X("\n"));
4848
message.append(_X("Message: ")).append(g_buffered_errors).append(_X("\n"));

‎src/native/corehost/apphost/standalone/hostfxr_resolver.cpp‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace
3939
constexpr int EMBED_APP_RELATIVE_DOTNET_MAX_SIZE = EMBED_SIZE - 3; // -2 for search location + null, -1 for null terminator
4040
if (binding.size() > EMBED_APP_RELATIVE_DOTNET_MAX_SIZE)
4141
{
42-
trace::error(_X("The app-relative .NET path is longer than the max allowed length (%d)"), EMBED_APP_RELATIVE_DOTNET_MAX_SIZE);
42+
trace::error(_X("The app-relative CodeNet path is longer than the max allowed length (%d)"), EMBED_APP_RELATIVE_DOTNET_MAX_SIZE);
4343
return false;
4444
}
4545

@@ -55,18 +55,18 @@ namespace
5555
&& binding.compare(0, hi_len, &hi_part[0]) == 0
5656
&& binding.compare(hi_len, lo_len, &lo_part[0]) == 0))
5757
{
58-
trace::error(_X("The app-relative .NET path is not embedded."));
58+
trace::error(_X("The app-relative CodeNet path is not embedded."));
5959
return false;
6060
}
6161

6262
pal::string_t app_relative_dotnet;
6363
if (!pal::clr_palstring(binding.c_str(), &app_relative_dotnet))
6464
{
65-
trace::error(_X("The app-relative .NET path could not be retrieved from the executable image."));
65+
trace::error(_X("The app-relative CodeNet path could not be retrieved from the executable image."));
6666
return false;
6767
}
6868

69-
trace::info(_X("Embedded app-relative .NET path: '%s'"), app_relative_dotnet.c_str());
69+
trace::info(_X("Embedded app-relative CodeNet path: '%s'"), app_relative_dotnet.c_str());
7070
out_app_relative_dotnet = std::move(app_relative_dotnet);
7171
return true;
7272
}

‎src/native/corehost/corehost.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,15 +187,15 @@ int exe_start(const int argc, const pal::char_t* argv[])
187187
if (argc <= 1)
188188
{
189189
trace::println();
190-
trace::println(_X("Usage: dotnet [path-to-application]"));
191-
trace::println(_X("Usage: dotnet [commands]"));
190+
trace::println(_X("Usage: codenet [path-to-application]"));
191+
trace::println(_X("Usage: codenet [commands]"));
192192
trace::println();
193193
trace::println(_X("path-to-application:"));
194194
trace::println(_X(" The path to an application .dll file to execute."));
195195
trace::println();
196196
trace::println(_X("commands:"));
197197
trace::println(_X(" -h|--help Display help."));
198-
trace::println(_X(" --info Display .NET information."));
198+
trace::println(_X(" --info Display CodeNet information."));
199199
trace::println(_X(" --list-runtimes [--arch <arch>] Display the installed runtimes matching the host or specified architecture. Example architectures: arm64, x64, x86."));
200200
trace::println(_X(" --list-sdks [--arch <arch>] Display the installed SDKs matching the host or specified architecture. Example architectures: arm64, x64, x86."));
201201
return StatusCode::InvalidArgFailure;

‎src/native/corehost/fxr/command_line.cpp‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ void command_line::print_muxer_info(const pal::string_t &dotnet_root, const sdk_
354354
_X(" ") DOTNET_INFO_URL);
355355

356356
trace::println(_X("\n")
357-
_X("Download .NET:\n")
357+
_X("Download CodeNet:\n")
358358
_X(" ") DOTNET_CORE_DOWNLOAD_URL);
359359
}
360360

@@ -365,8 +365,8 @@ void command_line::print_muxer_usage(bool is_sdk_present)
365365
if (!is_sdk_present)
366366
{
367367
trace::println();
368-
trace::println(_X("Usage: dotnet [host-options] [path-to-application]"));
369-
trace::println(_X("Usage: dotnet [host-commands]"));
368+
trace::println(_X("Usage: codenet [host-options] [path-to-application]"));
369+
trace::println(_X("Usage: codenet [host-commands]"));
370370
trace::println();
371371
trace::println(_X("path-to-application:"));
372372
trace::println(_X(" The path to an application .dll file to execute."));
@@ -385,7 +385,7 @@ void command_line::print_muxer_usage(bool is_sdk_present)
385385
if (!is_sdk_present)
386386
{
387387
trace::println(_X(" -h|--help Displays this help."));
388-
trace::println(_X(" --info Display .NET information."));
388+
trace::println(_X(" --info Display CodeNet information."));
389389
}
390390

391391
trace::println(_X(" --list-runtimes [--arch <arch>] Display the installed runtimes matching the host or specified architecture. Example architectures: arm64, x64, x86."));

‎src/native/corehost/fxr/fx_muxer.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,9 +1109,9 @@ int fx_muxer_t::handle_cli(
11091109

11101110
trace::error(
11111111
_X("The command could not be loaded, possibly because:\n")
1112-
_X(" * You intended to execute a .NET application:\n")
1112+
_X(" * You intended to execute a CodeNet application:\n")
11131113
_X(" The application '%s' does not exist or is not a managed .dll or .exe.\n")
1114-
_X(" * You intended to execute a .NET SDK command:"),
1114+
_X(" * You intended to execute a CodeNet SDK command:"),
11151115
app_candidate.c_str());
11161116
resolver.print_resolution_error(host_info.dotnet_root, _X(" "));
11171117

@@ -1134,7 +1134,7 @@ int fx_muxer_t::handle_cli(
11341134
new_argv.push_back(sdk_dotnet.c_str());
11351135
new_argv.insert(new_argv.end(), argv + 1, argv + argc);
11361136

1137-
trace::verbose(_X("Using .NET SDK dll=[%s]"), sdk_dotnet.c_str());
1137+
trace::verbose(_X("Using CodeNet SDK dll=[%s]"), sdk_dotnet.c_str());
11381138

11391139
int new_argoff;
11401140
pal::string_t sdk_app_candidate;

‎src/native/corehost/fxr/sdk_resolver.cpp‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,12 @@ void sdk_resolver::print_resolution_error(const pal::string_t& dotnet_root, cons
151151
}
152152

153153
bool sdk_exists = false;
154-
const pal::char_t *no_sdk_message = _X("No .NET SDKs were found.");
154+
const pal::char_t *no_sdk_message = _X("No CodeNet SDKs were found.");
155155
if (!requested_version.is_empty())
156156
{
157157
pal::string_t requested = requested_version.as_str();
158158
trace::error(
159-
_X("%sA compatible .NET SDK was not found.\n")
159+
_X("%sA compatible CodeNet SDK was not found.\n")
160160
_X("\n")
161161
_X("Requested SDK version: %s"),
162162
main_error_prefix,
@@ -184,11 +184,11 @@ void sdk_resolver::print_resolution_error(const pal::string_t& dotnet_root, cons
184184
trace::error(_X(""));
185185
if (has_global_file)
186186
{
187-
trace::error(_X("Install the [%s] .NET SDK or update [%s] to match an installed SDK."), requested.c_str(), global_json.path.c_str());
187+
trace::error(_X("Install the [%s] CodeNet SDK or update [%s] to match an installed SDK."), requested.c_str(), global_json.path.c_str());
188188
}
189189
else
190190
{
191-
trace::error(_X("Install the [%s] .NET SDK or create a global.json file matching an installed SDK."), requested.c_str());
191+
trace::error(_X("Install the [%s] CodeNet SDK or create a global.json file matching an installed SDK."), requested.c_str());
192192
}
193193
}
194194
else
@@ -204,7 +204,7 @@ void sdk_resolver::print_resolution_error(const pal::string_t& dotnet_root, cons
204204
{
205205
trace::error(
206206
_X("\n")
207-
_X("Download a .NET SDK:\n")
207+
_X("Download a CodeNet SDK:\n")
208208
DOTNET_CORE_DOWNLOAD_URL);
209209
}
210210

0 commit comments

Comments
 (0)