In-Memory Optimized Error: The code generation directory cannot be created or set up correctly
Is there a way to define where the XTP directory will be created in the CREATE TABLE syntax or elsewhere?


No, there is not. This always points to the default database path. If the path is removed, it will attempt to be created and have security applied to it a few times before returning an error.

This is true as of build: 13.0.4422.0 and older

If you feel that this should be changed to a configurable value - I'd invite you to create a request in Connect.