【问题标题】:Vs2017: An Error Occured while finding the resource dictionary with component taggedVs2017:查找带有组件标记的资源字典时发生错误
【发布时间】:2018-07-25 09:38:02
【问题描述】:

我和这篇文章有同样的问题,但已经做了建议的更正,但没有运气:

Vs2017: An Error Occured while finding the resource dictionary

我的资源是这样的

<UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/FIT.Windows.Forms;component/Themes/Generic.xaml"/>
            </ResourceDictionary.MergedDictionaries>

但我无法预览表单:

异常文本:

查找资源字典“pack://application:,,,/FIT.Windows.Forms;component/Themes/Generic.xaml”时出错。

堆栈跟踪:

在 Microsoft.VisualStudio.DesignTools.WpfDesigner.InstanceBuilders.ResourceDictionaryInstanceBuilder.ProvideResourceDictionary(ILocalInstanceBuilderContext context, ViewNode viewNode, IDocumentRoot&relatedRoot, ResourceDictionary& originalInstance) 在 Microsoft.VisualStudio.DesignTools.WpfDesigner.InstanceBuilders.ResourceDictionaryInstanceBuilder.UpdateProperty(ILocalInstanceBuilderContext 上下文,ViewNode viewNode,IProperty propertyKey,DocumentNode valueNode) 在 Microsoft.VisualStudio.DesignTools.WpfDesigner.InstanceBuilders.ResourceDictionaryInstanceBuilder.InstantiateProperties(ILocalInstanceBuilderContext 上下文,ViewNode viewNode,DocumentCompositeNode 复合节点) 在 Microsoft.VisualStudio.DesignTools.Designer.InstanceBuilders.DictionaryInstanceBuilder.Initialize(ILocalInstanceBuilderContext 上下文,ViewNode viewNode,布尔 isNewInstance) 在 Microsoft.VisualStudio.DesignTools.Designer.InstanceBuilders.LocalInstanceManager.InitializeInstance(IInstanceBuilder builder, ViewNode viewNode, Boolean isNewInstance)

【问题讨论】:

  • 您好,请将异常作为文本发布为您的问题的edit
  • 嗨,这只发生在新的 VS 2017 中。
  • 您最近是否迁移过解决方案?如果是这样,请尝试删除 binobj 文件夹,完全重建后可能会解决问题。

标签: c# visual-studio


【解决方案1】:

感谢您的帮助。

我的解决方案附带了一个来自 sctrach 的新解决方案文件。 这似乎可以解决问题。

【讨论】:

    【解决方案2】:

    对我来说这是一种解决方法:

    1. 从您的项目中排除受影响的文件并将其重新包含进来
    2. 保存并构建解决方案

    如果资源文件以前工作过并且“随机”不再可访问,则此方法有效。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-01
      • 1970-01-01
      • 2023-04-03
      相关资源
      最近更新 更多