-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
XamlC Compilation errors when upgrading to Microsoft.Maui.Controls 8.0.20 #21757
Comments
@konradzuse what is the code at offset 69? Is it complaining about The diff has changes to |
There are 2 errors, one about my style binding to the BoxView Color property, and multiple others about closing braces at offset 69. Oddly every file it complains about is offset 69, and there's nothing to note at that offset. |
We think something went wrong here: So, a workaround should be to use |
Verified this issue with Visual Studio 17.10.0 Preview 3(8.0.20). Can repro it but not repro in Maui control version:8.0.14 |
I can confirm removing {x:Type} resolves the issues in both styles and xaml Content pages. |
Facing this issue in .NET 9 Preview 3 as well while using Replacing |
I get the same "Failure to parse near offset 69" error for DataTemplates that are inside a ContentPage ResourceDictionary that use x:Type Something like:
The proposed workarounds don't resolve the issues in this case |
I take it back! The workaround does work. I had multiple DataTemplates on the same page. Updated code:
|
This fix should be available on our nightly feed if you use 8.0.21-preview.10505 https://github.com/dotnet/maui/wiki/Nightly-Builds |
Unfortunately this issue still persists in the current In our case it even occurs in a simple case like:
|
As of 8.0.40 I'm still getting the problem. 8.0.14 works fine. |
8.0.40 here, works with regular types ( but not with nested types ( |
I'm also having this issue with version 8.0.40. |
@RobTF @cat0363 could you please share an example of your failing XAML? I can't reproduce this problem with 8.0.40 anymore. @StephaneDelcroix does x:Type support nested types? (cc @Haukinger) |
@simonrozsival , Below is an example where the problem occurred.
When I changed the way to write TargetType of DataTrigger as shown below, the build error was resolved.
|
@cat0363 I'm only getting <Grid IsVisible="True">
<Grid.Triggers>
<DataTrigger TargetType="{x:Type Grid}" Binding="{Binding TestValue}" Value="1">
<Setter Property="IsVisible" Value="False"/>
</DataTrigger>
</Grid.Triggers>
</Grid> |
@simonrozsival , Sorry, I made a typo.
It might be because I didn't clean the app when it was built. |
@simonrozsival , I found a condition that causes a build error. [MainPage.xaml]
By changing the TargetType of the above DataTrigger from
The code for MainPage.xaml.cs is shown below. [MainPage.xaml.cs]
When I investigated the location where the build error occurred, I found that it was when there was a DataTrigger in the DataTemplate as shown above. |
@cat0363 can you also please share the error message you're getting? |
@simonrozsival , Thank you for your reply.
|
@simonrozsival , thank you for opening a PR for the bug fix. |
This answer helped me. I changed this code... ...for this: Thank you very much @TomSoPolaris ! |
Description
Update the Nuget packages and compile the app, various compilation errors are reported for things like this...
Error XFC0040 XamlC: Cannot convert value "Color" to "Microsoft.Maui.Controls.BindableProperty"
Other xaml files get comilation error..
Error XamlC: Input string was not in a correct format. Failure to parse near offset 69. Unexpected closing brace without a corresponding opening brace.
Despite them being perfectly valid Xaml and compiling correctly with 8.0.14
Steps to Reproduce
Link to public reproduction project repository
No response
Version with bug
8.0.20 SR4
Is this a regression from previous behavior?
No, this is something new
Last version that worked well
8.0.14 SR3.1
Affected platforms
iOS, Android
Affected platform versions
No response
Did you find any workaround?
No, removing the code presented as errors results in a new error reported in another file that was previously not reported.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: