首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()]

2011-12-10 
在调试.net源程序中出现的问题,请大家给予帮助.我在用IIS调试.net源程序时出现以下问题ServerErrorin/Appl

在调试.net源程序中出现的问题,请大家给予帮助.
我在用IIS调试.net源程序时出现以下问题

Server   Error   in   '/ '   Application.
--------------------------------------------

Common   Language   Runtime   detected   an   invalid   program.  
Description:   An   unhandled   exception   occurred   during   the   execution   of   the   current   web   request.   Please   review   the   stack   trace   for   more   information   about   the   error   and   where   it   originated   in   the   code.  

Exception   Details:   System.InvalidProgramException:   Common   Language   Runtime   detected   an   invalid   program.

Source   Error:  


Line   30:                   private   static   bool   __initialized   =   false;
Line   31:                  
Line   32:                   public   Global_asax()   {
Line   33:                           if   ((ASP.Global_asax.__initialized   ==   false))   {
Line   34:                                   ASP.Global_asax.__initialized   =   true;
 

Source   File:   c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary   ASP.NET   Files\root\8073f566\7100ac34\r4tmt9vb.0.cs         Line:   32  

Stack   Trace:  


[InvalidProgramException:   Common   Language   Runtime   detected   an   invalid   program.]
      TourOnline.Global..ctor()   +0
      ASP.Global_asax..ctor()   in   c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary   ASP.NET   Files\root\8073f566\7100ac34\r4tmt9vb.0.cs:32

[TargetInvocationException:   Exception   has   been   thrown   by   the   target   of   an   invocation.]
      System.RuntimeType.CreateInstanceImpl(Boolean   publicOnly)   +0
      System.Activator.CreateInstance(Type   type,   Boolean   nonPublic)   +66
      System.RuntimeType.CreateInstanceImpl(BindingFlags   bindingAttr,   Binder   binder,   Object[]   args,   CultureInfo   culture,   Object[]   activationAttributes)   +655
      System.Activator.CreateInstance(Type   type,   BindingFlags   bindingAttr,   Binder   binder,   Object[]   args,   CultureInfo   culture,   Object[]   activationAttributes)   +200
      System.Web.HttpApplicationFactory.GetSpecialApplicationInstance()   +160
      System.Web.HttpApplicationFactory.FireApplicationOnStart(HttpContext   context)   +20
      System.Web.HttpApplicationFactory.Init(HttpContext   context)   +497
      System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext   context)   +170
      System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest   wr)   +414

 
我根据错误的提示找到了r4tmt9vb.0.cs文件,请帮忙看看是什么原因导致,谢谢!



//------------------------------------------
//   <autogenerated>
//           This   code   was   generated   by   a   tool.
//           Runtime   Version:   1.1.4322.573
//
//           Changes   to   this   file   may   cause   incorrect   behavior   and   will   be   lost   if  
//           the   code   is   regenerated.
//   </autogenerated>
//------------------------------------------

namespace   ASP   {
        using   System;
        using   System.Collections;
        using   System.Collections.Specialized;
        using   System.Configuration;
        using   System.Text;
        using   System.Text.RegularExpressions;
        using   System.Web;
        using   System.Web.Caching;
        using   System.Web.SessionState;
        using   System.Web.Security;
        using   System.Web.UI;
        using   System.Web.UI.WebControls;
        using   System.Web.UI.HtmlControls;
       
       
        [System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()]
        public   class   Global_asax   :   TourOnline.Global   {
               
                private   static   bool   __initialized   =   false;
               
                public   Global_asax()   {
                        if   ((ASP.Global_asax.__initialized   ==   false))   {
                                ASP.Global_asax.__initialized   =   true;
                        }
                }
        }
}


[解决办法]
这类问题,大多数先检查权限和路径(绝对或者相对),个别时候检查安全设置、缓冲池的设定——经验
[解决办法]
环境不对吧,你是不是在.net framework 2下开发的程序阿

热点排行