FMOD not found in Visual Studio (Namespaces greyed out)

MacOS High Sierra 10.13.6
Unity v2019.3.12f1
FMOD Studio for Unity v2.00.08
Visual Studio for Mac v8.5.4 (build 12)

I’m experiencing two weird issues with the FMOD package in Unity:

  1. Sometimes when I open a previously saved Unity project, FMOD is not showing up among the tabs and all the FMOD scripts are disabled. It’s almost like the unity package was never installed in the first place, despite the fact that I worked on that project for several hours without problems last night. I tried reinstalling the FMOD-Unity package both from the official website and from the asset store, but it didn’t make any difference.

  2. Visual Studio does not recognize FMOD. Namespaces are greyed out and I get the occasional “Are you missing an assembly reference?” message. Clearly I’m not a programmer, but I can’t find any documentation regarding this problem. What am I doing wrong?

It might be worth noting that I previously had issues with FMOD Studio as well, but I solved it by unquarantining the app. Could it be related with those other issues?

Screenshot 2020-05-02 18.18.14

I have a similar issue, where the difference from the OP is that I am on Win 10 and using Visual Studio 2019 community. Otherwise FMOD version is the same and Unity version is the same.

When I tried to attach my VS project to Unity to debug something unrelated to FMOD, I got the error:
“Error CS0246 The type or namespace name ‘FMOD’ could not be found (are you missing a using directive or an assembly reference?)”

I found my way to this post and saw it was very similar. My using statements are greyed out like the OP shows.

I made a few tests and figured out that the FMOD tab and components are disabled whenever I save a script that include some reference to an FMOD instance or parameter.
Because of my problem #2 - Visual Studio not finding FMOD references - I get all kinds of errors and red lines, therefore if I save that script the FMOD integration disappears.
As soon as I remove those lines or delete the script altogether, FMOD comes back with all its components.

So I guess it all comes down to figure out why the hell Visual Studio is not communicating with FMOD.

this may be fixed in a future fmod package but i fixed this issue by moving the files in Plugins/fmod/src and Plugins/fmod/addons outside of the plugins folder. ie: move to a folder called Assets/fmod

2 Likes

Thanks for the reply. this helped me.

I think the true issue is a bug this version of unity v2019.3.12f1 as i ran into this issue with other project doesnt shouldn’t have this problem. It has a bug with VS project generation causing referencing issues.

Its this bug

So you can either downgrade to a previous version of unity or use this hack that people made to fix the bug in the meantime [which i used]
https://forum.unity.com/threads/2019-3-12f1-build-errors.880312/#post-5788105

Thank you, that might be it!
Someone in the comments said that this was fixed in 2019.3.13f1, but I haven’t tried to update yet. I’ll give it a try tonight.

Just tried, it works! Thanks again

I ran into the same (or a similar) problem the other day.

VisualStudio suddenly forgets about FMOD. The using statement gets greyed out and underlined red just as the OP showed. I also get the Error CS0246 just the same.
Unity version is 2020.2.1f1 Visual Studio version is 16.9.3. I’m on Windows 10.

If my issue is related does this mean that the bug isn’t fixed yet, or has it resurfaced?

What does the trick in my case is to re-build the solution files from Unitys Preferences (Preferences>“Regenerate Project Files” with “Embeded Packages” and “Local Packages” toggled ON and everything else OFF).

Sometimes the error even disappears on it’s own after a couple of minutes, sometimes it doesn’t. The Workaround works fine every time, but it’s annoying (to say the least) having to do this several times a day…

Anybody else experiencing this (again)?
Cheers

I’ve definitely been experiencing this for awhile, using 2019.4.13f1.
I mostly was ignoring it but now it’s getting a bit on my nerves. I tried the hotfixes listed in the Unity forums thread but it didn’t seem to do anything in my case.

On my side I updated Unity vs editor from package manager and that seem to solve the issue.

I’m also having this issue in Unity 2022.3.7f1. This causes a red error in the Unity console and I can’t run my game. Here are things I’ve tried so far with no fix. I’m able to use the FMOD Studio Event Emitter script just fine, but I’m trying to write my own and can’t call on that namespace.

error CS0246: The type or namespace name 'FMODUnity' could not be found (are you missing a using directive or an assembly reference?)

EDIT: My fix. Another programmer had added assembly definitions to our project, and I needed to add a reference to FMODUnity to that. In our project there was a file called _Game.asmdef that was an Assembly Definition Asset. In the inspector, under Assembly Definition References I had to click the plus button and add a reference to FMODUnity there.

2 Likes