Type couldn't be found in the SystemRegistry when compiling ISystem to DLL

I am trying to build an ISystem into a DLL using the Roslyn compiler and while it does build correctly I am getting a runtime error:

ArgumentException: Type MySystem couldn’t be found in the SystemRegistry. (This is likely a bug in an ILPostprocessor.)
Unity.Entities.WorldUnmanagedImpl.CreateUnmanagedSystemInternal (Unity.Entities.World self, System.Int32 structSize, System.Int64 typeHash, System.Int32 typeIndex, System.Void*& systemPtr, System.Boolean callOnCreate) (at ./Library/PackageCache/com.unity.entities@1.0.11/Unity.Entities/WorldUnmanaged.cs:469)

I’ve only found a couple of topics on this error and they relate to the system being a generic system. That’s not the case here as it’s about as basic of an ISystem as you can get:

public partial struct MySystem : ISystem

I have seen mentions that the system should be added to the TypeManager but how can I do that? It’s not a generic type. When I switch the system to a SystemBase instead of ISystem then it does not throw any errors at runtime. While this is a backup I’d rather use ISystem if it’s possible.

Thank you for any insight!

Some setup for these is based on using ILPP which more or less ends up making it necessary to use Unity with its compilation pipeline to get functional code. Either pull compiled code from ScriptAssemblies or don’t bother with going through compiling a DLL, really.