dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
18.85k stars 4.01k forks source link

`OpenProjectAsync` logger's parameter is unused (public API) #72202

Open Youssef1313 opened 6 months ago

Youssef1313 commented 6 months ago

MSBuildWorkspace.OpenProjectAsync has a public overload with a logger parameter, which gets passed to MSBuildProjectLoader that is then not using it.

https://github.com/dotnet/roslyn/blob/3472dcbca677f86bced5a1f180ae45e83c3e8f2d/src/Workspaces/Core/MSBuild/MSBuild/MSBuildProjectLoader.cs#L160-L162

Youssef1313 commented 6 months ago

Related to https://github.com/dotnet/roslyn/pull/70469

cc @jasonmalinowski

Youssef1313 commented 6 months ago

Trying 4.9.0-1.final which is before #70469, it also doesn't work. But instead of doing nothing, it crashes:

Unhandled exception. Microsoft.Build.Framework.LoggerException: Failed to write to log file "BINLOG_PATH". The process cannot access the file 'BINLOG_PATH'
jasonmalinowski commented 6 months ago

@Youssef1313 That does't look like something that'd be our problem?

Youssef1313 commented 6 months ago

@jasonmalinowski Things work properly on 4.8.0

And 4.9.0-1.final crashes, and 4.9.0-3.final does nothing as the parameter is unused.

The same exception was also reported in https://github.com/dotnet/roslyn/issues/70674.

But anyways, 4.9.0-1.final isn't important as it's from the past. What would be needed here is supporting the logger parameter back.