【发布时间】:2014-02-17 05:07:22
【问题描述】:
我有解决方案,它有 5 个项目。其中之一:“Project.Core.Common”(.NET Framework 3.5)。我有他们的问题。当我尝试编译时,我得到错误:
错误 79 类型或命名空间名称“服务器”不存在于 命名空间“DllFile.Logging”(您是否缺少程序集 参考?)D:\Solution\Project.Core.Common
但是这个命名空间DllFile.Logging.Server 存在。我可以通过在对象浏览器中打开 DllFile.dll 来查看它。
在我的项目中添加了对DllFile.dll 的引用。
DllFile.dll 具有 .NET FW 2.0.50727 运行时版本。
我收到了 74 条关于此 DllFile.dll 的警告:
警告 4 主要参考“DllFile.Logging.Server, Version=6.3.1.0, 文化=中性,处理器架构=MSIL”无法解决 因为它间接依赖于 .NET Framework 程序集 “mscorlib,版本=4.0.0.0,文化=中性, PublicKeyToken=b77a5c561934e089" 具有更高版本 "4.0.0.0" 比当前目标中的版本“2.0.0.0” 框架。 Project.Core.Common
但是DllFile.dll 不使用任何对第四个框架的依赖。它是用 2.0 框架编写的。
还有重要的一点:这个项目在除我之外的任何计算机上编译都没有任何错误。我检查在以下环境中编译它:
VS 2010 (Windows XP SP3 x86)
VS 2010 (Windows 7 x86)
VS 2010 (Windows 7 x64)
VS 2013 (Windows 8.1 x64)
在每台计算机上,该项目都可以正常编译。但是在我的电脑上(VS 2010 Windows XP SP3 x86)我得到了这个错误和警告。
我想做什么:
- 我完全卸载了 VS 2010 及其所有组件,然后重新安装。
- 我删除了以下文件夹:
C:\Documents and Settings\User\Local Settings\Application 数据\程序集
C:\Documents and Settings\User\Local Settings\Application Data\cache (以防万一删除)
C:\Documents and Settings\User\Local Settings\Application 数据\Microsoft\Team Foundation
C:\Documents and Settings\User\Local Settings\Application 数据\微软\VisualStudio
C:\Documents and Settings\User\Local Settings\Application 数据\微软\VSCommon
C:\Documents and Settings\User\Local Settings\Application 数据\网站缓存\
C:\Documents and Settings\User\VSWebCache
C:\文档和设置\所有用户\应用程序 Data\Microsoft\VSTAHost\SSIS_ScriptTask\9.0\ItemTemplatesCache
C:\Documents and Settings\All Users\Application Data\Microsoft\VSTAHost\SSIS_ScriptTask\9.0\ProjectTemplatesCache
C:\Documents and Settings\All Users\Application Data\VS\vs10sp1\SetupCache
- 已删除以下文件:
C:\Documents and Settings\All Users\Application Data\Microsoft\VisualStudio\10.0\vs000223.dat C:\Documents and Settings\All Users\Application Data\Microsoft\VisualStudio\10.0\1033\devenv.CTM C:\Documents and Settings\All Users\Application Data\Microsoft\VisualStudio\10.0\1033\ResourceCache.dll C:\Documents and Settings\All Users\Application Data\Microsoft\VSA\9.0\1033\ResourceCache.dll C:\Documents and Settings\All Users\Application Data\Microsoft\VSA\9.0\1033\vsaenv10.CTM C:\Documents and Settings\All Users\Application Data\Microsoft\VSTAHost\SSIS_ScriptComponent\9.0\1033\ResourceCache.dll C:\Documents and Settings\All Users\Application Data\Microsoft\VSTAHost\SSIS_ScriptTask\9.0\1033\ResourceCache.dll
- 已清除以下文件夹:
C:\Documents and Settings\User\Local Settings\Temp
- 我也尝试清除 VS 缓存。我在cmd中执行了以下命令:
cd C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE devenv /resetuserdata
但没有任何帮助。
我还能做些什么来解决我的奇怪问题? (重装Windows除外)
已编辑:
更改引用“DllFile.dll”的属性“复制本地”(真/假)没有帮助。
我尝试创建新的空项目并添加对此库“DllFile.dll”的引用,并且空项目中也存在此错误。所以问题不在我的实际项目中。
【问题讨论】:
标签: c# visual-studio-2010 visual-studio reference namespaces