1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【vscode/Unity】補完が消えた&useGlobalMonoがなくなって混乱している人へ

Last updated at Posted at 2022-05-28

useGlobalMonoが消えちゃった原因

vscodeでC#の開発をするのに次の拡張機能を入れているはずです.

この拡張機能をインストールすると,Monoという.NET Core環境に必須のやつが付属してきます.
ただし,これは最小限のものであり,完成品ではありません.
この付属のMonoについて次の声明が出されました.

簡単にまとめるとv1.25.0にて
「この付属のMono一番人気のUnityで使えないし,本家と同期するのもしんどいのでもう消します.」
というわけで付属のMonoは消えました.

Unityでは本家Monoを使うためにuseGlobalMonoをtrueに設定する必要があったのですが,付属のMonoが消えたので設定自体が不要になって消されました.

補完が消えちゃった原因

v1.25.0でdefaultで

'omnisharp.useModernNet': true

の設定にされるからです.こいつが悪さをしています.

生じているであろうエラーコード

おそらくOmniSharp Logを確認すると次のようなエラーが大量に出ていると思います.

Error: This project targets .NET version that requires reference assemblies that are not installed (e.g. .NET Framework). The most common solution is to make sure Mono is fully updated on your machine (https://mono-project.com/download/) and that you are running the .NET Framework build of OmniSharp (e.g. 'omnisharp.useModernNet': false in C# Extension for VS Code).

このエラー文通り,setting.jsonを

'omnisharp.useModernNet': false

にすれば治ります.
(つまり,ここがtrueなのがいけない.)

どうしてuseModernNetをtrueにしてはいけないのか

このlogを追いましたが,どうも原因は掴めませんでした.
falseにしていることが心配な方は次の公式アナウンスによく注意しておいた方が良いと思います.
falseの状態で放置するとまたいつかおかしくなります.

というか...

I understand the need for breaking software changes like this, but please consider communicating this change in a more clear way to end-users. I have the latest mono installed, but OmniSharp server would completely silently fail and give no indication of what was wrong. Not every user of VS code would think to check this github page when that happens. Maybe a popup in vs-code linking to this announcement would be helpful?
For more details -- I am on Ubuntu, latest version of mono installed, using vs-code with mono. My OmniSharp server would fail to even start, show no output at all in VS code. No icon in the bottom tray. Ctrl + Shift + P -> Restart OmniSharp Server is the top google result, and that would silently fail. Running OmniSharp: Analyze Current Project would throw a OmniSharp server is not running error, but top google results send you in a wrong direction. Finally, I found this page, and going to Settings and setting UseModernNet to false fixed my error.
Thank you for all the work your team does!

私も公式アナウンスしっかり見よ...

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?