Skip to content

Commit b71399b

Browse files
committed
Merge 10.0.2xx to main
# Conflicts: # eng/Version.Details.props # eng/Version.Details.xml # global.json # src/RazorSdk/Tool/GenerateCommand.cs
2 parents dc02694 + 1af6f70 commit b71399b

File tree

120 files changed

+796
-236
lines changed

Some content is hidden

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

120 files changed

+796
-236
lines changed

Directory.Packages.props

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="$(MicrosoftCodeAnalysisPackageVersion)" />
3838
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="$(MicrosoftCodeAnalysisPackageVersion)" />
3939
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="$(MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion)" />
40+
<PackageVersion Include="Microsoft.CodeAnalysis.ExternalAccess.HotReload" Version="$(MicrosoftCodeAnalysisExternalAccessHotReloadPackageVersion)" />
4041

4142
<!-- roslyn-sdk dependencies-->
4243
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing" Version="1.1.2" />
@@ -81,8 +82,6 @@
8182
<PackageVersion Include="Microsoft.TestPlatform.Build" Version="$(MicrosoftTestPlatformBuildPackageVersion)" />
8283
<PackageVersion Include="Microsoft.TestPlatform.CLI" Version="$(MicrosoftTestPlatformCLIPackageVersion)" />
8384
<PackageVersion Include="Microsoft.VisualStudio.Composition" Version="17.4.16" />
84-
<PackageVersion Include="Microsoft.VisualStudio.Sdk" Version="17.2.32505.173" />
85-
<PackageVersion Include="Microsoft.VSSDK.BuildTools" Version="17.11.435" />
8685
<PackageVersion Include="Microsoft.VisualStudio.Setup.Configuration.Interop" Version="$(MicrosoftVisualStudioSetupConfigurationInteropVersion)" />
8786
<PackageVersion Include="Microsoft.VisualStudio.SolutionPersistence" Version="$(MicrosoftVisualStudioSolutionPersistenceVersion)" />
8887
<PackageVersion Include="Microsoft.Web.Deployment" Version="$(WebDeploymentPackageVersion)" />

NuGet.config

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
<add key="dotnet-tools-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-transport/nuget/v3/index.json" />
3232
<add key="dotnet-libraries" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-libraries/nuget/v3/index.json" />
3333
<add key="dotnet-libraries-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-libraries-transport/nuget/v3/index.json" />
34-
<add key="vssdk" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vssdk/nuget/v3/index.json" />
35-
<add key="vssdk-archived" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vssdk-archived/nuget/v3/index.json" />
3634
<add key="vs-impl" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-impl/nuget/v3/index.json" />
3735
<!-- Used for Rich Navigation indexing task -->
3836
<add key="richnav" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-buildservices/nuget/v3/index.json" />

eng/Publishing.props

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@
4343
<Artifact Remove="@(MsiPackages)" />
4444
</ItemGroup>
4545

46+
<ItemGroup Condition="'$(PublishingWorkloadMsiInternal)' == 'true'">
47+
<Artifact Update="$(ArtifactsShippingPackagesDir)*.Msi.*.nupkg" Visibility="Internal" />
48+
</ItemGroup>
49+
4650
<Target Name="GetNonStableProductVersion">
4751
<!-- Retrieve the non-stable product version. -->
4852
<MSBuild Projects="$(RepoRoot)src\Layout\redist\redist.csproj"

eng/Signing.props

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,8 @@
8181
<FileSignInfo Include="Verify.dll" CertificateName="$(ExternalCertificateId)" />
8282
<FileSignInfo Include="Verify.DiffPlex.dll" CertificateName="$(ExternalCertificateId)" />
8383
</ItemGroup>
84-
85-
<ItemGroup>
86-
<FileSignInfo Include="StreamJsonRpc.dll" CertificateName="MicrosoftSHA2" />
8784

85+
<ItemGroup>
8886
<!-- Roslyn apphosts -->
8987
<FileSignInfo Condition="'$(TargetOS)' == 'osx'" Include="csc;vbc;VBCSCompiler" CertificateName="MacDeveloperHarden" />
9088
</ItemGroup>

