Fix Remote Desktop Launch SSMS VS issue / 使用Remote Desktop時不能啟用程式時出現”Exception has been thrown by the target of an invocation”

最近使用 Remote Desktop Connection Manager / Remote Desktop時
發現不能再執行 SQL Server Management Studio /和 Visual Studio
當執行 SQL Server Management Studio (SSMS) 時出現
Exception has been thrown by the target of an invocation
Visual Studio 時出現
A problem occurred when loading the Microsoft Visual Studio menu. To fix this problem, run ‘devenv.exe /resetsettings’ from the command prompt. Note: this command reset your environment settings
嘗試執行 “devenv.exe /resetsettings” 也沒有幫助

原來是 “Environment Variable” ->”System variable” 的”Path”過長的關係
這條Path最多只可以儲存 2048個字元
就是把一些只是自己這個使用者便用的”Environment Variable”從 “System Variable” 搬到 “User Variable”上
System Variable over 2100 Characters
Environment Variable - User Variable
之後按 “OK/確正” 便可以了

再次連接Remote Desktop 應該便可以正常執行 SSMS / Visual Studio了

Hope you find it useful

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.