18
31

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 3 years have passed since last update.

【Unity】Visual StudioでUnityEngine.UIが参照エラーになる

Last updated at Posted at 2022-01-29

Visual Studio comminity2022を使っていて、突然 using UnityEngine.UI が参照エラーになったので、解決方法を記載いたします。

環境

  • Windows10
  • Unity Hub 2.4.5
  • Unity 2020.3.25f1
  • Visual Studio Community 2022

エラー内容

Unityから

CS0234	型または名前空間の名前 'UI' が名前空間 'UnityEngine' に
存在しません (アセンブリ参照があることを確認してください)	
Assembly-CSharp, Assembly-CSharp.Player

解決方法

手順1

まず、Unity側の 「Windows > Package Manager」 の中に、
Visual Studio Editor があるのでアップデート可能であればアップデートする。
Unityを再起動。

手順2

そして、Unity側の 「Assets > Open C# Project」 をクリックして Visual Studio を再起動する。

この手順で著者の環境ではなおりました。

今回は以上となります。

18
31
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
18
31

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?