Closed AndreyAbdulkayumov closed 1 month ago
it`s not possible to build a solution if the project uses styles declared in another project
It is possible, we have plenty of these. Including DataGrid styles that are the most used.
Create a style in the project being launched
Do I understand correctly, that you create style in the executable project, and try to reference this style in the dependency? I.e. reverse depending on it? Something that is not even possible in .NET C#.
It might have been possible with reflection based StyleInclude, but we don't use that since 11.0. It shouldn't have broken suddenly in 11.1.
Could you send a sample project to make it clearer?
I created a simple example. You can download this zip archive.
And using avalonia 11.1.1 I get this errors
Yes, your ExternalProject doesn't have a dependency on BugXAML project.
It's not a bug. That's how .NET works. It was previously working only because reflection usage was permitting while unsafe.
Changed the title.
On this line we can report warning (enabled as error by default) instead of forced compile error: https://github.com/AvaloniaUI/Avalonia/blob/11.1.1/src/Markup/Avalonia.Markup.Xaml.Loader/CompilerExtensions/GroupTransformers/XamlIncludeGroupTransformer.cs#L101 By doing so users will be able to redefine error severity and continue using unsafe StyleInclude/ResourceInclude.
Yes, you're right. I moved the style to another project created as a class library. Then I added a dependency on this project to the project where this style is used. And build was successful! Issue closed. Thanks.
Describe the bug
Using Avalonia UI version 11.1.11, it`s not possible to build a solution if the project uses styles declared in another project. If you use version 11.0.12, then there is no problem.
This bug only appears if you use styles from another project. If you use the styles declared in the current project, the bug does not appear.
To Reproduce
`
Expected behavior
The solution is being successfully assembled.
Avalonia version
11.1.1
OS
Windows
Additional context
No response