# The proper way to link the debug library in C#

**URL:** <https://qa.fmod.com/t/the-proper-way-to-link-the-debug-library-in-c/22980>\
**Category:** FMOD Engine\
**Tags:** csharp\
**Created:** [May 27, 2025, 10:22pm UTC](https://qa.fmod.com/t/the-proper-way-to-link-the-debug-library-in-c/22980 "2025-05-27T22:22:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kgambill](https://avatars.discourse-cdn.com/v4/letter/k/258eb7/32.png) [@kgambill](https://qa.fmod.com/u/kgambill)\
**Post date:** [May 27, 2025, 10:22pm UTC](https://qa.fmod.com/t/the-proper-way-to-link-the-debug-library-in-c/22980/1 "2025-05-27T22:22:17Z")

</div>

I’m curious as to the proper way to set FMOD to use the debug library instead of the release library? We’re using a custom C# engine (not Unity) and have been using a hack for quite a while to get it to load the debug library.

In fmod.cs I’ve updated the VERSION partial class to the following:

```auto
    public partial class VERSION
    {
        public const int number = 0x00020123;
#if !UNITY_2017_4_OR_NEWER
	#if DEBUG
		public const string dll = "fmodL";
	#else
		public const string dll = "fmod";
	#endif
#endif
	}

```

This works perfectly fine, as I’m linking against the proper dll based on whether the DEBUG flag is set in my FMODWrapper csproj. However, directly editing the FMOD source is not the proper fix here, so I was wondering what the intended method for this is?

Note: I’m working in Visual Studio, using FMOD 2.01.23

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [June 4, 2025, 3:51am UTC](https://qa.fmod.com/t/the-proper-way-to-link-the-debug-library-in-c/22980/2 "2025-06-04T03:51:22Z")

</div>

That would be the way to do it.  
We haven’t included this because the preprocessor define will need to be maintained by the user and, outside of Unity, could be already setup as just about anything.

I have created a task to add this, then the user could either rename the define or add it to their project.