eng/Versions.props

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
compiler API targeted by analyzer assemblies. This is mostly an issue on source-build as
2929
in that build mode analyzer assemblies always target the live compiler API. -->
3030
<UsingToolMicrosoftNetCompilers Condition="'$(DotNetBuildSourceOnly)' == 'true'">true</UsingToolMicrosoftNetCompilers>
31-
<UsingToolVSSDK>true</UsingToolVSSDK>
3231
<FlagNetStandard1XDependencies Condition="'$(DotNetBuildSourceOnly)' == 'true'">true</FlagNetStandard1XDependencies>
3332
</PropertyGroup>
3433
<PropertyGroup Label="Servicing version information">
@@ -112,7 +111,7 @@
112111
At usage sites, either we use MicrosoftBuildMinimumVersion, or MicrosoftBuildVersion in source-only modes.
113112
114113
Additionally, set the MinimumVSVersion for the installer UI that's required for targeting NetCurrent -->
115-
<MicrosoftBuildMinimumVersion Condition="'$(DotNetBuildSourceOnly)' != 'true'">17.14.8</MicrosoftBuildMinimumVersion>
114+
<MicrosoftBuildMinimumVersion Condition="'$(DotNetBuildSourceOnly)' != 'true'">17.14.28</MicrosoftBuildMinimumVersion>
116115
<MinimumVSVersion>18.0</MinimumVSVersion>
117116
</PropertyGroup>
118117
<PropertyGroup>
@@ -126,7 +125,7 @@
126125
</PropertyGroup>
127126
<PropertyGroup Label="Manually updated">
128127
<!-- Dependencies from https://github.com/microsoft/MSBuildLocator -->
129-
<MicrosoftBuildLocatorPackageVersion>1.8.1</MicrosoftBuildLocatorPackageVersion>
128+
<MicrosoftBuildLocatorPackageVersion>1.10.2</MicrosoftBuildLocatorPackageVersion>
130129
<MicrosoftCodeAnalysisCSharpAnalyzerPinnedVersionPackageVersion>4.0.1</MicrosoftCodeAnalysisCSharpAnalyzerPinnedVersionPackageVersion>
131130
</PropertyGroup>
132131
<!-- Get .NET Framework reference assemblies from NuGet packages -->

sdk.slnx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@
5959
<Project Path="src/BuiltInTools/HotReloadClient/Microsoft.DotNet.HotReload.Client.shproj" />
6060
<Project Path="src/BuiltInTools/Web.Middleware/Microsoft.DotNet.HotReload.Web.Middleware.Package.csproj" />
6161
<Project Path="src/BuiltInTools/Web.Middleware/Microsoft.DotNet.HotReload.Web.Middleware.shproj" />
62+
<Project Path="src/BuiltInTools/Watch.Aspire/Microsoft.DotNet.HotReload.Watch.Aspire.csproj" />
63+
<Project Path="src/BuiltInTools/Watch/Microsoft.DotNet.HotReload.Watch.csproj" />
6264
</Folder>
6365
<Folder Name="/src/Cli/">
6466
<Project Path="src/Cli/dotnet/dotnet.csproj" />
@@ -325,6 +327,8 @@
325327
<Project Path="test/Microsoft.AspNetCore.Watch.BrowserRefresh.Tests/Microsoft.AspNetCore.Watch.BrowserRefresh.Tests.csproj" />
326328
<Project Path="test/Microsoft.DotNet.Cli.Utils.Tests/Microsoft.DotNet.Cli.Utils.Tests.csproj" />
327329
<Project Path="test/Microsoft.DotNet.HotReload.Client.Tests/Microsoft.DotNet.HotReload.Client.Tests.csproj" />
330+
<Project Path="test/Microsoft.DotNet.HotReload.Test.Utilities/Microsoft.DotNet.HotReload.Test.Utilities.csproj" />
331+
<Project Path="test/Microsoft.DotNet.HotReload.Watch.Aspire.Tests/Microsoft.DotNet.HotReload.Watch.Aspire.Tests.csproj" />
328332
<Project Path="test/Microsoft.DotNet.MSBuildSdkResolver.Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj" />
329333
<Project Path="test/Microsoft.DotNet.PackageInstall.Tests/Microsoft.DotNet.PackageInstall.Tests.csproj" />
330334
<Project Path="test/Microsoft.DotNet.TemplateLocator.Tests/Microsoft.DotNet.TemplateLocator.Tests.csproj" />

src/BuiltInTools/DotNetDeltaApplier/Microsoft.Extensions.DotNetDeltaApplier.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
-->
99
<TargetFrameworks>net6.0;net10.0</TargetFrameworks>
1010
<StrongNameKeyId>MicrosoftAspNetCore</StrongNameKeyId>
11+
12+
<DisableTransitiveFrameworkReferenceDownloads Condition="'$(DotNetBuildSourceOnly)' == 'true'">true</DisableTransitiveFrameworkReferenceDownloads>
1113
</PropertyGroup>
1214

