0

I am using vscode to edit unity scripts, I've added Mirror for needs, which extends its own namespace, but the problem is that omnisharp can't find it's namespace. All Mirror's files are under Assets/Thirdparty/Mirror

Everything works in terms of compiling and the result, but I have no idea how omnisharp works and how to configure it.

Below you can see waving lines at everything that is extended by the namespace.

Text

Christoph Rackwitz
  • 11,317
  • 4
  • 27
  • 36

2 Answers2

2

Sometimes I have that too, especially when I just updated VS Code or added a package in Unity. And sometimes this helps: enter image description here

Press the Regenerate project files button in Project Preferences.

frankhermes
  • 4,720
  • 1
  • 22
  • 39
  • Did not work, tried ticking checkboxes, but didn't help either. – eLeCtrOssSnake Nov 28 '20 at 11:33
  • 1
    What version of Unity are you using? Do you have the latest version of the Visual Studio Code Editor Package? – frankhermes Nov 29 '20 at 08:50
  • Updated unity today, latest vscode and latest omni-sharp. Doesn't work... – eLeCtrOssSnake Nov 29 '20 at 09:45
  • What's a "Visual Studio Code Editor Package"? Do I have to install something? I think it should work "outta the box". – eLeCtrOssSnake Nov 29 '20 at 10:01
  • Check the Package Manager window in Unity for the version of the Visual Studio Code Editor Package. It may need an update. It may even not be in your project at all, then you need to add it. – frankhermes Nov 29 '20 at 10:07
  • Had this problem with the universal render pipeline and the reference of Light2D in UnityEngine.Experimental.Rendering.Universal, regenerating the project files worked! – viddie Nov 25 '21 at 16:42
0

For me installing .NET Framework 4.7.1 Developer Pack fixed the problem.

Yusufbek
  • 2,180
  • 1
  • 17
  • 23