Errors after upgrading project to vs2022
Posted: 03 Oct 2023, 06:43
Hi,
I was trying to upgrade our blend project from visual studio 2019 to visual studio 2022. We had to make a single change to the project to get it to load:
we changed:
to:
Now that it loads, we can build, and there are no errors. However, if we open any xaml that is using a style pulled in from app.xaml, it appears that it cannot be found.
Here's an example of code that worked find in vs2019 but is giving us an error in vs2022:
The error is a bit cryptic:
However, I have found that if I import the app resources xaml file at the top of the user control, the errors go away:
Is there any way to fix this? Or has anyone else encountered this? I suppose I could add the resource dictionary to the top of all my user controls -- it just seems bad that I'd have to do that. It seems like without it, though, blend is missing all the items defined in that resource dictionary.
thanks,
sam
I was trying to upgrade our blend project from visual studio 2019 to visual studio 2022. We had to make a single change to the project to get it to load:
we changed:
Code: Select all
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
Code: Select all
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>Here's an example of code that worked find in vs2019 but is giving us an error in vs2022:
Code: Select all
<TextBlock Text="{Binding Foo}" Style="{StaticResource Text.Caption}" />
Code: Select all
XDG0010 'StaticResourceExtension' is not valid for Setter.Value. The only supported MarkupExtension types are DynamicResourceExtension and BindingBase or derived types.
Code: Select all
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Assets/Scripts/Runtime/Client/UI/AppResources.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
thanks,
sam