Skip to content

Allow the LSP workspace configuration handler to get the open solution from the project system. #79145

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JoeRobich
Copy link
Member

Because the C# extension allows the user to open a solution file then another and because we have not implemented unload solution, the solution attributes never change and the project debug configuration always reports the first solution opened. This manifests itself when the user generates build assets for their workspace. The generated tasks.json will have build tasks for the first opened solution.

Resolves dotnet/vscode-csharp#8377

@JoeRobich JoeRobich requested a review from a team as a code owner June 26, 2025 06:47
@@ -48,7 +51,7 @@ private ProjectDebugConfiguration GetProjectDebugConfiguration(Project project)
{
var isExe = project.CompilationOptions?.OutputKind is OutputKind.ConsoleApplication or OutputKind.WindowsApplication;
var targetsDotnetCore = _targetFrameworkManager.IsDotnetCoreProject(project.Id);
return new ProjectDebugConfiguration(project.FilePath!, project.OutputFilePath!, GetProjectName(project), targetsDotnetCore, isExe, project.Solution.FilePath);
return new ProjectDebugConfiguration(project.FilePath!, project.OutputFilePath!, GetProjectName(project), targetsDotnetCore, isExe, _projectSystem.SolutionPath);
Copy link
Member

Choose a reason for hiding this comment

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

Should we just have it update the Solution FilePath instead? Otherwise this feels like we are setting ourselves up for bugs later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Solution Build/Clean/Rebuild on Solutions open from Solution filters runs on the original solution
2 participants