编译器错误信息 CS1595

本来好好的,莫名的就出现了"编译器错误信息:CS1595",错误的全部提示如下:
说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。

编译器错误信息: CS1595: 已在多处定义“Web.Global”;使用“c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\gtgaweb_web\0548dcce\e0f80a7f\assembly\dl2\b10aefc8\dc3591a2_cecec501\Web.DLL”中的定义

源错误:


`

行 26:     
行 27:     [System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()]
行 28:     public class Global_asax : Web.Global {
行 29:         
行 30:         private static bool __initialized = false;

`

** 源文件: ** c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\gtgaweb_web\0548dcce\e0f80a7f\okrid533.0.cs ** 行: ** 28

显示详细的编译器输出:

`

c:\windows\system32\inetsrv> "c:\windows\microsoft.net\framework\v1.1.4322\csc.exe" /t:library /utf8output /R:"c:\windows\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll" /R:"c:\windows\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\gtgaweb_web\0548dcce\e0f80a7f\assembly\dl2\1c380670\f4998c13_8bcfc501\gtgaweb.entities.dll" /R:"c:\windows\assembly\gac\system.web.services\1.0.5000.0__b03f5f7f11d50a3a\system.web.services.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\gtgaweb_web\0548dcce\e0f80a7f\assembly\dl2\abf1bb90\00948557_8f88c501\microsoft.practices.enterpriselibrary.common.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\gtgaweb_web\0548dcce\e0f80a7f\assembly\dl2\b10aefc8\dc3591a2_cecec501\web.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\gtgaweb_web\0548dcce\e0f80a7f\assembly\dl2\0371b32d\14837c15_8bcfc501\gtgaweb.web.dll" /R:"c:\windows\assembly\gac\system.enterpriseservices\1.0.5000.0__b03f5f7f11d50a3a\system.enterpriseservices.dll" /R:"c:\windows\assembly\gac\system.web.mobile\1.0.5000.0__b03f5f7f11d50a3a\system.web.mobile.dll" /R:"c:\windows\assembly\gac\system.data\1.0.5000.0__b77a5c561934e089\system.data.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\gtgaweb_web\0548dcce\e0f80a7f\assembly\dl2\323c2e0e\00c1b658_8f88c501\microsoft.practices.enterpriselibrary.configuration.dll" /R:"c:\windows\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\gtgaweb_web\0548dcce\e0f80a7f\assembly\dl2\01c8b403\00376769_8f88c501\microsoft.practices.enterpriselibrary.data.dll" /R:"c:\windows\assembly\gac\system.xml\1.0.5000.0__b77a5c561934e089\system.xml.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\gtgaweb_web\0548dcce\e0f80a7f\assembly\dl2\fdd11f65\007859c3_398dc501\nettiers.configuration.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\gtgaweb_web\0548dcce\e0f80a7f\assembly\dl2\46290918\00a2ac5e_8f88c501\microsoft.practices.enterpriselibrary.caching.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\gtgaweb_web\0548dcce\e0f80a7f\assembly\dl2\314ea48b\c81a5014_8bcfc501\gtgaweb.dataaccesslayer.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\mscorlib.dll" /out:"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\gtgaweb_web\0548dcce\e0f80a7f\okrid533.dll" /D:DEBUG /debug+ /optimize- /warnaserror /w:1  "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\gtgaweb_web\0548dcce\e0f80a7f\okrid533.0.cs"


Microsoft (R) Visual C# .NET 编译器版本 7.10.6310.4
用于 Microsoft (R) .NET Framework 版本 1.1.4322
版权所有 (C) Microsoft Corporation 2001-2002。保留所有权利。

c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\gtgaweb_web\0548dcce\e0f80a7f\okrid533.0.cs(28,32): error CS1595: 已在多处定义“Web.Global”;使用“c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\gtgaweb_web\0548dcce\e0f80a7f\assembly\dl2\b10aefc8\dc3591a2_cecec501\Web.DLL”中的定义

`

显示完整的编译源:

`

行 1:    //------------------------------------------------------------------------------
行 2:    // 
行 3:    //     This code was generated by a tool.
行 4:    //     Runtime Version: 1.1.4322.2300
行 5:    //
行 6:    //     Changes to this file may cause incorrect behavior and will be lost if 
行 7:    //     the code is regenerated.
行 8:    // 
行 9:    //------------------------------------------------------------------------------
行 10:   
行 11:   namespace ASP {
行 12:       using System;
行 13:       using System.Collections;
行 14:       using System.Collections.Specialized;
行 15:       using System.Configuration;
行 16:       using System.Text;
行 17:       using System.Text.RegularExpressions;
行 18:       using System.Web;
行 19:       using System.Web.Caching;
行 20:       using System.Web.SessionState;
行 21:       using System.Web.Security;
行 22:       using System.Web.UI;
行 23:       using System.Web.UI.WebControls;
行 24:       using System.Web.UI.HtmlControls;
行 25:       
行 26:       
行 27:       [System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()]
行 28:       public class Global_asax : Web.Global {
行 29:           
行 30:           private static bool __initialized = false;
行 31:           
行 32:           public Global_asax() {
行 33:               if ((ASP.Global_asax.__initialized == false)) {
行 34:                   ASP.Global_asax.__initialized = true;
行 35:               }
行 36:           }
行 37:       }
行 38:   }
行 39:   

`


** 版本信息: ** Microsoft .NET Framework 版本:1.1.4322.2300; ASP.NET 版本:1.1.4322.2300


在网上找了一下,有一个提到解决方案如下:

以前我也有这种情况,不过那没有编译,本来程序都运行很好.用着用着就出现在这种问题了.后来我把Temporary asp.net files 里面的文件给删除了.丛启机器就好了.

另一个解决办法如下:
同时要删除项目文件夹中bin目录下所有文件再重新编译生成

这个办法我试了是可以的


有提到问题的原因认为:
导致的原因一般是重命名了虚拟目录的名称和文件夹...

但我确实并没有重命名,只在debug的目录下加了几个config文件

另一个更怪的CS1595错误我没有遇到,但我想可能会对大家有用,该作者写得很详细,请看如下
http://www.cnblogs.com/liubiqu/archive/2004/11/30/71025.aspx

Published At
Categories with Web编程
Tagged with
comments powered by Disqus