none
Could not load file or assembly 'Excel' or one of its dependencies. Access is denied. RRS feed

  • 问题

  • 问题描述:

    操作系统:windows server 2003 64位

    .net FrameWork 2.0

    网站出现如下错误,删除Excel.dll网站正常,过一段时间又出现以下错误,把Excel复制到Bin目录,网站正常。

    这时的Excel.dll不是微软的程序集,

    Process information: 

        Process ID: 4372 

        Process name: w3wp.exe 

        Account name: NT AUTHORITY\NETWORK SERVICE 

     

    Exception information: 

        Exception type: ConfigurationErrorsException 

        Exception message: Could not load file or assembly 'Excel' or one of its dependencies. Access is denied. 

     

    Request information: 

        Request URL: http://climsbj.local.genewiz.com/Lab/admin/sequencelog.aspx 

        Request path: /Lab/admin/sequencelog.aspx 

        User host address: 10.105.2.35 

        User: GENEWIZ\Yixue.Wang 

        Is authenticated: True 

        Authentication Type: Negotiate 

        Thread account name: NT AUTHORITY\NETWORK SERVICE 

     

    Thread information: 

        Thread ID: 12 

        Thread account name: NT AUTHORITY\NETWORK SERVICE 

        Is impersonating: True 

        Stack trace:    at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective)

       at System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory()

       at System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai)

       at System.Web.Configuration.AssemblyInfo.get_AssemblyInternal()

       at System.Web.Compilation.CompilationUtil.GetTypeFromAssemblies(AssemblyCollection assembliesCollection, String typeName, Boolean ignoreCase)

       at System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)

       at System.Web.UI.Page.get_ScriptManagerType()

       at System.Web.UI.Page.get_IsPartialRenderingSupported()

       at System.Web.UI.WebControls.BaseValidator.RegisterValidatorCommonScript()

       at System.Web.UI.Control.PreRenderRecursiveInternal()

       at System.Web.UI.Control.PreRenderRecursiveInternal()

       at System.Web.UI.Control.PreRenderRecursiveInternal()

       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

       at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

       at System.Web.UI.Page.ProcessRequest()

       at System.Web.UI.Page.ProcessRequest(HttpContext context)

       at ASP.lab_admin_sequencelog_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\74337cf6\a17e8fca\App_Web_eowikrak.2.cs:line 0

       at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

     

    2010年9月17日 1:07

答案

  • 你好

    不知道你的Server上有沒有安裝防毒軟件? 如果有的話, 或者可以看看他的報告...

    之前我也有差不多的情況... Server 上的AVG 把我Website 中的 DLL 刪除了... 之後便出現錯誤...

    不知道你的會不會是差不多的情形..


    Chi
    2010年9月19日 7:43

全部回复

  • 你好 请检查 你网站的Web.config中关于'Excel.dll的名称,版本号等配置等是否正确以及依赖性是否存在 如果你没有使用这个Excel.dll请直接在web.config中将其相关配置信息移除
    I see you~,.NET交流群71840452 微软中文论坛同城社区成都QQ群:74268428http://hi.baidu.com/1987raymondMy Blog~~~
    2010年9月17日 1:41
    版主
  • 这个问题是网站正常运行几个小时后,就会出现,然后提示程序集找不到, 这次提示这个错误

    Server Error in '/' Application.

    Could not load file or assembly 'CLIMS.Account, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Access is denied.

    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.IO.FileLoadException: Could not load file or assembly 'CLIMS.Account, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Access is denied.

    Source Error:

    [No relevant source lines]

    Source File: c:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\3fcaacf1\5296cbfb\App_Web_default.aspx.cdcab7d2.0oazdm_n.0.cs    Line: 0

    Assembly Load Trace: The following information can be helpful to determine why the assembly 'CLIMS.Account, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' could not be loaded.

    WRN: Assembly binding logging is turned OFF.
    To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
    Note: There is some performance penalty associated with assembly bind failure logging.
    To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
    

    Stack Trace:

    [FileLoadException: Could not load file or assembly 'CLIMS.Account, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Access is denied.]
      Default2..ctor() +0
      ASP.default_aspx..ctor() in c:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\3fcaacf1\5296cbfb\App_Web_default.aspx.cdcab7d2.0oazdm_n.0.cs:0
      __ASP.FastObjectFactory_app_web_default_aspx_cdcab7d2_0oazdm_n.Create_ASP_default_aspx() in c:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\3fcaacf1\5296cbfb\App_Web_default.aspx.cdcab7d2.0oazdm_n.1.cs:0
      System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +138
      System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +50
      System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +503
      System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +142
      System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +263
    


    Version Information:  Microsoft .NET Framework Version:2.0.50727.3607; ASP.NET Version:2.0.50727.3614

     

    2010年9月19日 7:31
  • 你好

    不知道你的Server上有沒有安裝防毒軟件? 如果有的話, 或者可以看看他的報告...

    之前我也有差不多的情況... Server 上的AVG 把我Website 中的 DLL 刪除了... 之後便出現錯誤...

    不知道你的會不會是差不多的情形..


    Chi
    2010年9月19日 7:43
  • 防毒软件没有安装,网站可以正常运行几个小时,然后就出现找不到程序集,而程序集已经在BIN目录。

    重启网站后又可以运行几个小时,IIS 6.0

    2010年9月20日 1:28
  • 设法联机(IIS)中调试,临时的解决方法就是使用TryCatch,在Catch的时候拷贝一个Excel到目标文件夹。
    2010年9月20日 3:19
    版主