Closed jherby2k closed 5 years ago
Tested with preview4 from https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-win-x64.exe. Still broke.
I'm seeing this same error, am just putting in regular buttons instead of RibbonButtons as an ugly workaround for now.
I see the same issue:
System.Windows.Markup.XamlParseException: Provide value on 'System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception. ---> System.ArgumentException: 13px is not a valid value for Double.
Parameter name: value ---> System.FormatException: Input string was not in a correct format.
at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type)
at System.Double.Parse(String s, NumberStyles style, IFormatProvider provider)
at System.ComponentModel.DoubleConverter.FromString(String value, NumberFormatInfo formatInfo)
at System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
--- End of inner exception stack trace ---
at System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
at System.Windows.Baml2006.TypeConverterMarkupExtension.ProvideValue(IServiceProvider serviceProvider)
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CallProvideValue(MarkupExtension me, IServiceProvider serviceProvider)
--- End of inner exception stack trace ---
at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)
at System.Windows.Markup.XamlReader.RewrapException(Exception e, Uri baseUri)
at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlReader templateReader, XamlObjectWriter currentWriter)
at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlObjectWriter objectWriter)
I also hit this issue when trying to run my app with .NET Core 3.0. It occurs with other flavors of RibbonButtons as well (e.g. RibbonToggleButton
, RibbonSplitButton
, etc.). Might be related to <RibbonTwoLineText LineHeight="13px" ...>
in Generic.xaml?
Thanks everyone for commenting and letting us know about this issue! I'll investigate and see what i can find
It looks like this is a PBT issue and we we are not using the proper converter. We are using a System.ComponentModel.DoubleConverter
when we should be using System.Windows.LengthConverter
If this is a PBT issue, please assign to me. Thanks.
The markup in the minimal repro now builds and runs with the most recent SDK.
<Window x:Class="ribtest.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ribbon="clr-namespace:System.Windows.Controls.Ribbon;assembly=System.Windows.Controls.Ribbon">
<ribbon:Ribbon>
<ribbon:RibbonTab>
<ribbon:RibbonGroup>
<ribbon:RibbonButton/>
</ribbon:RibbonGroup>
</ribbon:RibbonTab>
</ribbon:Ribbon>
</Window
I see the same issue:
- https://github.com/jbe2277/waf/tree/netcoreapp3.0
- Set Samples/Writer/Writer.Presentation as StartUp project
- Run: the exception comes during starting the application
System.Windows.Markup.XamlParseException: Provide value on 'System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception. ---> System.ArgumentException: 13px is not a valid value for Double. Parameter name: value ---> System.FormatException: Input string was not in a correct format. at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type) at System.Double.Parse(String s, NumberStyles style, IFormatProvider provider) at System.ComponentModel.DoubleConverter.FromString(String value, NumberFormatInfo formatInfo) at System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value) --- End of inner exception stack trace --- at System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value) at System.Windows.Baml2006.TypeConverterMarkupExtension.ProvideValue(IServiceProvider serviceProvider) at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CallProvideValue(MarkupExtension me, IServiceProvider serviceProvider) --- End of inner exception stack trace --- at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri) at System.Windows.Markup.XamlReader.RewrapException(Exception e, Uri baseUri) at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlReader templateReader, XamlObjectWriter currentWriter) at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlObjectWriter objectWriter)
@jbe2277: Are you still seeing the error when targeting .NET core 3.0? The Writer.Presentation sample project is targeting 4.6.1. Thanks.
@ryalanms: I don't see this issue anymore with the latest .NET Core 3.0 version.
Please use the netcoreapp3.0 branch instead of master. Within this branch I have migrated the whole Win Application Framework (WAF) to .NET Core 3.
Thanks, @jbe2277. I will use that to test future changes.
Does the bug reproduce also in WPF for .NET Framework 4.8?: No
Problem description:
Can't add RibbonButtons to a Ribbon control - it throws an exception.
Actual behavior:
Expected behavior:
A Copy button is rendered
Minimal repro: