Skip to content

Commit 55dd1f3

Browse files
authored
Merge branch 'release/9.0.1xx' into marcpopMSFT-copydmptooutput
2 parents ff0709d + 0d56966 commit 55dd1f3

File tree

17 files changed

+221
-61
lines changed

17 files changed

+221
-61
lines changed

NuGet.config

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@
1010
<!-- Begin: Package sources from dotnet-aspnetcore -->
1111
<!-- End: Package sources from dotnet-aspnetcore -->
1212
<!-- Begin: Package sources from DotNet-msbuild-Trusted -->
13-
<add key="darc-pub-DotNet-msbuild-Trusted-1cce779" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-DotNet-msbuild-Trusted-1cce7796/nuget/v3/index.json" />
13+
<add key="darc-pub-DotNet-msbuild-Trusted-ed8c6ae" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-DotNet-msbuild-Trusted-ed8c6aec/nuget/v3/index.json" />
1414
<!-- End: Package sources from DotNet-msbuild-Trusted -->
1515
<!-- Begin: Package sources from dotnet-roslyn-analyzers -->
1616
<!-- End: Package sources from dotnet-roslyn-analyzers -->
1717
<!-- Begin: Package sources from dotnet-runtime -->
1818
<!-- End: Package sources from dotnet-runtime -->
1919
<!-- Begin: Package sources from dotnet-templating -->
2020
<add key="darc-pub-dotnet-templating-b1003b4" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-templating-b1003b44/nuget/v3/index.json" />
21+
<add key="darc-pub-dotnet-templating-b1003b4-1" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-templating-b1003b44-1/nuget/v3/index.json" />
2122
<!-- End: Package sources from dotnet-templating -->
2223
<!-- Begin: Package sources from dotnet-windowsdesktop -->
2324
<!-- End: Package sources from dotnet-windowsdesktop -->

