Visual Studio for Macでデバッグできないとき
LeetCodeやAtCoderが流行っているので久々にC#を書こうとしたら詰まったのでメモ。
- Visual Studio for Macをダウンロード
- .NET Coreをダウンロード
- Visual Studioで適当にConsole Appを作成
- Console.WriteLineにBreakPointを置いてデバッグ実行
Debugger operation failed launch: program '' does not exist.
調べたところ、dotnetへのpathが通っていないとのことだった。
$ dotnet zsh: correct 'dotnet' to 'done' [nyae]? n zsh: command not found: dotnet $ ln -s /usr/local/share/dotnet/dotnet /usr/local/bin $ dotnet zsh: correct 'dotnet' to 'done' [nyae]? n Usage: dotnet [options] Usage: dotnet [path-to-application] Options: -h|--help Display help. --info Display .NET Core information. --list-sdks Display the installed SDKs. --list-runtimes Display the installed runtimes. path-to-application: The path to an application .dll file to execute.
linkを貼ることで無事デバッグできるようになった。