c# - Windows 8 上 VS2012 中的依赖引用问题

标签 c# .net windows-8 visual-studio-2012 log4net

我有几个项目的解决方案,其中许多项目都引用了 Apache 的 log4net。我目前正在尝试构建其中一个项目(一个类库)来解决我遇到的引用问题,但还没有成功。

只有在 Windows 8 上的 VS2012 中构建时才会出现警告和错误,而在 Windows 7 上的 VS2010 中不会出现。

有人知道我该如何解决这个问题吗?这是警告消息;

The primary reference "log4net" could not be resolved because it was built against the ".NETFramework,Version=v4.0.1,Profile=Client" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client".

错误信息如下:

The type or namespace name 'log4net' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Rune\Documents\Team Foundation Server\noOdin\Yggdrasil\OdinLib\Common.cs

The type or namespace name 'ILog' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Rune\Documents\Team Foundation Server\noOdin\Yggdrasil\OdinLib\Common.cs

我现在忽略这些错误,因为它们是未加载 log4net 引用的结果。

引用包含在我的 .csproj 文件中,如下所示:

<Reference Include="log4net"><HintPath>..\..\Dependencies\log4net.dll</HintPath></Reference>

因此,问题确实是我收到的警告,因为它似乎在我的 Dependencies 文件夹中找到了我的 log4net.dll 文件。

有人知道我该如何解决吗?

请务必询问您是否需要更多信息。

最佳答案

<SpecificVersion>False</SpecificVersion>在强制使用特定版本的 log4net 的 csproj 文件中丢失-图书馆。

将此答案添加到未回答列表中的问题 :)

关于c# - Windows 8 上 VS2012 中的依赖引用问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13544600/

相关文章:

pdf - 从 WinJS 应用程序打开 PDF 文件

c# - 使用 LINQ 仅基于单个对象属性获取两个对象列表之间的差异

c# - 通过代码运行MSBUILD并获得异步进度

c# - 在远程机器上使用 Assembly.LoadFrom() 加载的程序集导致 SecurityException

c# - 正则表达式匹配 IP

.NET 最佳实践?

windows - 如何使用 NSSM

android - 数据库兼容性 : Building a database to support apps across multiple OSs

c# - 在 C# 中编码(marshal) C++ wchar_t**

c# - 错误 "A template containing a class feature must end with a class feature"