eng/Version.Details.xml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,18 @@
7373
<Sha>763d10a1a251be35337ee736832bfde3f9200672</Sha>
7474
<SourceBuild RepoName="emsdk" ManagedOnly="true" />
7575
</Dependency>
76-
<Dependency Name="Microsoft.Build" Version="17.12.12">
76+
<Dependency Name="Microsoft.Build" Version="17.12.18">
7777
<Uri>https://github.com/dotnet/msbuild</Uri>
78-
<Sha>1cce77968bca1366760f361c837ffbc3a6af70f0</Sha>
78+
<Sha>ed8c6aec5b774cfdad4e95033910c30aa0d93391</Sha>
7979
</Dependency>
80-
<Dependency Name="Microsoft.Build.Localization" Version="17.12.12-preview-24571-01">
80+
<Dependency Name="Microsoft.Build.Localization" Version="17.12.18-preview-24610-04">
8181
<Uri>https://github.com/dotnet/msbuild</Uri>
82-
<Sha>1cce77968bca1366760f361c837ffbc3a6af70f0</Sha>
82+
<Sha>ed8c6aec5b774cfdad4e95033910c30aa0d93391</Sha>
8383
</Dependency>
8484
<!-- Intermediate is necessary for source build. -->
85-
<Dependency Name="Microsoft.SourceBuild.Intermediate.msbuild" Version="17.12.12-preview-24571-01">
85+
<Dependency Name="Microsoft.SourceBuild.Intermediate.msbuild" Version="17.12.18-preview-24610-04">
8686
<Uri>https://github.com/dotnet/msbuild</Uri>
87-
<Sha>1cce77968bca1366760f361c837ffbc3a6af70f0</Sha>
87+
<Sha>ed8c6aec5b774cfdad4e95033910c30aa0d93391</Sha>
8888
<SourceBuild RepoName="msbuild" ManagedOnly="true" />
8989
</Dependency>
9090
<Dependency Name="Microsoft.FSharp.Compiler" Version="12.9.101-beta.24602.3">
@@ -379,14 +379,14 @@
379379
<Uri>https://github.com/dotnet/test-templates</Uri>
380380
<Sha>49c9ad01f057b3c6352bbec12b117acc2224493c</Sha>
381381
</Dependency>
382-
<Dependency Name="Microsoft.DotNet.Test.ProjectTemplates.9.0" Version="1.1.0-rtm.24604.2">
382+
<Dependency Name="Microsoft.DotNet.Test.ProjectTemplates.9.0" Version="1.1.0-rtm.24605.1">
383383
<Uri>https://github.com/dotnet/test-templates</Uri>
384-
<Sha>82cef577c12adcc0cf9048d186910ae1f8f33fde</Sha>
384+
<Sha>22f4800ed2fe5dbca64c982aa15fd6838016328e</Sha>
385385
</Dependency>
386386
<!-- Intermediate is necessary for source build. -->
387-
<Dependency Name="Microsoft.SourceBuild.Intermediate.test-templates" Version="1.1.0-rtm.24604.2">
387+
<Dependency Name="Microsoft.SourceBuild.Intermediate.test-templates" Version="1.1.0-rtm.24605.1">
388388
<Uri>https://github.com/dotnet/test-templates</Uri>
389-
<Sha>82cef577c12adcc0cf9048d186910ae1f8f33fde</Sha>
389+
<Sha>22f4800ed2fe5dbca64c982aa15fd6838016328e</Sha>
390390
<SourceBuild RepoName="test-templates" ManagedOnly="true" />
391391
</Dependency>
392392
<!-- For coherency purposes, these versions should be gated by the versions of winforms and wpf routed via windowsdesktop -->
@@ -408,18 +408,18 @@
408408
<Sha>1a54480f52703fb45fac2a6b955247d33758383e</Sha>
409409
<SourceBuild RepoName="xdt" ManagedOnly="true" />
410410
</Dependency>
411-
<Dependency Name="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0-preview.24574.2">
411+
<Dependency Name="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0-preview.24605.2">
412412
<Uri>https://github.com/dotnet/roslyn-analyzers</Uri>
413-
<Sha>3d61c57c73c3dd5f1f407ef9cd3414d94bf0eaf2</Sha>
413+
<Sha>5bfaf6aea5cf9d1c924d9adc69916eac3be07880</Sha>
414414
</Dependency>
415-
<Dependency Name="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.11.0-beta1.24574.2">
415+
<Dependency Name="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.11.0-beta1.24605.2">
416416
<Uri>https://github.com/dotnet/roslyn-analyzers</Uri>
417-
<Sha>3d61c57c73c3dd5f1f407ef9cd3414d94bf0eaf2</Sha>
417+
<Sha>5bfaf6aea5cf9d1c924d9adc69916eac3be07880</Sha>
418418
</Dependency>
419419
<!-- Intermediate is necessary for source build. -->
420-
<Dependency Name="Microsoft.SourceBuild.Intermediate.roslyn-analyzers" Version="3.11.0-beta1.24574.2">
420+
<Dependency Name="Microsoft.SourceBuild.Intermediate.roslyn-analyzers" Version="3.11.0-beta1.24605.2">
421421
<Uri>https://github.com/dotnet/roslyn-analyzers</Uri>
422-
<Sha>3d61c57c73c3dd5f1f407ef9cd3414d94bf0eaf2</Sha>
422+
<Sha>5bfaf6aea5cf9d1c924d9adc69916eac3be07880</Sha>
423423
<SourceBuild RepoName="roslyn-analyzers" ManagedOnly="true" />
424424
</Dependency>
425425
<Dependency Name="System.CommandLine" Version="2.0.0-beta4.24324.3">

