Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Referencing both Bond.CSharp and Bond.Compiler.CSharp produces "Duplicate BondCodegen items were included" error #1109

Open
chwarr opened this issue May 25, 2021 · 0 comments
Labels

Comments

@chwarr
Copy link
Member

chwarr commented May 25, 2021

If both of the Bond.CSharp and Bond.Compiler.CSharp packages are referenced in the same SDK-style csproj file, an error about "Duplicate BondCodegen items were included" will be emitted.

This is caused by each package including Common.props and Common.targets, so the <BondCodegen Include="**/*.bond" /> item in Common.props is evaluated twice, which results in the duplicate items in BondCodegen.

Work-around: only reference Bond.CSharp xor Bond.Compiler.CSharp.

The codegen targets should detect this and emit an error. Bonus points if they handle this automatically instead.

Conditional MSBuild imports have, historically, confused Visual Studio, so an approach like <Import Project="Common.props" Condition=" '$(_bond_common_props_imported)' != 'true' " /> is probably not viable.

@chwarr chwarr added the bug label May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant