-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
When using .NET9 pre7 build and run, will throw System.Windows.Markup.XamlParseException #9582
Comments
I got same issue after upgrading my VS2022 preview to latest, my workaroud is installing .NET 8 SDK and adding a global.json to force .NET SDK to version 8. |
When the project is compiled with .NET 9 Preview 7, it only runs successfully with .NET 9. Unfortunately, it encounters errors on lower versions. |
We are working out the logistics on this one. Currently awaiting approval from .NET. |
My team is also being impacted by this. Commenting to get notified of any update! cc: @haileymck |
I am having this issue after upgrading VS this week. |
Apologies for the inconvenience. This happened because of regression of Setter.Value ContentProperty change.
{
"sdk": {
"version": "8.0.300"
},
}
|
This also happens in .NET framework 4.8, so it might not be isolated to .NET 9 |
|
This is affecting Visual F# Tools extension and probably many other Visual Studio extensions using WPF as they target net472: |
I have the VS 17.12.0 Preview 2 and 9.0.100-rc.1.24452.12 [C:\Program Files\dotnet\sdk], but still get the same issue? I thought this was resolved in rc1? |
@pfre017 I am unable to repro with the VS and dotnet versions mentioned. I am trying to repro with the sample repro mentioned in the issue description. Attached is a video. Let me know if there is something different with your setup or repro. |
I got it with a .NET framework 4.8 application |
@AlanHauge-Interacoustics Could you share your repro sample? |
I converted the same repro to a netfx 4.8 app and couldn't repro. There is a difference in the way we are trying to repro it. Share your repro samples and other details, so that we can take it up further. |
Same problem here but using NET48 and VS2022 Version 17.12.0 Preview 1.0. |
Thank you @singhashish-wpf. I have now got it to work. I suspect it was a my own NUGET package that was built with an old version of .net 9.0 |
Nice @pfre017 ! |
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
The text was updated successfully, but these errors were encountered: