Skip to content

Can not start the cli tool: "No instances of MSBuild could be detected" #536

@Shuenhoy

Description

@Shuenhoy

Description

I cannot start the cli tool from the beginning.

Repro steps

Please provide the steps required to reproduce the problem

  1. dotnet tool install --global dotnet-fsharplint

  2. dotnet fsharplint --help

Expected behavior

It should start.

Actual behavior

Unhandled exception. System.TypeInitializationException: The type initializer for 'FSharpLint.Console.Program' threw an exception.
 ---> System.TypeInitializationException: The type initializer for '<StartupCode$dotnet-fsharplint>.$FSharpLint.Console.Program' threw an exception.
 ---> System.InvalidOperationException: No instances of MSBuild could be detected.
Try calling RegisterInstance or RegisterMSBuildPath to manually register one.
   at Microsoft.Build.Locator.MSBuildLocator.RegisterDefaults()
   at Ionide.ProjInfo.Init.init() in D:\a\proj-info\proj-info\src\Ionide.ProjInfo\Library.fs:line 17   at <StartupCode$dotnet-fsharplint>.$FSharpLint.Console.Program..cctor() in D:\a\FSharpLint\FSharpLint\src\FSharpLint.Console\Program.fs:line 134
   --- End of inner exception stack trace ---
   at FSharpLint.Console.Program..cctor()
   --- End of inner exception stack trace ---
   at FSharpLint.Console.Program.main(String[] argv) in D:\a\FSharpLint\FSharpLint\src\FSharpLint.Console\Program.fs:line 138

Known workarounds

Please provide a description of any known workarounds.

No

Related information

  • Operating system: Windows 11 21H2 (22000.434)
  • Branch v0.21.0
  • .NET Runtime, CoreCLR or Mono Version .NET 6.0.101
  • Performance information, links to performance testing scripts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions