# Bug: 'EventReference' does not contain a definition for 'Find' when running a build

**URL:** <https://qa.fmod.com/t/bug-eventreference-does-not-contain-a-definition-for-find-when-running-a-build/17676>\
**Category:** Unity\
**Created:** [September 15, 2021, 4:33am UTC](https://qa.fmod.com/t/bug-eventreference-does-not-contain-a-definition-for-find-when-running-a-build/17676 "2021-09-15T04:33:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![buffdash](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/buffdash/32/2621_2.png) [@buffdash](https://qa.fmod.com/u/buffdash)\
**Post date:** [September 15, 2021, 4:33am UTC](https://qa.fmod.com/t/bug-eventreference-does-not-contain-a-definition-for-find-when-running-a-build/17676/1 "2021-09-15T04:33:42Z")

</div>

My game runs perfectly fine in the Unity Editor game player, but when I go to run a Addressables Content build using the Default Build Script that ships with Unity, I get the error in the title of this post.

This is the offending line in my code that triggers the error:  
`fmodEvent.EventReference = FMODUnity.EventReference.Find(fmodEventPath);`

If I comment this line out, I’m able to build my Addressable Assets. Why is this happening?

---

<div class="post-metadata">

**Author:** ![buffdash](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/buffdash/32/2621_2.png) [@buffdash](https://qa.fmod.com/u/buffdash)\
**Post date:** [September 15, 2021, 4:49am UTC](https://qa.fmod.com/t/bug-eventreference-does-not-contain-a-definition-for-find-when-running-a-build/17676/2 "2021-09-15T04:49:59Z")

</div>

A quick update on this one - the error also occurs when I try to run a build and it happens with both Mono + IL2CPP Scripting Backends.

FMOD version: 2.02.03  
OS: Windows 10  
Unity version: 2021.1.20f1  
Build Target: Windows x86\_64

---

<div class="post-metadata">

**Author:** ![buffdash](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/buffdash/32/2621_2.png) [@buffdash](https://qa.fmod.com/u/buffdash)\
**Post date:** [September 15, 2021, 5:31am UTC](https://qa.fmod.com/t/bug-eventreference-does-not-contain-a-definition-for-find-when-running-a-build/17676/3 "2021-09-15T05:31:15Z")

</div>

Ah, I think I see the issue - the `FMODUnity.EventReference.Find` method is only available in the UnityEditor context.

My use case is dynamically creating StudioEventEmitter components at runtime and I need to of course dynamically set the `EventReference` property from a path string.

It used to be as simple as this:  
`fmodEvent.Event = fmodEventPath;`

With the latest library, how can I lookup a studio event at runtime from its path? (e.g “event:/game/music/track1” ?)

---

<div class="post-metadata">

**Author:** ![buffdash](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/buffdash/32/2621_2.png) [@buffdash](https://qa.fmod.com/u/buffdash)\
**Post date:** [September 15, 2021, 5:38am UTC](https://qa.fmod.com/t/bug-eventreference-does-not-contain-a-definition-for-find-when-running-a-build/17676/4 "2021-09-15T05:38:14Z")

</div>

Answered my own question - this is how you do it:  
`fmodEvent.EventReference = FMODUnity.RuntimeManager.PathToEventReference(fmodEventPath);`

---

<div class="post-metadata">

**Author:** ![cybersurferllc](https://avatars.discourse-cdn.com/v4/letter/c/6a8cbe/32.png) [@cybersurferllc](https://qa.fmod.com/u/cybersurferllc)\
**Post date:** [March 25, 2023, 7:55am UTC](https://qa.fmod.com/t/bug-eventreference-does-not-contain-a-definition-for-find-when-running-a-build/17676/5 "2023-03-25T07:55:11Z")

</div>

Awesome work, this issue was messing with exporting a simple build. Switched to `fmodEvent.EventReference = FMODUnity.RuntimeManager.PathToEventReference(fmodEventPath);` and was able to build successfully. Thank you!
