Add launch settings Executable command support
This commit is contained in:
@@ -38,10 +38,23 @@ public partial class RunService(ILogger<RunService> logger, RoslynAnalysis rosly
|
|||||||
var launchProfile = launchProfiles.FirstOrDefault();
|
var launchProfile = launchProfiles.FirstOrDefault();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
var fileName = launchProfile?.CommandName switch
|
||||||
|
{
|
||||||
|
"Executable" => launchProfile.ExecutablePath,
|
||||||
|
"Project" or _ => "dotnet",
|
||||||
|
} ?? "dotnet";
|
||||||
|
|
||||||
|
var workingDirectory = launchProfile?.WorkingDirectory switch
|
||||||
|
{
|
||||||
|
"$(ProjectDir)" => project.DirectoryPath,
|
||||||
|
null => project.DirectoryPath,
|
||||||
|
{} nonNullString => nonNullString,
|
||||||
|
};
|
||||||
|
|
||||||
var processStartInfo = new ProcessStartInfo2
|
var processStartInfo = new ProcessStartInfo2
|
||||||
{
|
{
|
||||||
FileName = "dotnet",
|
FileName = fileName,
|
||||||
WorkingDirectory = Path.GetDirectoryName(project.FilePath),
|
WorkingDirectory = workingDirectory,
|
||||||
//Arguments = $"run --project \"{project.FilePath}\" --no-restore",
|
//Arguments = $"run --project \"{project.FilePath}\" --no-restore",
|
||||||
Arguments = await GetRunArguments(project),
|
Arguments = await GetRunArguments(project),
|
||||||
RedirectStandardOutput = true,
|
RedirectStandardOutput = true,
|
||||||
|
|||||||
@@ -127,8 +127,9 @@ public class SharpIdeProjectModel : ISharpIdeNode, IExpandableSharpIdeNode, IChi
|
|||||||
? MsBuildEvaluationProjectTask.Result
|
? MsBuildEvaluationProjectTask.Result
|
||||||
: throw new InvalidOperationException("Do not attempt to access the MsBuildEvaluationProject before it has been loaded");
|
: throw new InvalidOperationException("Do not attempt to access the MsBuildEvaluationProject before it has been loaded");
|
||||||
|
|
||||||
public bool IsRunnable => IsBlazorProject || MsBuildEvaluationProject.GetPropertyValue("OutputType") is "Exe" or "WinExe";
|
public bool IsRunnable => MsBuildEvaluationProject.GetPropertyValue("OutputType") is "Exe" or "WinExe" || IsBlazorProject || IsGodotProject;
|
||||||
public bool IsBlazorProject => MsBuildEvaluationProject.Xml.Sdk is "Microsoft.NET.Sdk.BlazorWebAssembly";
|
public bool IsBlazorProject => MsBuildEvaluationProject.Xml.Sdk is "Microsoft.NET.Sdk.BlazorWebAssembly";
|
||||||
|
public bool IsGodotProject => MsBuildEvaluationProject.Xml.Sdk.StartsWith("Godot.NET.Sdk");
|
||||||
public bool IsMtpTestProject => MsBuildEvaluationProject.GetPropertyValue("IsTestingPlatformApplication") is "true";
|
public bool IsMtpTestProject => MsBuildEvaluationProject.GetPropertyValue("IsTestingPlatformApplication") is "true";
|
||||||
public string BlazorDevServerVersion => MsBuildEvaluationProject.Items.Single(s => s.ItemType is "PackageReference" && s.EvaluatedInclude is "Microsoft.AspNetCore.Components.WebAssembly.DevServer").GetMetadataValue("Version");
|
public string BlazorDevServerVersion => MsBuildEvaluationProject.Items.Single(s => s.ItemType is "PackageReference" && s.EvaluatedInclude is "Microsoft.AspNetCore.Components.WebAssembly.DevServer").GetMetadataValue("Version");
|
||||||
public bool OpenInRunPanel { get; set; }
|
public bool OpenInRunPanel { get; set; }
|
||||||
|
|||||||
Reference in New Issue
Block a user