1315
<!-- Reference 6.0.0 targeting packs in Source Build -->
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
using Microsoft.Extensions.Logging;
5+
6+
namespace Microsoft.DotNet.Watch;
7+
8+
internal static class DotNetWatchLauncher
9+
{
10+
public static async Task<bool> RunAsync(string workingDirectory, DotNetWatchOptions options)
11+
{
12+
var globalOptions = new GlobalOptions()
13+
{
14+
Quiet = options.IsQuiet,
15+
Verbose = options.IsVerbose,
16+
NoHotReload = false,
17+
NonInteractive = true,
18+
};
19+
20+
var commandArguments = new List<string>();
21+
if (options.NoLaunchProfile)
22+
{
23+
commandArguments.Add("--no-launch-profile");
24+
}
25+
26+
commandArguments.AddRange(options.ApplicationArguments);
27+
28+
var rootProjectOptions = new ProjectOptions()
29+
{
30+
IsRootProject = true,
31+
ProjectPath = options.ProjectPath,
32+
WorkingDirectory = workingDirectory,
33+
TargetFramework = null,
34+
BuildArguments = [],
35+
NoLaunchProfile = options.NoLaunchProfile,
36+
LaunchProfileName = null,
37+
Command = "run",
38+
CommandArguments = [.. commandArguments],
39+
LaunchEnvironmentVariables = [],
40+
};
41+
42+
var muxerPath = Path.GetFullPath(Path.Combine(options.SdkDirectory, "..", "..", "dotnet" + PathUtilities.ExecutableExtension));
43+
44+
var console = new PhysicalConsole(TestFlags.None);
45+
var reporter = new ConsoleReporter(console, globalOptions.Verbose, globalOptions.Quiet, suppressEmojis: false);
46+
var environmentOptions = EnvironmentOptions.FromEnvironment(muxerPath);
47+
var processRunner = new ProcessRunner(environmentOptions.GetProcessCleanupTimeout(isHotReloadEnabled: true));
48+
var loggerFactory = new LoggerFactory(reporter);
49+
var logger = loggerFactory.CreateLogger(DotNetWatchContext.DefaultLogComponentName);
50+
51+
using var context = new DotNetWatchContext()
52+
{
53+
ProcessOutputReporter = reporter,
54+
LoggerFactory = loggerFactory,
55+
Logger = logger,
56+
BuildLogger = loggerFactory.CreateLogger(DotNetWatchContext.BuildLogComponentName),
57+
ProcessRunner = processRunner,
58+
Options = globalOptions,
59+
EnvironmentOptions = environmentOptions,
60+
RootProjectOptions = rootProjectOptions,
61+
BrowserRefreshServerFactory = new BrowserRefreshServerFactory(),
62+
BrowserLauncher = new BrowserLauncher(logger, reporter, environmentOptions),
63+
};
64+
65+
using var shutdownHandler = new ShutdownHandler(console, logger);
66+
67+
try
68+
{
69+
var watcher = new HotReloadDotNetWatcher(context, console, runtimeProcessLauncherFactory: null);
70+
await watcher.WatchAsync(shutdownHandler.CancellationToken);
71+
}
72+
catch (OperationCanceledException) when (shutdownHandler.CancellationToken.IsCancellationRequested)
73+
{
74+
// Ctrl+C forced an exit
75+
}
76+
catch (Exception e)
77+
{
78+
logger.LogError("An unexpected error occurred: {Exception}", e.ToString());
79+
return false;
80+
}
81+
82+
return true;
83+
}
84+
}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
using System.Collections.Immutable;
5+
using System.CommandLine;
6+
using System.Diagnostics.CodeAnalysis;
7+
8+
namespace Microsoft.DotNet.Watch;
9+
10+
internal sealed class DotNetWatchOptions
11+
{
12+
/// <summary>
13+
/// The .NET SDK directory to load msbuild from (e.g. C:\Program Files\dotnet\sdk\10.0.100).
14+
/// Also used to locate `dotnet` executable.
15+
/// </summary>
16+
public required string SdkDirectory { get; init; }
17+
18+
public required string ProjectPath { get; init; }
19+
public required ImmutableArray<string> ApplicationArguments { get; init; }
20+
public bool IsVerbose { get; init; }
21+
public bool IsQuiet { get; init; }
22+
public bool NoLaunchProfile { get; init; }
23+
24+
public static bool TryParse(string[] args, [NotNullWhen(true)] out DotNetWatchOptions? options)
25+
{
26+
var sdkOption = new Option<string>("--sdk") { Arity = ArgumentArity.ExactlyOne, Required = true, AllowMultipleArgumentsPerToken = false };
27+
var projectOption = new Option<string>("--project") { Arity = ArgumentArity.ExactlyOne, Required = true, AllowMultipleArgumentsPerToken = false };
28+
var quietOption = new Option<bool>("--quiet") { Arity = ArgumentArity.Zero };
29+
var verboseOption = new Option<bool>("--verbose") { Arity = ArgumentArity.Zero };
30+
var noLaunchProfileOption = new Option<bool>("--no-launch-profile") { Arity = ArgumentArity.Zero };
31+
var applicationArguments = new Argument<string[]>("arguments") { Arity = ArgumentArity.ZeroOrMore };
32+
33+
verboseOption.Validators.Add(v =>
34+
{
35+
if (v.GetValue(quietOption) && v.GetValue(verboseOption))
36+
{
37+
v.AddError("Cannot specify both '--quiet' and '--verbose' options.");
38+
}
39+
});
40+
41+
var rootCommand = new RootCommand()
42+
{
43+
Directives = { new EnvironmentVariablesDirective() },
44+
Options =
45+
{
46+
sdkOption,
47+
projectOption,
48+
quietOption,
49+
verboseOption,
50+
noLaunchProfileOption
51+
},
52+
Arguments =
53+
{
54+
applicationArguments
55+
}
56+
};
57+
58+
var parseResult = rootCommand.Parse(args);
59+
if (parseResult.Errors.Count > 0)
60+
{
61+
foreach (var error in parseResult.Errors)
62+
{
63+
Console.Error.WriteLine(error);
64+
}
65+
66+
options = null;
67+
return false;
68+
}
69+
70+
options = new DotNetWatchOptions()
71+
{
72+
SdkDirectory = parseResult.GetRequiredValue(sdkOption),
73+
ProjectPath = parseResult.GetRequiredValue(projectOption),
74+
IsQuiet = parseResult.GetValue(quietOption),
75+
IsVerbose = parseResult.GetValue(verboseOption),
76+
ApplicationArguments = [.. parseResult.GetValue(applicationArguments) ?? []],
77+
NoLaunchProfile = parseResult.GetValue(noLaunchProfileOption),
78+
};
79+
80+
return true;
81+
}
82+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project Sdk="Microsoft.NET.Sdk">
3+
4+
<PropertyGroup>
5+
<TargetFramework>$(SdkTargetFramework)</TargetFramework>
6+
<StrongNameKeyId>MicrosoftAspNetCore</StrongNameKeyId>
7+
<OutputType>Exe</OutputType>
8+
<RootNamespace>Microsoft.DotNet.Watch</RootNamespace>
9+
<IsShipping>true</IsShipping>
10+
11+
<!-- NuGet -->
12+
<IsPackable>true</IsPackable>
13+
<IsShippingPackage>true</IsShippingPackage>
14+
<PackAsTool>true</PackAsTool>
15+
<PackageId>Microsoft.DotNet.HotReload.Watch.Aspire</PackageId>
16+
<PackageDescription>
17+
A supporting package for Aspire CLI:
18+
https://github.com/dotnet/aspire
19+
</PackageDescription>
20+
</PropertyGroup>
21+
22+
<ItemGroup>
23+
<PackageReference Include="System.CommandLine" />
24+
<PackageReference Include="Microsoft.Build.Locator" />
25+
</ItemGroup>
26+
27+
<ItemGroup>
28+
<ProjectReference Include="..\Watch\Microsoft.DotNet.HotReload.Watch.csproj" />
29+
</ItemGroup>
30+
31+
<ItemGroup>
32+
<PublicAPI Include="PublicAPI.Shipped.txt" />
33+
<PublicAPI Include="PublicAPI.Unshipped.txt" />
34+
<PublicAPI Include="InternalAPI.Shipped.txt" />
35+
<PublicAPI Include="InternalAPI.Unshipped.txt" />
36+
</ItemGroup>
37+
38+
<Import Project="..\Watch\RuntimeDependencies.props" />
39+
</Project>
40+

0 commit comments

Comments
 (0)