Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Handle projects that use <TargetFrameworks> instead of <TargetFramework>#8

Open
l0hn wants to merge 2 commits intoAvaloniaUI:mainfrom
l0hn:multiple-frameworks
Open

Handle projects that use <TargetFrameworks> instead of <TargetFramework>#8
l0hn wants to merge 2 commits intoAvaloniaUI:mainfrom
l0hn:multiple-frameworks

Conversation

@l0hn
Copy link
Copy Markdown

@l0hn l0hn commented Feb 1, 2025

Fixes bug where projects that use <TargetFrameworks> instead of <TargetFramework> are not parsed, leading to lack of autocompletion from LSP.

@l0hn l0hn changed the title Handle projects that use <TargetFramework> instead of <TargetFramework> Handle projects that use <TargetFrameworks> instead of <TargetFramework> Feb 1, 2025
Console.WriteLine(jsonStr);
}

static string? GetFirstFramework(MSProject proj, out bool hasMultipleFrameworks)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure has this API is exactly used in VSCode extension.
But for VisualStudio extension we prioritize plain "netx.0" target framework over platform specific, and macos/windows as a second choice (if on that platform).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example, if project has "net8.0-ios" as a first framework, previewer will still fail.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As for SolutionParserCommand, it would make sense to return multiple projects in this situation. So, the caller can decide which framework to use (in this case, VSCode extension).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will the language server handle multiple entries for the same .csproj file? If so it would make sense to add a project entry for each framework listed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants