SpacetimeDB
SpacetimeDB copied to clipboard
C#: Reducers and types with same name but different capitalization have bad error text
If you have a module with following table and reducer, there are no errors in IDE, but publishing returns a fairly unhelpful error
[Table]
public partial class Test { }
[Reducer]
public static void test() { }
Publishing error:
CSC : warning CS8785: Generator 'Module' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'ArgumentException' with message 'The hintName 'Module.test.cs' of the added source file must be unique within a generator.
CSC : error CS5001: Program does not contain a static 'Main' method suitable for an entry point
Note: This can also happen with two reducers or two tables - it doesn't need to be a combination of both.