Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enables IDE protocol v1 support. #3269

Merged
merged 1 commit into from
Apr 1, 2024
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
29 changes: 20 additions & 9 deletions src/Aspire.Hosting/Dcp/ApplicationExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -989,19 +989,30 @@ private void PrepareProjectExecutables()
{
exeSpec.ExecutionType = ExecutionType.IDE;

#pragma warning disable CS0612 // These annotations are obsolete; remove in Aspire Preview 6
annotationHolder.Annotate(Executable.CSharpProjectPathAnnotation, projectMetadata.ProjectPath);

// ExcludeLaunchProfileAnnotation takes precedence over LaunchProfileAnnotation.
if (project.TryGetLastAnnotation<ExcludeLaunchProfileAnnotation>(out _))
if (_dcpInfo?.Version?.CompareTo(DcpVersion.MinimumVersionIdeProtocolV1) >= 0)
{
annotationHolder.Annotate(Executable.CSharpDisableLaunchProfileAnnotation, "true");
projectLaunchConfiguration.DisableLaunchProfile = project.TryGetLastAnnotation<ExcludeLaunchProfileAnnotation>(out _);
if (!projectLaunchConfiguration.DisableLaunchProfile && project.TryGetLastAnnotation<LaunchProfileAnnotation>(out var lpa))
{
projectLaunchConfiguration.LaunchProfile = lpa.LaunchProfileName;
}
}
else if (project.TryGetLastAnnotation<LaunchProfileAnnotation>(out var lpa))
else
{
annotationHolder.Annotate(Executable.CSharpLaunchProfileAnnotation, lpa.LaunchProfileName);
}
#pragma warning disable CS0612 // These annotations are obsolete; remove in Aspire Preview 6
annotationHolder.Annotate(Executable.CSharpProjectPathAnnotation, projectMetadata.ProjectPath);

// ExcludeLaunchProfileAnnotation takes precedence over LaunchProfileAnnotation.
if (project.TryGetLastAnnotation<ExcludeLaunchProfileAnnotation>(out _))
{
annotationHolder.Annotate(Executable.CSharpDisableLaunchProfileAnnotation, "true");
}
else if (project.TryGetLastAnnotation<LaunchProfileAnnotation>(out var lpa))
{
annotationHolder.Annotate(Executable.CSharpLaunchProfileAnnotation, lpa.LaunchProfileName);
}
#pragma warning restore CS0612
}
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/Aspire.Hosting/Dcp/DcpVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Aspire.Hosting.Dcp;
internal static class DcpVersion
{
public static Version MinimumVersionInclusive = new Version(0, 1, 55);
public static Version MinimumVersionIdeProtocolV1 = new Version(0, 1, 59);
public static Version MinimumVersionIdeProtocolV1 = new Version(0, 1, 61);

/// <summary>
/// Development build version proxy, considered always "current" and supporting latest features.
Expand Down