Skip to content
Merged
Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
c919723
Update dependencies from https://github.com/microsoft/testfx build 20…
dotnet-maestro[bot] Oct 23, 2025
670f0ab
[release/10.0.1xx] Update dependencies from microsoft/testfx (#51424)
SimonZhao888 Oct 23, 2025
0a9f0ea
Update dependencies from https://github.com/microsoft/testfx build 20…
dotnet-maestro[bot] Oct 24, 2025
58c8dc7
[release/10.0.1xx] Update dependencies from microsoft/testfx (#51439)
SimonZhao888 Oct 24, 2025
5dab158
Merge branch 'release/10.0.2xx' of https://github.com/dotnet/sdk into…
Oct 24, 2025
f99e889
Merge branch 'release/10.0.2xx' into merge/release/10.0.1xx-to-releas…
SimonZhao888 Oct 24, 2025
d88624f
Merge branch 'release/10.0.2xx' into merge/release/10.0.1xx-to-releas…
SimonZhao888 Oct 27, 2025
18545be
Merge branch 'release/10.0.2xx' of https://github.com/dotnet/sdk into…
Oct 27, 2025
30564ba
Merge branch 'release/10.0.2xx' into merge/release/10.0.1xx-to-releas…
SimonZhao888 Oct 29, 2025
41a7f15
Merge branch 'release/10.0.2xx' into merge/release/10.0.1xx-to-releas…
SimonZhao888 Oct 31, 2025
914c9da
Merge branch 'release/10.0.2xx' into merge/release/10.0.1xx-to-releas…
SimonZhao888 Nov 3, 2025
601dac1
Merge branch 'release/10.0.2xx' into merge/release/10.0.1xx-to-releas…
DonnaChen888 Nov 4, 2025
b43b2ec
Merge branch 'release/10.0.2xx' into merge/release/10.0.1xx-to-releas…
DonnaChen888 Nov 4, 2025
05a73ef
Update dependencies from https://github.com/microsoft/testfx build 20…
dotnet-maestro[bot] Nov 5, 2025
0739b5a
Merge branch 'release/10.0.2xx' into merge/release/10.0.1xx-to-releas…
DonnaChen888 Nov 5, 2025
03f6d6e
Merge branch 'release/10.0.2xx' into darc-release/10.0.2xx-97438f3c-b…
nagilson Nov 5, 2025
413d99b
Merge branch 'release/10.0.2xx' into darc-release/10.0.2xx-97438f3c-b…
DonnaChen888 Nov 6, 2025
450493b
Merge branch 'release/10.0.2xx' into merge/release/10.0.1xx-to-releas…
DonnaChen888 Nov 6, 2025
5c8f7cb
Merge branch 'release/10.0.2xx' into darc-release/10.0.2xx-97438f3c-b…
DonnaChen888 Nov 6, 2025
1f0bf2f
Merge branch 'release/10.0.2xx' into merge/release/10.0.1xx-to-releas…
DonnaChen888 Nov 6, 2025
cccffbb
Merge branch 'release/10.0.2xx' into darc-release/10.0.2xx-97438f3c-b…
nagilson Nov 7, 2025
9d94e51
Merge branch 'release/10.0.2xx' into merge/release/10.0.1xx-to-releas…
DonnaChen888 Nov 7, 2025
00c5249
Backflow from https://github.com/dotnet/dotnet / 6f4c060 build 289866
dotnet-maestro[bot] Nov 7, 2025
5a6177c
Merge release/10.0.2xx into darc-release/10.0.2xx-64b0aa88-723e-4fdd-…
dotnet-maestro[bot] Nov 7, 2025
6029a62
Update dependencies from https://github.com/dotnet/dotnet build 289866
dotnet-maestro[bot] Nov 7, 2025
dcc8cfe
Delete duplicate tests
tmat Nov 7, 2025
11ededf
Update baseline
jjonescz Nov 7, 2025
6a04a91
Make GlobalPrefixRemover override VisitAliasQualifiedName instead of …
ericstj Oct 13, 2025
93ce3b4
Merge branch 'release/10.0.2xx' into darc-release/10.0.2xx-64b0aa88-7…
tmat Nov 7, 2025
82e2e7d
Update dependencies from https://github.com/microsoft/testfx build 20…
dotnet-maestro[bot] Nov 8, 2025
0cfbcaf
Update dependencies from https://github.com/microsoft/testfx build 20…
dotnet-maestro[bot] Nov 9, 2025
31f5075
Update dependencies from https://github.com/microsoft/testfx build 20…
dotnet-maestro[bot] Nov 10, 2025
9827b5f
Merge branch 'release/10.0.2xx' into darc-release/10.0.2xx-64b0aa88-7…
DonnaChen888 Nov 10, 2025
41f38b8
Merge branch 'release/10.0.2xx' into darc-release/10.0.2xx-97438f3c-b…
DonnaChen888 Nov 10, 2025
89617df
Merge branch 'release/10.0.2xx' into merge/release/10.0.1xx-to-releas…
DonnaChen888 Nov 10, 2025
73af02e
Merge branch 'release/10.0.2xx' into darc-release/10.0.2xx-64b0aa88-7…
DonnaChen888 Nov 11, 2025
e5d688d
Merge branch 'release/10.0.2xx' into darc-release/10.0.2xx-97438f3c-b…
DonnaChen888 Nov 11, 2025
175506a
Merge branch 'release/10.0.2xx' into merge/release/10.0.1xx-to-releas…
DonnaChen888 Nov 11, 2025
d91154f
Fix failing build task tests
jjonescz Nov 11, 2025
265a139
[release/10.0.2xx] Source code updates from dotnet/dotnet (#51612)
nagilson Nov 11, 2025
599261f
Suppress
Youssef1313 Nov 11, 2025
f0c7627
Suppress
Youssef1313 Nov 11, 2025
52f47bf
Suppress
Youssef1313 Nov 11, 2025
ec46acd
Suppress
Youssef1313 Nov 11, 2025
444d7d2
Merge branch 'release/10.0.2xx' into darc-release/10.0.2xx-97438f3c-b…
DonnaChen888 Nov 12, 2025
89662c8
Merge branch 'release/10.0.2xx' into merge/release/10.0.1xx-to-releas…
DonnaChen888 Nov 12, 2025
4f0a377
Update dependencies from https://github.com/microsoft/testfx build 20…
dotnet-maestro[bot] Nov 12, 2025
ee432c9
[release/10.0.2xx] Update dependencies from microsoft/testfx (#51567)
DonnaChen888 Nov 12, 2025
db7b2f6
Merge branch 'release/10.0.2xx' into merge/release/10.0.1xx-to-releas…
DonnaChen888 Nov 12, 2025
27674c0
Improve clarity of 'dotnet project convert' output directory prompt (…
Copilot Nov 12, 2025
f2d6e46
Refactor dotnet-watch into a package consumable from Aspire.CLI (#51223)
tmat Nov 12, 2025
c81e4d0
Update dependencies from https://github.com/microsoft/testfx build 20…
dotnet-maestro[bot] Nov 13, 2025
09c0dc7
Merge branch 'release/10.0.2xx' into merge/release/10.0.1xx-to-releas…
DonnaChen888 Nov 13, 2025
cdcbd07
Remove more analyzer redirecting VSIX related stuff (#51692)
jjonescz Nov 13, 2025
ca4f27a
[release/10.0.2xx] Update dependencies from microsoft/testfx (#51709)
dsplaisted Nov 13, 2025
1af6f70
[automated] Merge branch 'release/10.0.1xx' => 'release/10.0.2xx' (#5…
dsplaisted Nov 13, 2025
b71399b
Merge 10.0.2xx to main
dsplaisted Nov 14, 2025
70488b0
Add version for Microsoft.CodeAnalysis.ExternalAccess.HotReload
dsplaisted Nov 14, 2025
ae38711
Update dependencies from dotnet/dotnet
dsplaisted Nov 17, 2025
3e2b37f
Update roslyn tests
jjonescz Nov 17, 2025
68cfd9e
Merge upstream changes
dsplaisted Nov 19, 2025
8d7c8c3
Merge upstream changes
dsplaisted Nov 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="$(MicrosoftCodeAnalysisPackageVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="$(MicrosoftCodeAnalysisPackageVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="$(MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.ExternalAccess.HotReload" Version="$(MicrosoftCodeAnalysisExternalAccessHotReloadPackageVersion)" />

<!-- roslyn-sdk dependencies-->
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing" Version="1.1.2" />
Expand Down Expand Up @@ -81,8 +82,6 @@
<PackageVersion Include="Microsoft.TestPlatform.Build" Version="$(MicrosoftTestPlatformBuildPackageVersion)" />
<PackageVersion Include="Microsoft.TestPlatform.CLI" Version="$(MicrosoftTestPlatformCLIPackageVersion)" />
<PackageVersion Include="Microsoft.VisualStudio.Composition" Version="17.4.16" />
<PackageVersion Include="Microsoft.VisualStudio.Sdk" Version="17.2.32505.173" />
<PackageVersion Include="Microsoft.VSSDK.BuildTools" Version="17.11.435" />
<PackageVersion Include="Microsoft.VisualStudio.Setup.Configuration.Interop" Version="$(MicrosoftVisualStudioSetupConfigurationInteropVersion)" />
<PackageVersion Include="Microsoft.VisualStudio.SolutionPersistence" Version="$(MicrosoftVisualStudioSolutionPersistenceVersion)" />
<PackageVersion Include="Microsoft.Web.Deployment" Version="$(WebDeploymentPackageVersion)" />
Expand Down
2 changes: 0 additions & 2 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
<add key="dotnet-tools-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-transport/nuget/v3/index.json" />
<add key="dotnet-libraries" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-libraries/nuget/v3/index.json" />
<add key="dotnet-libraries-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-libraries-transport/nuget/v3/index.json" />
<add key="vssdk" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vssdk/nuget/v3/index.json" />
<add key="vssdk-archived" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vssdk-archived/nuget/v3/index.json" />
<add key="vs-impl" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-impl/nuget/v3/index.json" />
<!-- Used for Rich Navigation indexing task -->
<add key="richnav" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-buildservices/nuget/v3/index.json" />
Expand Down
4 changes: 4 additions & 0 deletions eng/Publishing.props
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
<Artifact Remove="@(MsiPackages)" />
</ItemGroup>

<ItemGroup Condition="'$(PublishingWorkloadMsiInternal)' == 'true'">
<Artifact Update="$(ArtifactsShippingPackagesDir)*.Msi.*.nupkg" Visibility="Internal" />
</ItemGroup>

<Target Name="GetNonStableProductVersion">
<!-- Retrieve the non-stable product version. -->
<MSBuild Projects="$(RepoRoot)src\Layout\redist\redist.csproj"
Expand Down
4 changes: 1 addition & 3 deletions eng/Signing.props
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,8 @@
<FileSignInfo Include="Verify.dll" CertificateName="$(ExternalCertificateId)" />
<FileSignInfo Include="Verify.DiffPlex.dll" CertificateName="$(ExternalCertificateId)" />
</ItemGroup>

<ItemGroup>
<FileSignInfo Include="StreamJsonRpc.dll" CertificateName="MicrosoftSHA2" />

<ItemGroup>
<!-- Roslyn apphosts -->
<FileSignInfo Condition="'$(TargetOS)' == 'osx'" Include="csc;vbc;VBCSCompiler" CertificateName="MacDeveloperHarden" />
</ItemGroup>
Expand Down
5 changes: 2 additions & 3 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
compiler API targeted by analyzer assemblies. This is mostly an issue on source-build as
in that build mode analyzer assemblies always target the live compiler API. -->
<UsingToolMicrosoftNetCompilers Condition="'$(DotNetBuildSourceOnly)' == 'true'">true</UsingToolMicrosoftNetCompilers>
<UsingToolVSSDK>true</UsingToolVSSDK>
<FlagNetStandard1XDependencies Condition="'$(DotNetBuildSourceOnly)' == 'true'">true</FlagNetStandard1XDependencies>
</PropertyGroup>
<PropertyGroup Label="Servicing version information">
Expand Down Expand Up @@ -112,7 +111,7 @@
At usage sites, either we use MicrosoftBuildMinimumVersion, or MicrosoftBuildVersion in source-only modes.

Additionally, set the MinimumVSVersion for the installer UI that's required for targeting NetCurrent -->
<MicrosoftBuildMinimumVersion Condition="'$(DotNetBuildSourceOnly)' != 'true'">17.14.8</MicrosoftBuildMinimumVersion>
<MicrosoftBuildMinimumVersion Condition="'$(DotNetBuildSourceOnly)' != 'true'">17.14.28</MicrosoftBuildMinimumVersion>
<MinimumVSVersion>18.0</MinimumVSVersion>
</PropertyGroup>
<PropertyGroup>
Expand All @@ -126,7 +125,7 @@
</PropertyGroup>
<PropertyGroup Label="Manually updated">
<!-- Dependencies from https://github.com/microsoft/MSBuildLocator -->
<MicrosoftBuildLocatorPackageVersion>1.8.1</MicrosoftBuildLocatorPackageVersion>
<MicrosoftBuildLocatorPackageVersion>1.10.2</MicrosoftBuildLocatorPackageVersion>
<MicrosoftCodeAnalysisCSharpAnalyzerPinnedVersionPackageVersion>4.0.1</MicrosoftCodeAnalysisCSharpAnalyzerPinnedVersionPackageVersion>
</PropertyGroup>
<!-- Get .NET Framework reference assemblies from NuGet packages -->
Expand Down
4 changes: 4 additions & 0 deletions sdk.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
<Project Path="src/BuiltInTools/HotReloadClient/Microsoft.DotNet.HotReload.Client.shproj" />
<Project Path="src/BuiltInTools/Web.Middleware/Microsoft.DotNet.HotReload.Web.Middleware.Package.csproj" />
<Project Path="src/BuiltInTools/Web.Middleware/Microsoft.DotNet.HotReload.Web.Middleware.shproj" />
<Project Path="src/BuiltInTools/Watch.Aspire/Microsoft.DotNet.HotReload.Watch.Aspire.csproj" />
<Project Path="src/BuiltInTools/Watch/Microsoft.DotNet.HotReload.Watch.csproj" />
</Folder>
<Folder Name="/src/Cli/">
<Project Path="src/Cli/dotnet/dotnet.csproj" />
Expand Down Expand Up @@ -325,6 +327,8 @@
<Project Path="test/Microsoft.AspNetCore.Watch.BrowserRefresh.Tests/Microsoft.AspNetCore.Watch.BrowserRefresh.Tests.csproj" />
<Project Path="test/Microsoft.DotNet.Cli.Utils.Tests/Microsoft.DotNet.Cli.Utils.Tests.csproj" />
<Project Path="test/Microsoft.DotNet.HotReload.Client.Tests/Microsoft.DotNet.HotReload.Client.Tests.csproj" />
<Project Path="test/Microsoft.DotNet.HotReload.Test.Utilities/Microsoft.DotNet.HotReload.Test.Utilities.csproj" />
<Project Path="test/Microsoft.DotNet.HotReload.Watch.Aspire.Tests/Microsoft.DotNet.HotReload.Watch.Aspire.Tests.csproj" />
<Project Path="test/Microsoft.DotNet.MSBuildSdkResolver.Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj" />
<Project Path="test/Microsoft.DotNet.PackageInstall.Tests/Microsoft.DotNet.PackageInstall.Tests.csproj" />
<Project Path="test/Microsoft.DotNet.TemplateLocator.Tests/Microsoft.DotNet.TemplateLocator.Tests.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
-->
<TargetFrameworks>net6.0;net10.0</TargetFrameworks>
<StrongNameKeyId>MicrosoftAspNetCore</StrongNameKeyId>

<DisableTransitiveFrameworkReferenceDownloads Condition="'$(DotNetBuildSourceOnly)' == 'true'">true</DisableTransitiveFrameworkReferenceDownloads>
</PropertyGroup>

<!-- Reference 6.0.0 targeting packs in Source Build -->
Expand Down
84 changes: 84 additions & 0 deletions src/BuiltInTools/Watch.Aspire/DotNetWatchLauncher.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.Extensions.Logging;

namespace Microsoft.DotNet.Watch;

internal static class DotNetWatchLauncher
{
public static async Task<bool> RunAsync(string workingDirectory, DotNetWatchOptions options)
{
var globalOptions = new GlobalOptions()
{
Quiet = options.IsQuiet,
Verbose = options.IsVerbose,
NoHotReload = false,
NonInteractive = true,
};

var commandArguments = new List<string>();
if (options.NoLaunchProfile)
{
commandArguments.Add("--no-launch-profile");
}

commandArguments.AddRange(options.ApplicationArguments);

var rootProjectOptions = new ProjectOptions()
{
IsRootProject = true,
ProjectPath = options.ProjectPath,
WorkingDirectory = workingDirectory,
TargetFramework = null,
BuildArguments = [],
NoLaunchProfile = options.NoLaunchProfile,
LaunchProfileName = null,
Command = "run",
CommandArguments = [.. commandArguments],
LaunchEnvironmentVariables = [],
};

var muxerPath = Path.GetFullPath(Path.Combine(options.SdkDirectory, "..", "..", "dotnet" + PathUtilities.ExecutableExtension));

var console = new PhysicalConsole(TestFlags.None);
var reporter = new ConsoleReporter(console, globalOptions.Verbose, globalOptions.Quiet, suppressEmojis: false);
var environmentOptions = EnvironmentOptions.FromEnvironment(muxerPath);
var processRunner = new ProcessRunner(environmentOptions.GetProcessCleanupTimeout(isHotReloadEnabled: true));
var loggerFactory = new LoggerFactory(reporter);
var logger = loggerFactory.CreateLogger(DotNetWatchContext.DefaultLogComponentName);

using var context = new DotNetWatchContext()
{
ProcessOutputReporter = reporter,
LoggerFactory = loggerFactory,
Logger = logger,
BuildLogger = loggerFactory.CreateLogger(DotNetWatchContext.BuildLogComponentName),
ProcessRunner = processRunner,
Options = globalOptions,
EnvironmentOptions = environmentOptions,
RootProjectOptions = rootProjectOptions,
BrowserRefreshServerFactory = new BrowserRefreshServerFactory(),
BrowserLauncher = new BrowserLauncher(logger, reporter, environmentOptions),
};

using var shutdownHandler = new ShutdownHandler(console, logger);

try
{
var watcher = new HotReloadDotNetWatcher(context, console, runtimeProcessLauncherFactory: null);
await watcher.WatchAsync(shutdownHandler.CancellationToken);
}
catch (OperationCanceledException) when (shutdownHandler.CancellationToken.IsCancellationRequested)
{
// Ctrl+C forced an exit
}
catch (Exception e)
{
logger.LogError("An unexpected error occurred: {Exception}", e.ToString());
return false;
}

return true;
}
}
82 changes: 82 additions & 0 deletions src/BuiltInTools/Watch.Aspire/DotNetWatchOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Collections.Immutable;
using System.CommandLine;
using System.Diagnostics.CodeAnalysis;

namespace Microsoft.DotNet.Watch;

internal sealed class DotNetWatchOptions
{
/// <summary>
/// The .NET SDK directory to load msbuild from (e.g. C:\Program Files\dotnet\sdk\10.0.100).
/// Also used to locate `dotnet` executable.
/// </summary>
public required string SdkDirectory { get; init; }

public required string ProjectPath { get; init; }
public required ImmutableArray<string> ApplicationArguments { get; init; }
public bool IsVerbose { get; init; }
public bool IsQuiet { get; init; }
public bool NoLaunchProfile { get; init; }

public static bool TryParse(string[] args, [NotNullWhen(true)] out DotNetWatchOptions? options)
{
var sdkOption = new Option<string>("--sdk") { Arity = ArgumentArity.ExactlyOne, Required = true, AllowMultipleArgumentsPerToken = false };
var projectOption = new Option<string>("--project") { Arity = ArgumentArity.ExactlyOne, Required = true, AllowMultipleArgumentsPerToken = false };
var quietOption = new Option<bool>("--quiet") { Arity = ArgumentArity.Zero };
var verboseOption = new Option<bool>("--verbose") { Arity = ArgumentArity.Zero };
var noLaunchProfileOption = new Option<bool>("--no-launch-profile") { Arity = ArgumentArity.Zero };
var applicationArguments = new Argument<string[]>("arguments") { Arity = ArgumentArity.ZeroOrMore };

verboseOption.Validators.Add(v =>
{
if (v.GetValue(quietOption) && v.GetValue(verboseOption))
{
v.AddError("Cannot specify both '--quiet' and '--verbose' options.");
}
});

var rootCommand = new RootCommand()
{
Directives = { new EnvironmentVariablesDirective() },
Options =
{
sdkOption,
projectOption,
quietOption,
verboseOption,
noLaunchProfileOption
},
Arguments =
{
applicationArguments
}
};

var parseResult = rootCommand.Parse(args);
if (parseResult.Errors.Count > 0)
{
foreach (var error in parseResult.Errors)
{
Console.Error.WriteLine(error);
}

options = null;
return false;
}

options = new DotNetWatchOptions()
{
SdkDirectory = parseResult.GetRequiredValue(sdkOption),
ProjectPath = parseResult.GetRequiredValue(projectOption),
IsQuiet = parseResult.GetValue(quietOption),
IsVerbose = parseResult.GetValue(verboseOption),
ApplicationArguments = [.. parseResult.GetValue(applicationArguments) ?? []],
NoLaunchProfile = parseResult.GetValue(noLaunchProfileOption),
};

return true;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>$(SdkTargetFramework)</TargetFramework>
<StrongNameKeyId>MicrosoftAspNetCore</StrongNameKeyId>
<OutputType>Exe</OutputType>
<RootNamespace>Microsoft.DotNet.Watch</RootNamespace>
<IsShipping>true</IsShipping>

<!-- NuGet -->
<IsPackable>true</IsPackable>
<IsShippingPackage>true</IsShippingPackage>
<PackAsTool>true</PackAsTool>
<PackageId>Microsoft.DotNet.HotReload.Watch.Aspire</PackageId>
<PackageDescription>
A supporting package for Aspire CLI:
https://github.com/dotnet/aspire
</PackageDescription>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.CommandLine" />
<PackageReference Include="Microsoft.Build.Locator" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Watch\Microsoft.DotNet.HotReload.Watch.csproj" />
</ItemGroup>

<ItemGroup>
<PublicAPI Include="PublicAPI.Shipped.txt" />
<PublicAPI Include="PublicAPI.Unshipped.txt" />
<PublicAPI Include="InternalAPI.Shipped.txt" />
<PublicAPI Include="InternalAPI.Unshipped.txt" />
</ItemGroup>

<Import Project="..\Watch\RuntimeDependencies.props" />
</Project>

12 changes: 12 additions & 0 deletions src/BuiltInTools/Watch.Aspire/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Microsoft.Build.Locator;
using Microsoft.DotNet.Watch;

if (!DotNetWatchOptions.TryParse(args, out var options))
{
return -1;
}

MSBuildLocator.RegisterMSBuildPath(options.SdkDirectory);

var workingDirectory = Directory.GetCurrentDirectory();
return await DotNetWatchLauncher.RunAsync(workingDirectory, options) ? 0 : 1;
7 changes: 7 additions & 0 deletions src/BuiltInTools/Watch.Aspire/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("Microsoft.DotNet.HotReload.Watch.Aspire.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")]
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ internal abstract class WebApplicationAppModel(DotNetWatchContext context) : Hot
protected WebAssemblyHotReloadClient CreateWebAssemblyClient(ILogger clientLogger, ILogger agentLogger, BrowserRefreshServer browserRefreshServer, ProjectGraphNode clientProject)
{
var capabilities = clientProject.GetWebAssemblyCapabilities().ToImmutableArray();
var targetFramework = clientProject.GetTargetFrameworkVersion() ?? throw new InvalidOperationException("Project doesn't define TargetFrameworkVersion");
var targetFramework = clientProject.GetTargetFrameworkVersion() ?? throw new InvalidOperationException($"Project doesn't define {PropertyNames.TargetFrameworkMoniker}");

return new WebAssemblyHotReloadClient(clientLogger, agentLogger, browserRefreshServer, capabilities, targetFramework, context.EnvironmentOptions.TestFlags.HasFlag(TestFlags.MockBrowser));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ private bool CanLaunchBrowser(ProjectOptions projectOptions, [NotNullWhen(true)]
return false;
}

if (!CommandLineOptions.IsCodeExecutionCommand(projectOptions.Command))
if (!projectOptions.IsCodeExecutionCommand)
{
logger.LogDebug("Command '{Command}' does not support launching browsers.", projectOptions.Command);
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ internal static class PropertyNames
{
public const string TargetFramework = nameof(TargetFramework);
public const string TargetFrameworkIdentifier = nameof(TargetFrameworkIdentifier);
public const string TargetFrameworkMoniker = nameof(TargetFrameworkMoniker);
public const string TargetPath = nameof(TargetPath);
public const string EnableDefaultItems = nameof(EnableDefaultItems);
public const string TargetFrameworks = nameof(TargetFrameworks);
Expand Down
19 changes: 19 additions & 0 deletions src/BuiltInTools/Watch/Build/BuildUtilities.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.DotNet.Watch;

internal static class BuildUtilities
{
// Parses name=value pairs passed to --property. Skips invalid input.
public static IEnumerable<(string key, string value)> ParseBuildProperties(IEnumerable<string> arguments)
=> from argument in arguments
let colon = argument.IndexOf(':')
where colon >= 0 && argument[0..colon] is "--property" or "-property" or "/property" or "/p" or "-p" or "--p"
let eq = argument.IndexOf('=', colon)
where eq >= 0
let name = argument[(colon + 1)..eq].Trim()
let value = argument[(eq + 1)..]
where name is not []
select (name, value);
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static ImmutableDictionary<string, string> GetGlobalBuildOptions(IEnumera
{
// See https://github.com/dotnet/project-system/blob/main/docs/well-known-project-properties.md

return CommandLineOptions.ParseBuildProperties(buildArguments)
return BuildUtilities.ParseBuildProperties(buildArguments)
.ToImmutableDictionary(keySelector: arg => arg.key, elementSelector: arg => arg.value)
.SetItem(PropertyNames.DotNetWatchBuild, "true")
.SetItem(PropertyNames.DesignTimeBuild, "true")
Expand Down
Loading
Loading