Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
<PackageVersion Include="runtime.linux-musl-x64.Microsoft.NETCore.DotNetHostResolver" Version="$(MicrosoftNETCoreDotNetHostResolverPackageVersion)" />
<PackageVersion Include="runtime.linux-x64.Microsoft.NETCore.DotNetHostResolver" Version="$(MicrosoftNETCoreDotNetHostResolverPackageVersion)" />
<PackageVersion Include="runtime.osx-x64.Microsoft.NETCore.DotNetHostResolver" Version="$(MicrosoftNETCoreDotNetHostResolverPackageVersion)" />
<PackageVersion Include="Spectre.Console" Version="0.52.0" />
<PackageVersion Include="Spectre.Console" Version="0.54.0" />
<PackageVersion Include="StyleCop.Analyzers" Version="$(StyleCopAnalyzersPackageVersion)" />
<PackageVersion Include="System.CodeDom" Version="$(SystemCodeDomPackageVersion)" />
<PackageVersion Include="System.CommandLine" Version="$(SystemCommandLineVersion)" />
Expand Down
5 changes: 3 additions & 2 deletions sdk.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<File Path="test.sh" />
</Folder>
<Folder Name="/src/">
<Project Path="src/Microsoft.DotNet.ProjectTools/Microsoft.DotNet.ProjectTools.csproj" />
<Project Path="src/Microsoft.DotNet.TemplateLocator/Microsoft.DotNet.TemplateLocator.csproj" />
<Project Path="src/Microsoft.Net.Sdk.Compilers.Toolset/Microsoft.Net.Sdk.Compilers.Toolset.csproj" />
<Project Path="src/Microsoft.Win32.Msi/Microsoft.Win32.Msi.csproj" />
Expand Down Expand Up @@ -57,10 +58,10 @@
<Project Path="src/BuiltInTools/HotReloadAgent/Microsoft.DotNet.HotReload.Agent.shproj" />
<Project Path="src/BuiltInTools/HotReloadClient/Microsoft.DotNet.HotReload.Client.Package.csproj" />
<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" />
<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" />
</Folder>
<Folder Name="/src/Cli/">
<Project Path="src/Cli/dotnet/dotnet.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,8 @@
<Compile Include="$(RepoRoot)src\Common\PathUtilities.cs" LinkBase="Utilities" />
</ItemGroup>

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

</Project>
38 changes: 11 additions & 27 deletions src/BuiltInTools/Watch/Process/LaunchSettingsProfile.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.


using System.Diagnostics;
using System.Text.Json;
using System.Text.Json.Serialization;
using Microsoft.DotNet.ProjectTools;
using Microsoft.Extensions.Logging;

namespace Microsoft.DotNet.Watch
Expand All @@ -26,28 +25,19 @@ internal sealed class LaunchSettingsProfile

internal static LaunchSettingsProfile? ReadLaunchProfile(string projectPath, string? launchProfileName, ILogger logger)
{
var projectDirectory = Path.GetDirectoryName(projectPath);
Debug.Assert(projectDirectory != null);

var launchSettingsPath = GetPropertiesLaunchSettingsPath(projectDirectory, "Properties");
bool hasLaunchSettings = File.Exists(launchSettingsPath);

var projectNameWithoutExtension = Path.GetFileNameWithoutExtension(projectPath);
var runJsonPath = GetFlatLaunchSettingsPath(projectDirectory, projectNameWithoutExtension);
bool hasRunJson = File.Exists(runJsonPath);

if (hasLaunchSettings)
var launchSettingsPath = LaunchSettingsLocator.TryFindLaunchSettings(projectPath, launchProfileName, (message, isError) =>
{
if (hasRunJson)
if (isError)
{
logger.LogWarning("Warning: Settings from '{JsonPath}' are not used because '{LaunchSettingsPath}' has precedence.", runJsonPath, launchSettingsPath);
logger.LogError(message);
}
}
else if (hasRunJson)
{
launchSettingsPath = runJsonPath;
}
else
else
{
logger.LogWarning(message);
}
});

if (launchSettingsPath == null)
{
return null;
}
Expand Down Expand Up @@ -96,12 +86,6 @@ internal sealed class LaunchSettingsProfile
return namedProfile;
}

private static string GetPropertiesLaunchSettingsPath(string directoryPath, string propertiesDirectoryName)
=> Path.Combine(directoryPath, propertiesDirectoryName, "launchSettings.json");

private static string GetFlatLaunchSettingsPath(string directoryPath, string projectNameWithoutExtension)
=> Path.Join(directoryPath, $"{projectNameWithoutExtension}.run.json");

private static LaunchSettingsProfile? ReadDefaultLaunchProfile(LaunchSettingsJson? launchSettings, ILogger logger)
{
if (launchSettings is null || launchSettings.Profiles is null)
Expand Down
1 change: 1 addition & 0 deletions src/BuiltInTools/dotnet-watch.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"src\\BuiltInTools\\Watch.Aspire\\Microsoft.DotNet.HotReload.Watch.Aspire.csproj",
"src\\BuiltInTools\\Watch\\Microsoft.DotNet.HotReload.Watch.csproj",
"src\\BuiltInTools\\dotnet-watch\\dotnet-watch.csproj",
"src\\Microsoft.DotNet.ProjectTools\\Microsoft.DotNet.ProjectTools.csproj",
"test\\Microsoft.AspNetCore.Watch.BrowserRefresh.Tests\\Microsoft.AspNetCore.Watch.BrowserRefresh.Tests.csproj",
"test\\Microsoft.DotNet.HotReload.Client.Tests\\Microsoft.DotNet.HotReload.Client.Tests.csproj",
"test\\Microsoft.Extensions.DotNetDeltaApplier.Tests\\Microsoft.Extensions.DotNetDeltaApplier.Tests.csproj",
Expand Down
19 changes: 19 additions & 0 deletions src/Cli/Microsoft.DotNet.Cli.CommandLine/xlf/CliResources.cs.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions src/Cli/Microsoft.DotNet.Cli.CommandLine/xlf/CliResources.de.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions src/Cli/Microsoft.DotNet.Cli.CommandLine/xlf/CliResources.es.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions src/Cli/Microsoft.DotNet.Cli.CommandLine/xlf/CliResources.fr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions src/Cli/Microsoft.DotNet.Cli.CommandLine/xlf/CliResources.it.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions src/Cli/Microsoft.DotNet.Cli.CommandLine/xlf/CliResources.ja.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions src/Cli/Microsoft.DotNet.Cli.CommandLine/xlf/CliResources.ko.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions src/Cli/Microsoft.DotNet.Cli.CommandLine/xlf/CliResources.pl.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions src/Cli/Microsoft.DotNet.Cli.CommandLine/xlf/CliResources.ru.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions src/Cli/Microsoft.DotNet.Cli.CommandLine/xlf/CliResources.tr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading