Roslyn: Sequence contains more than one element
@sschmid when u make the following careless mistake, it will unable to gen code even after u fix to correct attribute. Perhaps the better solution will be not to gen duplicate same piece of code when making careless mistake.
To reproduce:
- Put 2 same Event(true, EventType.Added)
[Unique, Game, Event(true, EventType.Added), Event(true, EventType.Added)]
public sealed class PauseComponent : IComponent
{
}
```
2) Gen code
3) Changed one of it to `Event(true, EventType.Removed)`
4) Gen code again
5) Failed to gen code and pop up `Sequence contains more than one element` error

Are you using jenny and the roslyn code generator? If so, please try deleting the generated folder and generate again.
I just got this isssue too after renaming a component. Now I can't build at all. Even deleting Generated folder doesn't work.
Renaming will not break it. After deleting the generated folder, you still get the error? Can you do gen -v to see where it breaks?
Hi Simon, I found the error. It was my fault but maybe this situation could be reported better.
I copied a component file (Let's call it AComponent) and thought I had renamed the file and class to BComponent - I hadn't. AComponent had a Cleanup(CleanupMode.DestroyEntity) on it and therefore so did the duplicated component (With the same name). When I generated I got the error and it wasn't until I removed the Cleanup..... code from AComponent that I could build. Once I found the rename problem I renamed the duplicate to its new name and things could go back to normal(I could re-add the Cleanup)
System.InvalidOperationException: Sequence contains more than one element
at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source)
at Entitas.Roslyn.CodeGeneration.Plugins.CleanupDataProvider.<>c.<GetData>b__19_2(INamedTypeSymbol type)
at System.Linq.Enumerable.<>c__DisplayClass6_0`1.<CombinePredicates>b__0(TSource x)
at System.Linq.Enumerable.WhereArrayIterator`1.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Entitas.Roslyn.CodeGeneration.Plugins.CleanupDataProvider.GetData()
at DesperateDevs.CodeGeneration.CodeGenerator.CodeGenerator.generate(String messagePrefix, IPreProcessor[] preProcessors, IDataProvider[] dataProviders, ICodeGenerator[] codeGenerators, IPostProcessor[] postProcessors)
at DesperateDevs.CodeGeneration.CodeGenerator.CodeGenerator.DryRun()
at DesperateDevs.CodeGeneration.CodeGenerator.CLI.DoctorCommand.run()
at DesperateDevs.CLI.Utils.AbstractCommand.Run(CLIProgram program, String[] args)
at DesperateDevs.Serialization.CLI.Utils.AbstractPreferencesCommand.Run(CLIProgram program, String[] args)
at DesperateDevs.CLI.Utils.CLIProgram.runCommand(String[] args)
I'll see if I can provide better error messages!