Incorrect PowerShell Build Command for .NET Project
Status Fixed / completed
Maintainer reply ✓ Yes — bcherny
Activity 7 comments · opened Feb 24, 2025 · closed Feb 24, 2025
💡 Likely answer: A maintainer (bcherny, collaborator)
responded on this thread — see the highlighted reply below.
Bug Description
When I try to get claude to build a dotnet project, it issues a command pwsh -n -C 'dotnet build'. It seems the -n parameter is causing issues, and powershell always returns a 128 exit code.
Environment Info
- Platform: macos
- Terminal: iTerm.app
- Version: 0.2.9
- Feedback ID: 5cc6149d-20e9-4291-a158-63cf44fc7cdf
- Shell: Powershell (pwsh)
7 Comments
Here is what it looks like when I ask Claude Code to build my repo
!Image
Can you share the correct bash command that you would have expected Claude to run?
pwsh -c 'dotnet build'AFAIK, the
-noption is not valid for powershell and I don't know where it's coming from. about_PwshIt sounds like Claude just doesn't know a lot about
pwsh. One thing that can help in situations like this is to make the relevant documentation available to claude somewhere in your repo. Another possibility is to sync the relevant github repo for the library you are using. If it's a matter of reminding Claude how to do common things (like build or run tests) add a CLAUDE.md file to your repo. Claude Code can get you started with this if you go/initI will try adding some instructions to the CLAUDE.md later and test. I suspect it may have to do with the fact that I'm using pwsh as the host shell for claude code. I just checked the official documentation and it says it only officially supports bash and zsh, so maybe if I try the project with zsh as the host, maybe it will work as intended.
I ran the same command but used bash to start claude, and now the dotnet build commands work. I'll close out this issue as powershell is not officially supported.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.