eng/Versions.props

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
<PropertyGroup>
8383
<!-- Dependency from https://github.com/dotnet/test-templates -->
8484
<!-- Supported versions -->
85-
<MicrosoftDotNetTestProjectTemplates90PackageVersion>1.1.0-rtm.24604.2</MicrosoftDotNetTestProjectTemplates90PackageVersion>
85+
<MicrosoftDotNetTestProjectTemplates90PackageVersion>1.1.0-rtm.24605.1</MicrosoftDotNetTestProjectTemplates90PackageVersion>
8686
</PropertyGroup>
8787
<PropertyGroup>
8888
<!-- Dependencies from https://github.com/dotnet/runtime -->
@@ -158,8 +158,8 @@
158158
</PropertyGroup>
159159
<PropertyGroup>
160160
<!-- Dependencies from https://github.com/dotnet/roslyn-analyzers -->
161-
<MicrosoftCodeAnalysisNetAnalyzersVersion>9.0.0-preview.24574.2</MicrosoftCodeAnalysisNetAnalyzersVersion>
162-
<MicrosoftCodeAnalysisPublicApiAnalyzersVersion>3.11.0-beta1.24574.2</MicrosoftCodeAnalysisPublicApiAnalyzersVersion>
161+
<MicrosoftCodeAnalysisNetAnalyzersVersion>9.0.0-preview.24605.2</MicrosoftCodeAnalysisNetAnalyzersVersion>
162+
<MicrosoftCodeAnalysisPublicApiAnalyzersVersion>3.11.0-beta1.24605.2</MicrosoftCodeAnalysisPublicApiAnalyzersVersion>
163163
</PropertyGroup>
164164
<PropertyGroup>
165165
<!-- Dependencies from https://github.com/Microsoft/msbuild -->
@@ -180,8 +180,8 @@
180180
At usage sites, either we use MicrosoftBuildMinimumVersion, or MicrosoftBuildVersion in source-only modes.
181181
182182
Additionally, set the MinimumVSVersion for the installer UI that's required for targeting NetCurrent -->
183-
<MicrosoftBuildVersion>17.12.12</MicrosoftBuildVersion>
184-
<MicrosoftBuildLocalizationVersion>17.12.12-preview-24571-01</MicrosoftBuildLocalizationVersion>
183+
<MicrosoftBuildVersion>17.12.18</MicrosoftBuildVersion>
184+
<MicrosoftBuildLocalizationVersion>17.12.18-preview-24610-04</MicrosoftBuildLocalizationVersion>
185185
<MicrosoftBuildMinimumVersion Condition="'$(DotNetBuildSourceOnly)' != 'true'">17.11.4</MicrosoftBuildMinimumVersion>
186186
<MinimumVSVersion>17.12</MinimumVSVersion>
187187
</PropertyGroup>

eng/pipelines/templates/variables/vmr-build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ variables:
1515
- name: almaLinuxContainer
1616
value: mcr.microsoft.com/dotnet-buildtools/prereqs:almalinux-8-source-build
1717
- name: alpineLatestContainer
18-
value: mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.20-withnode
18+
value: mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.21-amd64
1919
- name: alpinePreviousContainer
20-
value: mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.19-WithNode
20+
value: mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.20-withnode
2121
- name: centOSStreamContainer
2222
value: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9
2323
- name: fedoraContainer
@@ -50,9 +50,9 @@ variables:
5050
- name: almaLinuxName
5151
value: AlmaLinux8
5252
- name: alpineLatestName
53-
value: Alpine320
53+
value: Alpine321
5454
- name: alpinePreviousName
55-
value: Alpine319
55+
value: Alpine320
5656
- name: centOSStreamName
5757
value: CentOSStream9
5858
- name: fedoraName
@@ -69,9 +69,9 @@ variables:
6969
- name: linuxMuslArm64Rid
7070
value: linux-musl-arm64
7171
- name: alpineLatestX64Rid
72-
value: alpine.3.20-x64
72+
value: alpine.3.21-x64
7373
- name: alpinePreviousX64Rid
74-
value: alpine.3.19-x64
74+
value: alpine.3.20-x64
7575
- name: centOSStreamX64Rid
7676
value: centos.9-x64
7777
- name: fedoraX64Rid

src/BuiltInTools/dotnet-watch/EnvironmentVariablesBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public void SetVariable(string name, string value)
6060

