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

[BUG] CS0436 "conflicts with the imported type" when using community toolkit with a shared maui project #814

Closed
1 task done
norfus opened this issue Dec 7, 2022 · 5 comments · Fixed by #791
Closed
1 task done
Labels
bug Something isn't working

Comments

@norfus
Copy link

norfus commented Dec 7, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When using .net communityToolkit maui for two projects in a solution, one main executable and one shared library, the following error occurs

MainTest-master\MainTest-master\MainTest\CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.Generators.TextColorToGenerator\TimePickerTextColorTo.g.shared.cs(41,89,41,124): warning CS0436: The type 'ColorAnimationExtensions_TimePicker' in 'CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.Generators.TextColorToGenerator\TimePickerTextColorTo.g.shared.cs' conflicts with the imported type 'ColorAnimationExtensions_TimePicker' in 'MainTest.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.Generators.TextColorToGenerator\TimePickerTextColorTo.g.shared.cs'.

Expected Behavior

No build errors should occur

Steps To Reproduce

  1. I create two maui project, one main that can run, and one with shared code
  2. Reference the shared project from the main project
  3. Then i add the community toolkit to the shared code projet
  4. Then build the main project, build warnings/errors occur

See below:

C:\Users\xxx\source\repos\MainTest\MainTest\CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.Generators.TextColorToGenerator\TimePickerTextColorTo.g.shared.cs(41,89,41,124): warning CS0436: The type 'ColorAnimationExtensions_TimePicker' in 'CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.Generators.TextColorToGenerator\TimePickerTextColorTo.g.shared.cs' conflicts with the imported type 'ColorAnimationExtensions_TimePicker' in 'MainTest.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.Generators.TextColorToGenerator\TimePickerTextColorTo.g.shared.cs'.
2>C:\Users\xxx\source\repos\MainTest\MainTest\CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.Generators.TextColorToGenerator\EditorTextColorTo.g.shared.cs(41,89,41,120): warning CS0436: The type 'ColorAnimationExtensions_Editor' in 'CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.Generators.TextColorToGenerator\EditorTextColorTo.g.shared.cs' conflicts with the imported type 'ColorAnimationExtensions_Editor' in 'MainTest.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.Generators.TextColorToGenerator\EditorTextColorTo.g.shared.cs'.
2>C:\Users\xxx\source\repos\MainTest\MainTest\CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.Generators.TextColorToGenerator\PickerTextColorTo.g.shared.cs(41,89,41,120): warning CS0436: The type 'ColorAnimationExtensions_Picker' in 'CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.Generators.TextColorToGenerator\PickerTextColorTo.g.shared.cs' conflicts with the imported type 'ColorAnimationExtensions_Picker' in 'MainTest.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.Generators.TextColorToGenerator\PickerTextColorTo.g.shared.cs'.
2>C:\Users\xxx\source\repos\MainTest\MainTest\CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.Generators.TextColorToGenerator\SearchBarTextColorTo.g.shared.cs(41,89,41,123): warning CS0436: The type 'ColorAnimationExtensions_SearchBar' in 'CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.Generators.TextColorToGenerator\SearchBarTextColorTo.g.shared.cs' conflicts with the imported type 'ColorAnimationExtensions_SearchBar' in 'MainTest.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.Generators.TextColorToGenerator\SearchBarTextColorTo.g.shared.cs'.
2>C:\Users\xxx\source\repos\MainTest\MainTest\CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.Generators.TextColorToGenerator\DatePickerTextColorTo.g.shared.cs(41,89,41,124): warning CS0436: The type 'ColorAnimationExtensions_DatePicker' in 'CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.Generators.TextColorToGenerator\DatePickerTextColorTo.g.shared.cs' conflicts with the imported type 'ColorAnimationExtensions_DatePicker' in 'MainTest.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.Generators.TextColorToGenerator\DatePickerTextColorTo.g.shared.cs'.
2>C:\Users\xxx\source\repos\MainTest\MainTest\CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.Generators.TextColorToGenerator\ButtonTextColorTo.g.shared.cs(41,89,41,120): warning CS0436: The type 'ColorAnimationExtensions_Button' in 'CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.Generators.TextColorToGenerator\ButtonTextColorTo.g.shared.cs' conflicts with the imported type 'ColorAnimationExtensions_Button' in 'MainTest.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.Generators.TextColorToGenerator\ButtonTextColorTo.g.shared.cs'.
2>C:\Users\xxx\source\repos\MainTest\MainTest\CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.Generators.TextColorToGenerator\RadioButtonTextColorTo.g.shared.cs(41,89,41,125): warning CS0436: The type 'ColorAnimationExtensions_RadioButton' in 'CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.Generators.TextColorToGenerator\RadioButtonTextColorTo.g.shared.cs' conflicts with the imported type 'ColorAnimationExtensions_RadioButton' in 'MainTest.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.Generators.TextColorToGenerator\RadioButtonTextColorTo.g.shared.cs'.
2>C:\Users\xxx\source\repos\MainTest\MainTest\CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.Generators.TextColorToGenerator\EntryTextColorTo.g.shared.cs(41,89,41,119): warning CS0436: The type 'ColorAnimationExtensions_Entry' in 'CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.Generators.TextColorToGenerator\EntryTextColorTo.g.shared.cs' conflicts with the imported type 'ColorAnimationExtensions_Entry' in 'MainTest.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.Generators.TextColorToGenerator\EntryTextColorTo.g.shared.cs'.
2>C:\Users\xxx\source\repos\MainTest\MainTest\CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.Generators.TextColorToGenerator\LabelTextColorTo.g.shared.cs(41,89,41,119): warning CS0436: The type 'ColorAnimationExtensions_Label' in 'CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.Generators.TextColorToGenerator\LabelTextColorTo.g.shared.cs' conflicts with the imported type 'ColorAnimationExtensions_Label' in 'MainTest.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'CommunityToolkit.Maui.SourceGenerators\CommunityToolkit.Maui.SourceGenerators.Generators.TextColorToGenerator\LabelTextColorTo.g.shared.cs'.

Link to public reproduction project repository

https://github.com/norfus/MainTest

Environment

- .NET MAUI CommunityToolkit: 2.0 or 3.0
- OS:Windows 10
- .NET MAUI: 6 or 7

Anything else?

No response

@norfus norfus added bug Something isn't working unverified labels Dec 7, 2022
@TheCodeTraveler TheCodeTraveler linked a pull request Dec 7, 2022 that will close this issue
5 tasks
@TheCodeTraveler
Copy link
Collaborator

Fixed in #791

@norfus
Copy link
Author

norfus commented Dec 7, 2022

Great that its already fixed! Any idea when a new release will be available?

@TheCodeTraveler
Copy link
Collaborator

Thanks!

Short answer: Soon; in about a week.

Long answer: We have a high-priority bug that will be fixed within the next few days. Once the fix for #785 has been merged we will publish a new Release 👍

@norfus
Copy link
Author

norfus commented Dec 12, 2022

Great, i saw the new release and no more build errors!

Will you only support net7 forward or will there be any releases for net6?

@VladislavAntonyuk
Copy link
Collaborator

VladislavAntonyuk commented Dec 12, 2022

We do not plan downgrading to net 6.

so we nightly recommend upgrading to net 7

@github-actions github-actions bot locked and limited conversation to collaborators Nov 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants