2025年9月5日 星期五

Visual Studio 2022 清除專案同時清空bin/obj資料夾

 在專案.csproj檔新增

<Project>

...

  <!-- #region 清理 bin 和 obj 資料夾 -->

  <Target Name="CleanBinObjFolders" AfterTargets="Clean">

<!-- Remove obj folder -->

    <RemoveDir Directories="$(BaseIntermediateOutputPath)" />

    <!-- Remove bin folder -->

    <RemoveDir Directories="$(BaseOutputPath)" />

  </Target>

  <!-- #endregion -->

</Project>


參考來源:How to fully clean bin and obj folders within Visual Studio?