代码之家  ›  专栏  ›  技术社区  ›  Michal Ciechan

一个解决方案中的第二个WPF项目给出了log4Net错误

  •  3
  • Michal Ciechan  · 技术社区  · 16 年前

    我完全不明白下面的错误。

    我现在将实现自己的更新程序系统。我希望它成为我解决问题的一部分。

    我已将新的WPF应用程序添加到解决方案中,当我尝试编辑该项目中的主窗口或任何其他窗口时,会收到以下错误消息:

    /Microsoft.VisualStudio.Xaml;Component/MS/Internal/Designer/PropertyEditing/Resources/StylesCore.Constants.xaml' value cannot be assigned to property 'Source' of object 'System.Windows.ResourceDictionary'. 
    Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one of its dependencies. 
    The system cannot find the file specified.  Error at object 'ResourceDictionary_2' in markup file 'Microsoft.VisualStudio.Xaml;component/MS/Internal/Designer/PropertyEditing/Resources/StylesCore.xaml.
    

    有人有什么建议吗?

    2 回复  |  直到 16 年前
        1
  •  1
  •   IAmTimCorey    15 年前

    如果您没有在新项目中使用log4net库,只需编辑ResourceDictionary并删除对log4net库的引用。听起来您对两个WPF项目都使用了一个库,而且该库对log4net有一些引用。这就是交叉似乎来自。

        2
  •  2
  •   Karthik    14 年前

    我不太清楚为什么会发生这种情况,但是将WPF项目的TargetFramework从.NET Framework 4客户机概要文件(这是VS2010 WPF项目模板中的默认配置文件)更改为.NET Framework 4为我解决了同样的问题。我想这是因为log4netdll的dll签名(强命名)导致的。