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

As of now, it is still only the first target framework that is selected #2596

Open
zp-zpanda opened this issue Jan 21, 2024 · 0 comments
Open

Comments

@zp-zpanda
Copy link

zp-zpanda commented Jan 21, 2024

Relevant code:

// If the project supports multiple target frameworks and specific framework isn't
// selected, we must pick one before execution. Otherwise, the ResolveReferences
// target might not be available to us.
if (string.IsNullOrWhiteSpace(targetFramework) && targetFrameworks.Length > 0)
{
// For now, we'll just pick the first target framework. Eventually, we'll need to
// do better and potentially allow OmniSharp hosts to select a target framework.
targetFramework = targetFrameworks[0];
evaluatedProject.SetGlobalProperty(PropertyNames.TargetFramework, targetFramework);
evaluatedProject.ReevaluateIfNecessary();
}

By these lines if there is no TargetFramework then the first TargetFramework in TargetFrameworks will always be selected, which is a bit of a inconvenience, as seen in dotnet/vscode-csharp#1783 and dotnet/vscode-csharp#3754. It is also seen to be a shortcoming in the comments from L179-L180.

Is the feature that allows hosts to freely select a TargetFramework from the list of TargetFrameworks at will going to be implemented?

@zp-zpanda zp-zpanda changed the title Only the first target framework is selected As of now, only the first target framework is selected Jan 21, 2024
@zp-zpanda zp-zpanda changed the title As of now, only the first target framework is selected As of now, it is still only the first target framework that is selected Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant