【发布时间】:2011-05-12 22:54:00
【问题描述】:
我有 VS2003 ASP.NET Web 应用程序,当我在调试模式下执行构建/重建解决方案时,它可以完美地编译和构建,没有错误,
但是当我将模式更改为 Release 并尝试执行构建解决方案或重建解决方案时,我得到以下我引用的各种 dll 的编译错误。
我已将命名空间的名称替换为通用 xyz
找不到类型或命名空间名称“xyz”(您是否缺少 using 指令或程序集引用?)
我所有的引用都是正确的,我能够在调试模式下编译而没有任何错误。
我的操作系统是 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.
【问题讨论】:
-
输出窗口中是否有任何内容显示加载参考时出错?
-
我已经添加了输出窗口的摘录。
-
您是否有一个
#if语句,其中包含常量 DEBUG 或 RELEASE。根据您的构建配置,可能某些 using 语句会被禁用。 -
您是否仔细比较了 DEBUG 模式下的构建设置与 RELEASE 模式下的构建设置?
-
@Mike ,我的项目中没有#if 语句。
标签: visual-studio build compiler-errors