Take the community feedback survey now.
AI OnAI Off
Take the community feedback survey now.
When is this code being executed? Try calling your block of code when the content is being created.
context.Locate.ContentEvents().CreatingContent += CreatingContent;
This is what my test code looks like:
And the error I get: