Scriptable Object works in editor, but not on build

I have the following scriptable object.

[CreateAssetMenu(fileName = "WeaponInfo", menuName = "Sos/Weapon", order = 1)]
public class WeaponInfo : ScriptableObject
{
    public int Damage = 10;
    public float Range = 5;
    public float AttackTime = 0.5f;
    public AudioClip FireSound;
    public GameObject WeaponModel;
}

I’ve created two of these in the editor.

118294-two-prefabs.png

It’s used in a monobehavior with:

public class PlayerBehavior : MonoBehaviour
{
    public WeaponInfo[] StartingWeapon = new WeaponInfo[5];

And I’ve assigned them in the editor

When I press play in the editor, everything works fine. However, if I make a build, none of the Scriptable Objects seem to be set, and I’m not sure how to confirm they’re even being exported.

The errors I see in the log file are:

The referenced script on this
Behaviour (Game Object ‘’) is
missing! (Filename:
C:\buildslave\unity\build\Runtime/Mono/MonoBehaviour.cpp
Line: 1789)

The referenced script on this
Behaviour (Game Object ‘’) is
missing! (Filename:
C:\buildslave\unity\build\Runtime/Mono/MonoBehaviour.cpp
Line: 1789)

How do I check for this? Are there any settings I need to set to force it to export SOs?

@NickWinters
Same problem here, did you ever find a solution for this?

Please read the answer by pitimoi