CodeSourceGenerator exception when building solution in JetBrains Rider

The following exception is thrown when trying to build the solution in the Rider IDE. Not sure if Visual Studio is affected.

NetCodeSourceGenerator.cs(142,1): Error NetCode : Object reference not set to an instance of an object.   
at Unity.NetCode.Generators.UserDefinedTemplateRegistryParser.ParseTemplatesFromMetadata(GeneratorExecutionContext context, IList`1 templates)

I need to build the solution in the IDE for some development features to work, e.g. assembly IL preview.

This happens in my project, and also seems to affect the CharacterController/OnlineFPS sample, probably other projects. This doesn’t impact actual Unity builds.

The exceptions are thrown when building a few specific projects.

In my project this additionally happens for the Rukhanka.Runtime project.

Thanks for reporting.

Netcode generators weren’t not designed to run in the IDE, or better, they run but do nothing, by design. The reason is mostly historical: we had some issues with the IDE integrations, not passing the correct additional files (required).

But they should not crash, or prevent the solution to be built. We will check what it is happening here.

1 Like