ParseAssemblyInfo 'Error: Sequence contains more than one element' when using preprocessor definitions in assembly info file
- Dominant language
- C#
- Stars
- 4.2k
- Forks
- 778
- Avg merge
- 1h 15m
- Merged PRs (30d)
- 19
Description
This happens even in newest Cake v0.20.0.
If we have a part in assembly info file like below
```
#if DEBUG
[assembly: AssemblyConfiguration("Debug")]
#else
[assembly: AssemblyConfiguration("Retail")]
#endif
```
It is simply failing because somewhere IEnumerable.Single() method is called and parser for some reason takes both of those assembly attributes definitions.
Contributor guide
Research direction
Start by locating Cake's assembly-info parser and the IEnumerable.Single() call mentioned in the report. Reproduce the failure with the shown DEBUG and non-DEBUG AssemblyConfiguration attributes, then inspect existing parser tests if available. Done means the conditional definitions no longer cause the parser to throw for this example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100