我有VS2003 ASP.NET Web应用程序,当我在 Debug模式下执行构建/重建解决方案时,它可以编译并完美构建而没有错误,
但是,当我将模式更改为“发布”并尝试执行“生成解决方案”或“重建解决方案”时,我正在跟踪我所引用的各种dll的编译错误。
我已用通用xyz替换了 namespace 的名称
找不到类型或 namespace 名称“xyz”(您是否缺少using指令或程序集引用?)
我所有的引用都是正确的,并且能够在 Debug模式下编译而没有任何错误。
我的操作系统是Windows Vista
有谁知道为什么我会在“发布”模式下收到此错误,以及此问题的可能解决方法?
以下是输出窗口中的示例
我已经更改了文件名,我没有更改实际错误
------ Rebuild All started: Project: XYZ, Configuration: Release .NET ------
Preparing resources...
Updating references...
Performing main compilation...
C:\xyz\a.cs(4,7): error CS0246: The type or namespace name 'ToolLib' could not be found (are you missing a using directive or an assembly reference?)
C:\xyz\a.cs(5,7): error CS0246: The type or namespace name 'ToolLib' could not be found (are you missing a using directive or an assembly reference?)
C:\xyz\a.cs(4,7): error CS0246: The type or namespace name 'ToolLib' could not be found (are you missing a using directive or an assembly reference?)
C:\xyz\a.cs(5,7): error CS0246: The type or namespace name 'ToolLib' could not be found (are you missing a using directive or an assembly reference?)
C:\xyz\a.cs(4,7): error CS0246: The type or namespace name 'ToolLib' could not be found (are you missing a using directive or an assembly reference?)
C:\xyz\a.cs(4,7): error CS0246: The type or namespace name 'ToolLib' could not be found (are you missing a using directive or an assembly reference?)
c:\xyz\b.cs(4,7): error CS0246: error CS0246: The type or namespace name 'Globals' could not be found (are you missing a using directive or an assembly reference?)
c:\xyz\c.cs(5,7): error CS0246: The type or namespace name 'ToolLib' could not be found (are you missing a using directive or an assembly reference?)
c:\xyz\d.cs(4,7): error CS0246: The type or namespace name 'Logger' could not be found (are you missing a using directive or an assembly reference?)
..........
and so on
----------
Build complete -- 26 errors, 0 warnings
Building satellite assemblies...
Satellite assemblies could not be built because the main project output is missing.
最佳答案
我关闭了解决方案,并删除了与解决方案关联的.suo文件,然后再次打开了解决方案,并且能够在调试和 Release模式下进行编译。
我没有更改解决方案中的其他任何内容。
谢谢大家的评论。