以下の内容はhttps://touch-sp.hatenablog.com/entry/2026/01/24/123713より取得しました。


Claude Codeで .NET Framework を使った C# の開発を行う

開発環境

Windows 11

手順

プロジェクトの作成

この部分もClaude Codeに実行させることが可能なのでしょうが、節約のためにVisual Studioで素直にWinFormという名前のWindowsフォームアプリケーション(.NET Framework)を作りました。

このようなファイル構成になります。

WinForm
│  WinForm.slnx
└─WinForm
    │  App.config
    │  Form1.cs
    │  Form1.Designer.cs
    │  Program.cs
    │  WinForm.csproj
    └─Properties
           AssemblyInfo.cs
           Resources.Designer.cs
           Resources.resx
           Settings.Designer.cs
           Settings.settings

Claude Codeの起動

二つ目のWinForm(WinForm.csprojが存在するフォルダ)でClaude Codeを立ち上げました。

CLAUDE.mdの作成と修正

/initを実行するとCLAUDE.mdを作成してくれます。

Buildingの部分がこのようになりましたが、このままでは動きませんので修正が必要です。

こちらを参考にさせて頂きました。

修正前

### Building
```bash
# Debug build
msbuild WinForm.csproj /p:Configuration=Debug

# Release build
msbuild WinForm.csproj /p:Configuration=Release
```

修正後

### Building
```bash
# Debug build
powershell.exe -Command "& 'C:\Program Files\Microsoft Visual Studio\18\Community\MSBuild\Current\Bin\MSBuild.exe' WinForm.csproj -p:Configuration=Debug"

# Release build
powershell.exe -Command "& 'C:\Program Files\Microsoft Visual Studio\18\Community\MSBuild\Current\Bin\MSBuild.exe' WinForm.csproj -p:Configuration=Release"
```

これでClaude Code内でビルドができるようになります。

Runコマンドが書かれている場合には以下のように修正するのが良いと思います。

### Run

```
powershell.exe -Command "& '.\bin\Debug\net48\WinForm.exe'"

```

```
powershell.exe -Command "& '.\bin\Release\net48\WinForm.exe'"
```

.claude/settings.jsonの作成

{
  "permissions": {
    "deny": [
      "Read(bin/)",
      "Read(obj/)"
    ]
  }
}




以上の内容はhttps://touch-sp.hatenablog.com/entry/2026/01/24/123713より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14