-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Description
When using the above code, an error will be thrown
System.Windows.Markup.XamlParseException
HResult=0x80131501
Message=“在“System.Windows.StaticResourceExtension”上提供值时引发了异常。”,行号为“12”,行位置为“10”。
Source=PresentationFramework
StackTrace:
在 System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)
在 System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
在 System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
在 System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
在 System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
在 WpfBugTest.MainWindow.InitializeComponent() 在 D:\wcsrepo\WpfBugTest\MainWindow.xaml 中: 第 1 行
此异常最初是在此调用堆栈中引发的:
[外部代码]
内部异常 1:
IndexOutOfRangeException: Index was outside the bounds of the array.
Reproduction Steps
https://github.com/ssccinng/WpfBugTest
Run it using the latest preview version
Please note that this error does not occur when selecting net9 for the targetframework, but only when selecting net8
net8.0-windows
Expected behavior
not throw error
Actual behavior
throw error
Regression?
No response
Known Workarounds
No response
Impact
No response
Configuration
No response
Other information
No response
