[asp.net mvc]建置時發生無法將檔案 複製到 roslyn資料夾錯誤

  • 1240
  • 0

[asp.net mvc]建置時發生無法將檔案 複製到 roslyn資料夾錯誤

詳細的錯誤訊息是:
嚴重性    程式碼    說明    專案    檔案    行    隱藏項目狀態
錯誤        無法將檔案 "D:\Projects\MyProject\MyWeb\packages\Microsoft.Net.Compilers.2.1.0\tools\System.IO.FileSystem.Primitives.dll" 複製到 "bin\roslyn\System.IO.FileSystem.Primitives.dll"。Access to the path 'bin\roslyn\System.IO.FileSystem.Primitives.dll' is denied.

解決的方法:
1.關閉visual studio(我這邊是2017)     
2.在工作管理員刪除VBCSCompiler.exe
3.重開vs然後重新建置專案
收工!                      ​ 


參考資料:
VS2017 Unable to copy file到roslyn目錄
https://note.kimx.info/2017/07/vs2017-unable-to-copy-file-roslyn.html