问题
I'm using vs2019 to create a vsix project, and add a command item after project created, that's all I did. But when I debug the project, I whill get an exception:
System.Windows.Markup.XamlParseException: 'Provide value on 'System.Windows.Markup.StaticResourceHolder' threw an exception.'
Inner Exception
Exception: Cannot find resource named 'VsTextBoxStyleKey'. Resource names are case sensitive.
Exception StackTrace:
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
Exception BaseUri:
pack://application:,,,/Microsoft.VisualStudio.Platform.WindowManagement;component/Themes/ThemedDialogStyles.xaml
I can't find this xaml from my disk, is it in a zip file? where I can find it.
InnerException StackTrace:
at System.Windows.StaticResourceExtension.ProvideValueInternal(IServiceProvider serviceProvider, Boolean allowDeferredReference)
at System.Windows.StaticResourceExtension.ProvideValue(IServiceProvider serviceProvider)
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CallProvideValue(MarkupExtension me, IServiceProvider serviceProvider)
回答1:
According to your description and the error message, this issue may result from something broken in VS IDE. (Microsoft.VisualStudio.Platform.WindowManagement;component
this indicates this is related to VS component)
So I think a VS repair and then Update it to latest VS2019 16.3.7 can help to resolve this issue.
来源:https://stackoverflow.com/questions/58619795/cannot-find-resource-named-vstextboxstylekey-resource-names-are-case-sensitiv