6161
public void ConfigureProcess(ProcessSpec processSpec)
6262
{
63-
processSpec.Arguments = [.. GetCommandLineDirectives(), .. processSpec.Arguments];
63+
processSpec.Arguments = [.. GetCommandLineDirectives(), .. processSpec.Arguments ?? []];
6464
AddToEnvironment(processSpec.EnvironmentVariables);
6565
}
6666

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ private async ValueTask DisplayResultsAsync(WatchHotReloadService.Updates update
348348
switch (updates.Status)
349349
{
350350
case ModuleUpdateStatus.None:
351-
_reporter.Output("No hot reload changes to apply.");
351+
_reporter.Output("No C# changes to apply.");
352352
break;
353353

354354
case ModuleUpdateStatus.Ready:

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,11 @@ private async Task<bool> ReceiveApplyUpdateResult(CancellationToken cancellation
136136
var status = ArrayPool<byte>.Shared.Rent(1);
137137
try
138138
{
139-
var statusBytesRead = await _pipe.ReadAsync(status, cancellationToken);
139+
var statusBytesRead = await _pipe.ReadAsync(status, offset: 0, count: 1, cancellationToken);
140140
if (statusBytesRead != 1 || status[0] != UpdatePayload.ApplySuccessValue)
141141
{
142-
Reporter.Error($"Change failed to apply (error code: '{BitConverter.ToString(status, 0, statusBytesRead)}'). Further changes won't be applied to this process.");
142+
var message = (statusBytesRead == 0) ? "received no data" : $"received status 0x{status[0]:x2}";
143+
Reporter.Error($"Change failed to apply ({message}). Further changes won't be applied to this process.");
143144
return false;
144145
}
145146

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,17 @@ public async Task UpdateProjectConeAsync(string rootProjectPath, CancellationTok
3838

3939
var loader = new MSBuildProjectLoader(this);
4040
var projectMap = ProjectMap.Create();
41-
var projectInfos = await loader.LoadProjectInfoAsync(rootProjectPath, projectMap, progress: null, msbuildLogger: null, cancellationToken).ConfigureAwait(false);
41+
42+
ImmutableArray<ProjectInfo> projectInfos;
43+
try
44+
{
45+
projectInfos = await loader.LoadProjectInfoAsync(rootProjectPath, projectMap, progress: null, msbuildLogger: null, cancellationToken).ConfigureAwait(false);
46+
}
47+
catch (InvalidOperationException)
48+
{
49+
// TODO: workaround for https://github.com/dotnet/roslyn/issues/75956
50+
projectInfos = [];
51+
}
4252

4353
var oldProjectIdsByPath = oldSolution.Projects.ToDictionary(keySelector: static p => p.FilePath!, elementSelector: static p => p.Id);
4454

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

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Collections;
66
using System.Diagnostics;
77
using Microsoft.Build.Graph;
8+
using Microsoft.Build.Framework;
89
using Microsoft.DotNet.Watcher.Internal;
910
using Microsoft.Extensions.Tools.Internal;
1011

@@ -52,41 +53,61 @@ public async ValueTask HandleFileChangesAsync(IReadOnlyList<ChangedFile> files,
5253
}
5354
}
5455

55-
var logger = reporter.IsVerbose ? new[] { new Build.Logging.ConsoleLogger() } : null;
56+
if (!hasApplicableFiles)
57+
{
58+
return;
59+
}
60+
61+
var logger = reporter.IsVerbose ? new[] { new Build.Logging.ConsoleLogger(LoggerVerbosity.Minimal) } : null;
5662

57-
var tasks = projectsToRefresh.Select(async projectNode =>
63+
var buildTasks = projectsToRefresh.Select(projectNode => Task.Run(() =>
5864
{
59-
if (!projectNode.ProjectInstance.DeepCopy().Build(BuildTargetName, logger))
65+
try
6066
{
61-
return false;
67+
if (!projectNode.ProjectInstance.DeepCopy().Build(BuildTargetName, logger))
68+
{
69+
return null;
70+
}
6271
}
63-
64-
if (browserConnector.TryGetRefreshServer(projectNode, out var browserRefreshServer))
72+
catch (Exception e)
6573
{
66-
await HandleBrowserRefresh(browserRefreshServer, projectNode.ProjectInstance.FullPath, cancellationToken);
74+
reporter.Error($"[{projectNode.GetDisplayName()}] Target {BuildTargetName} failed to build: {e}");
75+
return null;
6776
}
6877

69-
return true;
70-
});
78+
return projectNode;
79+
}));
7180

72-
var results = await Task.WhenAll(tasks).WaitAsync(cancellationToken);
81+
var buildResults = await Task.WhenAll(buildTasks).WaitAsync(cancellationToken);
7382

74-
if (hasApplicableFiles)
83+
var browserRefreshTasks = buildResults.Where(p => p != null)!.GetTransitivelyReferencingProjects().Select(async projectNode =>
7584
{
76-
var successfulCount = results.Sum(r => r ? 1 : 0);
77-
78-
if (successfulCount == results.Length)
79-
{
80-
reporter.Output("Hot reload of scoped css succeeded.", emoji: "🔥");
81-
}
82-
else if (successfulCount > 0)
85+
if (browserConnector.TryGetRefreshServer(projectNode, out var browserRefreshServer))
8386
{
84-
reporter.Output($"Hot reload of scoped css partially succeeded: {successfulCount} project(s) out of {results.Length} were updated.", emoji: "🔥");
87+
reporter.Verbose($"[{projectNode.GetDisplayName()}] Refreshing browser.");
88+
await HandleBrowserRefresh(browserRefreshServer, projectNode.ProjectInstance.FullPath, cancellationToken);
8589
}
8690
else
8791
{
88-
reporter.Output("Hot reload of scoped css failed.", emoji: "🔥");
92+
reporter.Verbose($"[{projectNode.GetDisplayName()}] No refresh server.");
8993
}
94+
});
95+
96+
await Task.WhenAll(browserRefreshTasks).WaitAsync(cancellationToken);
97+
98+
var successfulCount = buildResults.Sum(r => r != null ? 1 : 0);
99+
100+
if (successfulCount == buildResults.Length)
101+
{
102+
reporter.Output("Hot reload of scoped css succeeded.", emoji: "🔥");
103+
}
104+
else if (successfulCount > 0)
105+
{
106+
reporter.Output($"Hot reload of scoped css partially succeeded: {successfulCount} project(s) out of {buildResults.Length} were updated.", emoji: "🔥");
107+
}
108+
else
109+
{
110+
reporter.Output("Hot reload of scoped css failed.", emoji: "🔥");
90111
}
91112
}
92113

src/BuiltInTools/dotnet-watch/HotReloadDotNetWatcher.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ public override async Task WatchAsync(CancellationToken shutdownCancellationToke
9191

9292
var rootProjectOptions = Context.RootProjectOptions;
9393
var rootProjectNode = Context.ProjectGraph.GraphRoots.Single();
94+
var rootProjectCapabilities = rootProjectNode.GetCapabilities();
9495

9596
await using var runtimeProcessLauncher = _runtimeProcessLauncherFactory?.TryCreate(rootProjectNode, projectLauncher, rootProjectOptions.BuildProperties);
9697
if (runtimeProcessLauncher != null)
@@ -211,6 +212,16 @@ public override async Task WatchAsync(CancellationToken shutdownCancellationToke
211212
await compilationHandler.Workspace.UpdateFileContentAsync(changedFiles, iterationCancellationToken);
212213
}
213214

215+
if (!rootProjectCapabilities.Contains("SupportsHotReload"))
216+
{
217+
Context.Reporter.Warn($"Project '{rootProjectNode.GetDisplayName()}' does not support Hot Reload and must be rebuilt.");
218+
219+
// file change already detected
220+
waitForFileChangeBeforeRestarting = false;
221+
iterationCancellationSource.Cancel();
222+
break;
223+
}
224+
214225
HotReloadEventSource.Log.HotReloadStart(HotReloadEventSource.StartType.Main);
215226
var stopwatch = Stopwatch.StartNew();
216227

0 commit comments

Comments
 (0)