從 VS2017 RTM 起我就一律改用它開發專案,還算順利沒啥問題。今天則遇到一起小錯誤,某個從未用 VS2017 開啟過的專案,開啟時發生專案載入錯誤,出現以下訊息:

Project 'Blah' could not be opened because the Visual C# 2017 compiler could not be created. An item with the same key has already been added.

重試兩次狀況依舊,爬文求解。

找到不少相關討論,但案例集中在 ASP.NET 專案,推論與 IIS Express 有關,靠重設 IIS Express 設定可排除。但我的專案是 Windows Form 專案,情境明顯不同。在 stackoverflow 一則 ASP.NET 案例討論串我找到改用管理者模式開啟 Visual Studio 排除問題的經驗分享,雖然與其解決原理不符,還是抱著死馬當活馬醫心態一試,結果一改用管理者身分執行 Visual Studio 問題就消失了,之後改回一般身分執行,專案開啟編譯均正常。

無法重現問題無從深入調查,留個記錄供參。


Comments

Be the first to post a comment

Post a comment