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

Generator for StyledProperty does not work anymore on Avalonia 11.0.0 preview6 #11

Closed
YBAZAN opened this issue Mar 24, 2023 · 10 comments
Closed
Labels
bug Something isn't working

Comments

@YBAZAN
Copy link

YBAZAN commented Mar 24, 2023

Describe the bug

In the latest pre-release of Avalonia 11 (preview 6), the prototype of the Register method with the parameter notifying is now internal.

Here a discussion on the Avalonia repo explaining the change: AvaloniaUI/Avalonia#10766

So your library cannot be used with this version and the later ones.

Steps to reproduce the bug

  1. Migrate the Avalonia nuget references to 11.0.0-preview6

The project no longer builds.

Expected behavior

No response

Screenshots

No response

NuGet package version

No response

IDE

No response

Additional context

No response

@YBAZAN YBAZAN added the bug Something isn't working label Mar 24, 2023
@HavenDV
Copy link
Owner

HavenDV commented Mar 24, 2023

While this fix is fairly trivial and is already in the process of being shipped to NuGet, I see that they have also added other changes that break the tests. Please try and let me know if this applies to you.
2b9997e

@HavenDV
Copy link
Owner

HavenDV commented Mar 24, 2023

I'm not entirely sure if the other changes will apply to older versions as well. There are two ways here - to introduce the MSBuild property DependencyPropertyGenerator_UseAvaloniaPreview, which the generator will read and generate the correct code, or wait until these versions come out of preview. I will implement the first option if there are messages from you or other users that this is necessary.

@YBAZAN
Copy link
Author

YBAZAN commented Mar 24, 2023

The 1.2.5 nuget version works thanks but now I get the message "error TRF001: Framework is not recognized"

Yet I have the constant defined in my csproj:
<DefineConstants>$(DefineConstants);HAS_AVALONIA</DefineConstants>

@HavenDV
Copy link
Owner

HavenDV commented Mar 24, 2023

Message from Intellisence or message when compiling?

@YBAZAN
Copy link
Author

YBAZAN commented Mar 24, 2023

When compiling

@YBAZAN
Copy link
Author

YBAZAN commented Mar 24, 2023

Is it something related to https://github.com/HavenDV/H.Generators.Extensions/blob/108ce2b09a42ddfd1573c78c82617419fa58df47/src/libs/H.Generators.Extensions/AnalyzerConfigOptionsProviderExtensions.cs#L141

Do I need to set particular settings in my csproj (RecognizeFramework_DefinedConstants...)?

@HavenDV
Copy link
Owner

HavenDV commented Mar 24, 2023

Yes, try setting <RecognizeFramework_DefineConstants>HAS_AVALONIA</RecognizeFramework_DefineConstants> explicitly. I still don't understand what the problem is

@HavenDV
Copy link
Owner

HavenDV commented Mar 24, 2023

Did version 1.2.4 work for you? What version did you update from?

@HavenDV
Copy link
Owner

HavenDV commented Mar 24, 2023

Perhaps your build fails for another reason, but you see not the build log, but Intellisence errors that may not be correct?

@YBAZAN
Copy link
Author

YBAZAN commented Mar 24, 2023

I've found the problem. I didn't add a reference to the DependencyPropertyGenerator package (+ DefineConstants) in the project. I thought it would consume the package as transient from a referenced project.

It was working until now, so I didn't what changed since.

BTW, it works, I'm happy !

Thank you very much for the time you've spent to help me, very appreciated :)

@HavenDV HavenDV closed this as completed Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants