-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Fix: Fixed SourceGenerator build failure #12471
Conversation
We do not use Any CPU.
|
@0x5bfa I am sorry. I understand what you mean, but these options must be specified. It is necessary for a Source Generator(analyzer) project. According to MSDN.
And As for the AnyCPU config. I don't mean to use it. But if I use x86, x64 or arm64, it will build failed with |
Thank you for telling those. In any way, can you remove changes from PathBreadcrumb.xaml.cs for a while? Unfortunately, adding Any CPU is not fundamental issue resolving. Files/src/Files.App/UserControls/PathBreadcrumb.xaml.cs Lines 13 to 20 in 9fab836
|
I can do it. But I'm concerned that someone has already developed based on the modified PathBreadCrumb.xaml.cs, which could lead to conflicts if I remove it. |
No worries. The reason why I decided to use this file for a test is this file has much less commit history, as you can see it, there is no functional update in the past months. You can
|
hmm, actually we have already add AnyCPU config, this PR does not add a new config. And ms recommends to use AnyCPU in an analyzer project.
Ok I will remove it. Lines 377 to 406 in 40a0f0f
|
Oh really? Then keep it please sorry.
Can you link? |
Sorry, I am not sure if it is mentioned in MSDN. But if you look at any repos, they all use AnyCPU. Such as Roslyn or CommunityToolkit. |
@Poker-sang I am totally sorry for the inconvenience! Can you keep it(Revert the latest commit)? |
@yaira2 '@Poker-sang' found the way to make the compiler successful instead of discarding all changes. |
No problem |
I only tested GitHub Action and it was successful, I don't know if Azure Pipeline will be fine, hopefully no issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you!🎉
@Poker-sang thank you for the quick fix! |
I think I know why it is configured with AnyCPU. As I said it is an analyzer project and will not be compiled into the application. The DLL it generates will only be loaded by the VS or dotnet compiler. So the target platform of the DLL depends on the CPU architecture of the computer where the code is compiled and not on the user's computer. For example, my computer should be configured with x64, while Azure server might use Arm64. For convenience and without specifying a particular configuration, AnyCPU is the best. That's why x86 and Arm64 were wrong before. Because they used x86 or Arm64 configurations, while Azure and Github servers are x64 |
Oh thank you for the long response, and I finally fully understand the reason why. I will add that comment to the project file to mention that. |
@Poker-sang Do you think we can change the attribution to following way? [DependencyProperty]
public ToolbarViewModel ViewModel { get; set; } Inspiration: |
Sure. It seems a way to have better readability. And we can even put comments on it. |
It's nice to hear. Would you like to work on? |
Maybe we can open an issue first. And I will work on it in a few days. Are you in a hurry to need this? |
Not at all, take your time please. Issued #12889. |
Resolved / Related Issues
Related: Code Quality: Use SourceGenerator to simplify
DependencyProperty
#11587 (comment)Validation
How did you test these changes?
Screenshots