The commands available to the dotnet CLI are dependent on the resolved SDK. There are some commands such as dnx which should function regardless of what SDK is pinned in the global.json. This has become a problem for running the Roslyn LSP in the Copilot CLI as it uses dotnet dnx to launch the LSP, but this will fail if the folder being run against has pinned to .NET 9 or lower.
I propose adding a new flag indicating whether to ignore the global json and if it is passed, return the SDK as if no global.json was present.
The commands available to the dotnet CLI are dependent on the resolved SDK. There are some commands such as
dnxwhich should function regardless of what SDK is pinned in the global.json. This has become a problem for running the Roslyn LSP in the Copilot CLI as it usesdotnet dnxto launch the LSP, but this will fail if the folder being run against has pinned to .NET 9 or lower.I propose adding a new flag indicating whether to ignore the global json and if it is passed, return the SDK as if no global.json was present.