Support for .fsproj, .vbproj project files next to .csproj#12087
Support for .fsproj, .vbproj project files next to .csproj#12087JamesNK merged 5 commits intodotnet:mainfrom
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12087Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12087" |
58b60e3 to
9fd2606
Compare
9fd2606 to
d8d2580
Compare
JamesNK
left a comment
There was a problem hiding this comment.
Is it possible to add a test for csproj and fsproj, etc. If this regressed once, then it could regress again.
| return projectFile; | ||
| } | ||
| // Handle .fsproj files | ||
| else if (projectFile.Extension.Equals(".fsproj", StringComparison.OrdinalIgnoreCase)) |
There was a problem hiding this comment.
Rather than duplicating the csproj branch, how about having a collection of project file extensions (csproj, fsproj, vbproj) and check whether the extension matches any of them.
There was a problem hiding this comment.
Test adjusted, support for the mentioned extensions added.
|
|
||
| internal sealed class ProjectLocator(ILogger<ProjectLocator> logger, IDotNetCliRunner runner, CliExecutionContext executionContext, IInteractionService interactionService, IConfigurationService configurationService, AspireCliTelemetry telemetry, IFeatures features) : IProjectLocator | ||
| { | ||
| private static readonly HashSet<string> s_supportedProjectFileExtensions = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { ".csproj", ".fsproj", ".vbproj" }; |
There was a problem hiding this comment.
We might need to introduce a FileExtensionHelper.IsSupportedMsBuildFile(...) which encapsulates the check. That way we can reuse it. There are a few other places in the CLI where we make assumptions about using *.csproj files.
Description
Previously, up until Aspire 9.4 IIRC, one could use F# to author an AppHost. I presume, when support for single file C# applications was integrated, support for
.fsprojaccidentally got broken. Perhaps there are explicit reasons to not support F# projects for this purpose. If so, I'd like to learn about the motivation for that.Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?doc-ideatemplatebreaking-changetemplatediagnostictemplate