Skip to content

Commit 55b0c67

Browse files
authored
[automated] Merge branch 'release/9.0.2xx' => 'main' (#43959)
2 parents d64603b + c21fab1 commit 55b0c67

File tree

79 files changed

+494
-343
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+494
-343
lines changed

NuGet.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<!-- Begin: Package sources from dotnet-aspnetcore -->
1010
<!-- End: Package sources from dotnet-aspnetcore -->
1111
<!-- Begin: Package sources from DotNet-msbuild-Trusted -->
12+
<add key="darc-pub-DotNet-msbuild-Trusted-4ae11fa" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-DotNet-msbuild-Trusted-4ae11fa8/nuget/v3/index.json" />
1213
<!-- End: Package sources from DotNet-msbuild-Trusted -->
1314
<!-- Begin: Package sources from dotnet-roslyn-analyzers -->
1415
<!-- End: Package sources from dotnet-roslyn-analyzers -->

src/BuiltInTools/dotnet-watch/HotReload/IncrementalMSBuildWorkspace.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@ public IncrementalMSBuildWorkspace(IReporter reporter)
2222
{
2323
WorkspaceFailed += (_sender, diag) =>
2424
{
25-
// Errors reported here are not fatal, an exception would be thrown for fatal issues.
26-
reporter.Verbose($"MSBuildWorkspace warning: {diag.Diagnostic}");
25+
// Report both Warning and Failure as warnings.
26+
// MSBuildProjectLoader reports Failures for cases where we can safely continue loading projects
27+
// (e.g. non-C#/VB project is ignored).
28+
// https://github.com/dotnet/roslyn/issues/75170
29+
reporter.Warn($"msbuild: {diag.Diagnostic}", "⚠");
2730
};
2831

2932
_reporter = reporter;

src/Cli/dotnet/CommandFactory/CommandSpec.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ namespace Microsoft.DotNet.CommandFactory
66
public class CommandSpec
77
{
88
public CommandSpec(
9-
string path,
10-
string args,
9+
string? path,
10+
string? args,
1111
Dictionary<string, string> environmentVariables = null)
1212
{
1313
Path = path;

src/Cli/dotnet/commands/dotnet-run/LaunchSettings/LaunchSettingsApplyResult.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace Microsoft.DotNet.Tools.Run.LaunchSettings
55
{
66
public class LaunchSettingsApplyResult
77
{
8-
public LaunchSettingsApplyResult(bool success, string failureReason, ProjectLaunchSettingsModel launchSettings = null)
8+
public LaunchSettingsApplyResult(bool success, string? failureReason, ProjectLaunchSettingsModel launchSettings = null)
99
{
1010
Success = success;
1111
FailureReason = failureReason;

src/Cli/dotnet/commands/dotnet-run/LaunchSettings/ProjectLaunchSettingsModel.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ namespace Microsoft.DotNet.Tools.Run.LaunchSettings
55
{
66
public class ProjectLaunchSettingsModel
77
{
8-
public string LaunchProfileName { get; set; }
8+
public string? LaunchProfileName { get; set; }
99

10-
public string CommandLineArgs { get; set; }
10+
public string? CommandLineArgs { get; set; }
1111

1212
public bool LaunchBrowser { get; set; }
1313

14-
public string LaunchUrl { get; set; }
14+
public string? LaunchUrl { get; set; }
1515

16-
public string ApplicationUrl { get; set; }
16+
public string? ApplicationUrl { get; set; }
1717

18-
public string DotNetRunMessages { get; set; }
18+
public string? DotNetRunMessages { get; set; }
1919

2020
public Dictionary<string, string> EnvironmentVariables { get; } = new Dictionary<string, string>(StringComparer.Ordinal);
2121
}

src/Cli/dotnet/commands/dotnet-run/LaunchSettings/ProjectLaunchSettingsProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public LaunchSettingsApplyResult TryGetLaunchSettings(string? launchProfileName,
7878
{
7979
if (TryGetStringValue(environmentVariable.Value, out var environmentVariableValue))
8080
{
81-
config.EnvironmentVariables[environmentVariable.Name] = environmentVariableValue;
81+
config.EnvironmentVariables[environmentVariable.Name] = environmentVariableValue!;
8282
}
8383
}
8484
}

src/Cli/dotnet/commands/dotnet-workload/LocalizableStrings.resx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,12 @@
169169
<data name="WorkloadManifestInstallationConfiguration" xml:space="preserve">
170170
<value>Configured to use {0} when installing new manifests.</value>
171171
</data>
172+
<data name="WorkloadSetFromGlobalJsonNotInstalled" xml:space="preserve">
173+
<value>Workload version {0}, which was specified in {1}, was not found. Run "dotnet workload restore" to install this workload version.</value>
174+
<comment>{Locked="dotnet workload restore"}</comment>
175+
</data>
176+
<data name="ShouldInstallAWorkloadSet" xml:space="preserve">
177+
<value>Workloads are configured to install and update using workload versions, but none were found. Run "dotnet workload restore" to install a workload version.</value>
178+
<comment>{Locked="dotnet workload restore"}</comment>
179+
</data>
172180
</root>

src/Cli/dotnet/commands/dotnet-workload/WorkloadCommandBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ protected bool VerifySignatures
8585
public WorkloadCommandBase(
8686
ParseResult parseResult,
8787
CliOption<VerbosityOptions> verbosityOptions = null,
88-
IReporter reporter = null,
88+
IReporter? reporter = null,
8989
string tempDirPath = null,
9090
INuGetPackageDownloader nugetPackageDownloader = null) : base(parseResult)
9191
{

src/Cli/dotnet/commands/dotnet-workload/WorkloadCommandParser.cs

Lines changed: 36 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -42,26 +42,13 @@ internal static string GetWorkloadsVersion(WorkloadInfoHelper workloadInfoHelper
4242
var versionInfo = workloadInfoHelper.ManifestProvider.GetWorkloadVersion();
4343

4444
// The explicit space here is intentional, as it's easy to miss in localization and crucial for parsing
45-
return versionInfo.Version + (versionInfo.VersionNotInstalledMessage is not null ? ' ' + Workloads.Workload.List.LocalizableStrings.WorkloadVersionNotInstalledShort : string.Empty);
45+
return versionInfo.Version + (versionInfo.IsInstalled ? string.Empty : ' ' + Workloads.Workload.List.LocalizableStrings.WorkloadVersionNotInstalledShort);
4646
}
4747

4848
internal static void ShowWorkloadsInfo(ParseResult parseResult = null, WorkloadInfoHelper workloadInfoHelper = null, IReporter reporter = null, string dotnetDir = null, bool showVersion = true)
4949
{
5050
workloadInfoHelper ??= new WorkloadInfoHelper(parseResult != null ? parseResult.HasOption(SharedOptions.InteractiveOption) : false);
5151
reporter ??= Utils.Reporter.Output;
52-
var globalJsonInformation = workloadInfoHelper.ManifestProvider.GetGlobalJsonInformation();
53-
if (globalJsonInformation?.WorkloadVersionInstalled == false)
54-
{
55-
reporter.WriteLine(string.Format(Workloads.Workload.List.LocalizableStrings.WorkloadSetFromGlobalJsonNotInstalled, globalJsonInformation.GlobalJsonVersion, globalJsonInformation.GlobalJsonPath));
56-
return;
57-
}
58-
59-
IEnumerable<WorkloadId> installedList = workloadInfoHelper.InstalledSdkWorkloadIds;
60-
InstalledWorkloadsCollection installedWorkloads = workloadInfoHelper.AddInstalledVsWorkloads(installedList);
61-
string dotnetPath = dotnetDir ?? Path.GetDirectoryName(Environment.ProcessPath);
62-
63-
64-
6552
var versionInfo = workloadInfoHelper.ManifestProvider.GetWorkloadVersion();
6653

6754
void WriteUpdateModeAndAnyError(string indent = "")
@@ -70,10 +57,13 @@ void WriteUpdateModeAndAnyError(string indent = "")
7057
var workloadSetsString = useWorkloadSets == true ? "workload sets" : "loose manifests";
7158
reporter.WriteLine(indent + string.Format(CommonStrings.WorkloadManifestInstallationConfiguration, workloadSetsString));
7259

73-
var additionalMessage = versionInfo.VersionNotInstalledMessage ?? versionInfo.UpdateModeMessage;
74-
if (additionalMessage != null)
60+
if (!versionInfo.IsInstalled)
7561
{
76-
reporter.WriteLine(indent + additionalMessage);
62+
reporter.WriteLine(indent + string.Format(CommonStrings.WorkloadSetFromGlobalJsonNotInstalled, versionInfo.Version, versionInfo.GlobalJsonPath));
63+
}
64+
else if (versionInfo.WorkloadSetsEnabledWithoutWorkloadSet)
65+
{
66+
reporter.WriteLine(indent + CommonStrings.ShouldInstallAWorkloadSet);
7767
}
7868
}
7969

@@ -85,37 +75,44 @@ void WriteUpdateModeAndAnyError(string indent = "")
8575
reporter.WriteLine();
8676
}
8777

88-
if (installedWorkloads.Count == 0)
89-
{
90-
reporter.WriteLine(CommonStrings.NoWorkloadsInstalledInfoWarning);
91-
}
92-
else
78+
if (versionInfo.IsInstalled)
9379
{
94-
var manifestInfoDict = workloadInfoHelper.WorkloadResolver.GetInstalledManifests().ToDictionary(info => info.Id, StringComparer.OrdinalIgnoreCase);
80+
IEnumerable<WorkloadId> installedList = workloadInfoHelper.InstalledSdkWorkloadIds;
81+
InstalledWorkloadsCollection installedWorkloads = workloadInfoHelper.AddInstalledVsWorkloads(installedList);
82+
string dotnetPath = dotnetDir ?? Path.GetDirectoryName(Environment.ProcessPath);
9583

96-
foreach (var workload in installedWorkloads.AsEnumerable())
84+
if (installedWorkloads.Count == 0)
9785
{
98-
var workloadManifest = workloadInfoHelper.WorkloadResolver.GetManifestFromWorkload(new WorkloadId(workload.Key));
99-
var workloadFeatureBand = manifestInfoDict[workloadManifest.Id].ManifestFeatureBand;
86+
reporter.WriteLine(CommonStrings.NoWorkloadsInstalledInfoWarning);
87+
}
88+
else
89+
{
90+
var manifestInfoDict = workloadInfoHelper.WorkloadResolver.GetInstalledManifests().ToDictionary(info => info.Id, StringComparer.OrdinalIgnoreCase);
91+
92+
foreach (var workload in installedWorkloads.AsEnumerable())
93+
{
94+
var workloadManifest = workloadInfoHelper.WorkloadResolver.GetManifestFromWorkload(new WorkloadId(workload.Key));
95+
var workloadFeatureBand = manifestInfoDict[workloadManifest.Id].ManifestFeatureBand;
10096

101-
const int align = 10;
102-
const string separator = " ";
97+
const int align = 10;
98+
const string separator = " ";
10399

104-
reporter.WriteLine($" [{workload.Key}]");
100+
reporter.WriteLine($" [{workload.Key}]");
105101

106-
reporter.Write($"{separator}{CommonStrings.WorkloadSourceColumn}:");
107-
reporter.WriteLine($" {workload.Value,align}");
102+
reporter.Write($"{separator}{CommonStrings.WorkloadSourceColumn}:");
103+
reporter.WriteLine($" {workload.Value,align}");
108104

109-
reporter.Write($"{separator}{CommonStrings.WorkloadManifestVersionColumn}:");
110-
reporter.WriteLine($" {workloadManifest.Version + '/' + workloadFeatureBand,align}");
105+
reporter.Write($"{separator}{CommonStrings.WorkloadManifestVersionColumn}:");
106+
reporter.WriteLine($" {workloadManifest.Version + '/' + workloadFeatureBand,align}");
111107

112-
reporter.Write($"{separator}{CommonStrings.WorkloadManifestPathColumn}:");
113-
reporter.WriteLine($" {workloadManifest.ManifestPath,align}");
108+
reporter.Write($"{separator}{CommonStrings.WorkloadManifestPathColumn}:");
109+
reporter.WriteLine($" {workloadManifest.ManifestPath,align}");
114110

115-
reporter.Write($"{separator}{CommonStrings.WorkloadInstallTypeColumn}:");
116-
reporter.WriteLine($" {WorkloadInstallType.GetWorkloadInstallType(new SdkFeatureBand(Utils.Product.Version), dotnetPath).ToString(),align}"
117-
);
118-
reporter.WriteLine("");
111+
reporter.Write($"{separator}{CommonStrings.WorkloadInstallTypeColumn}:");
112+
reporter.WriteLine($" {WorkloadInstallType.GetWorkloadInstallType(new SdkFeatureBand(Utils.Product.Version), dotnetPath).ToString(),align}"
113+
);
114+
reporter.WriteLine("");
115+
}
119116
}
120117
}
121118

src/Cli/dotnet/commands/dotnet-workload/clean/WorkloadCleanCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ internal class WorkloadCleanCommand : WorkloadCommandBase
1818
{
1919
private readonly bool _cleanAll;
2020

21-
private string? _dotnetPath;
21+
private string _dotnetPath;
2222
private string _userProfileDir;
2323

2424
private readonly ReleaseVersion _sdkVersion;

0 commit comments

Comments
 (0)