Skip to content

MSBuild location not found with .NET 9 and must be specified explicitly #1601

@fgimian

Description

@fgimian

Hey there, hope you're doing well. I've been trying out the Roslynator CLI recently but am being forced to explicitly pass my MSBuild path.

Here are my dotnet global tools:

Package Id                             Version      Commands
--------------------------------------------------------------------
csharpier                              0.30.1       dotnet-csharpier
csharprepl                             0.6.7        csharprepl
dotnet-outdated-tool                   4.6.4        dotnet-outdated
dotnet-reportgenerator-globaltool      5.4.1        reportgenerator
roslynator.dotnet.cli                  0.9.3        roslynator

And here are my .NET SDK paths along with MSBuild locations:

C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe
C:\Program Files\dotnet\sdk\9.0.101\MSBuild.dll

And here's what I see when running Roslynator:

~\source\oriel on  main
🕙 [ 05:23:52 PM ] ❯ roslynator.exe analyze -v diag
Roslynator Version: 0.9.3.0
Roslynator Target Framework: .NET Core
Roslyn Version: 4.11.0.0
MSBuild location not found. Use option '-m, --msbuild-path' to specify MSBuild location

It works as expected when explicitly specifying the MSBuild directory path like so:

roslynator.exe analyze -m 'C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin'

or

roslynator.exe analyze -m 'C:\Program Files\dotnet\sdk\9.0.101'

This all works perfectly when having .NET SDK 8 installed so I'm assuming .NET 9 is not yet supported for the CLI out of the box?

Thanks heaps
Fotis

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions