WPF control throwing 'resource identified by the URI missing' exception

前端 未结 2 508
心在旅途
心在旅途 2021-02-12 18:37

On loading the plugin and trying to create \'XYZ\' control, the application throws the following exception:

\"The component \'XYZ\' does not have a reso

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-12 19:14

    The only way to do this would be to include the version information in your URI, so the XAML loader can distinguish the correct type. This MSDN article explains the Pack URI format, and the Version portion has this description:

    ;Version [optional]: the version of the referenced assembly that contains the resource file. This is used when two or more referenced assemblies with the same short name are loaded.

    So you'd want to use one of the following:

    /ThePluginAssembly;v1.0.0.0;component/XYZ.xaml
    /ThePluginAssembly;v1.1.0.0;component/XYZ.xaml
    

提交回复
热议问题