Skip to content
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

[9.0.100-preview.7.24375.12] Text-Grab launch failed with exception System.Windows.Markup.XamlParseException at System.Windows.DependencyObject.EvaluateExpression #492

Open
Junjun-zhao opened this issue Oct 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Junjun-zhao
Copy link

Describe the bug
This is a heads-up for you, when running this app with .NET 9, it fails to be launched with an exception: System.Windows.Markup.XamlParseException: ''Set property 'System.Windows.ResourceDictionary.Source' threw an exception.' Line number '17' and line position '18'.' After dev team investigated, it is reproduced as this application uses a DynamicResource incorrectly. Please see more details from dotnet/wpf#9475

To Reproduce
Steps to reproduce the behavior:
1.Open "C:\ReproAppSource\Text-Grab\Text-Grab.sln" with Visual Studio.
2. Build the solution.
3. Update bin\Debug\net8.0-windows10.0.20348.0\Text-Grab.runtimeconfig to run against with dotnet-sdk-9.0.100-preview.7.24375.12:

"frameworks": [
      {
        "name": "Microsoft.NETCore.App",
        "version": "9.0.0-preview.7.24374.12"
      },
      {
        "name": "Microsoft.WindowsDesktop.App",
        "version": "9.0.0-preview.7.24375.4"
      }
  1. Press F5 to start the app.

Expected behavior
App should be launched successfully.

Actual behavior
App launch failed with exception thrown in Visual Studio:

System.Windows.Markup.XamlParseException: ''Set property 'System.Windows.ResourceDictionary.Source' threw an exception.' Line number '17' and line position '18'.'
`
Inner Exception
InvalidOperationException: '#FF1C1C1C' is not a valid value for property 'Color'.

Stack Trace:
   at System.Windows.DependencyObject.EvaluateExpression(EntryIndex entryIndex, DependencyProperty dp, Expression expr, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry newEntry)
   at System.Windows.DependencyObject.EvaluateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry newEntry, OperationType operationType)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)
   at System.Windows.ResourceReferenceExpression.InvalidateExpressionValue(Object sender, EventArgs e)
   at System.Windows.DependencyObject.OnInheritanceContextChanged(EventArgs args)
   at System.Windows.DependencyObject.ProvideSelfAsInheritanceContext(DependencyObject doValue, DependencyProperty dp)
   at System.Windows.ResourceDictionary.AddInheritanceContextToValues()
   at System.Windows.ResourceDictionary.set_Source(Uri value)
   at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)

@Junjun-zhao Junjun-zhao added the bug Something isn't working label Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant