调试遇到一个问题:
未能加载文件或程序集“Sanrx.BLL”或它的某一个依赖项。系统找不到指定的文件。
为解决上述问题,我想查看【程序集加载跟踪】,但显示关闭。如下:
程序集加载跟踪: 
警告: 程序集绑定日志记录被关闭。
要启用程序集绑定失败日志记录,请将注册表值 [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD)设置为 1。
注意: 会有一些与程序集绑定失败日志记录关联的性能损失。
要关闭此功能,请移除注册表值 [HKLM\Software\Microsoft\Fusion!EnableLog]。上述注册表根本找不到相关的设置项,谁知道如何打开? 

解决方案 »

  1.   

    http://topic.csdn.net/u/20081020/21/83ae48e0-f828-4794-b009-90d07a3861a6.html
    这个问题和你一样
    呵呵~~
      

  2.   

    这个问题也是我提的。上次的代码放在app_code之外,要编译陈DLL并添加引用才可以。
    这次不一样,代码都放进app_code,没必要添加引用吧。
      

  3.   

    See the end of this message for details on invoking 
    just-in-time (JIT) debugging instead of this dialog box.************** Exception Text **************
    System.IO.FileNotFoundException: Could not load file or assembly 'EDXJM, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. 系统找不到指定的文件。
    File name: 'EDXJM, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
       at test1.Form1.IsInValid(Int32& iState)
       at test1.Form1.Form1_Load(Object sender, EventArgs e)
       at System.Windows.Forms.Form.OnLoad(EventArgs e)
       at System.Windows.Forms.Form.OnCreateControl()
       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       at System.Windows.Forms.Control.CreateControl()
       at System.Windows.Forms.Control.WmShowWindow(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at System.Windows.Forms.ContainerControl.WndProc(Message& m)
       at System.Windows.Forms.Form.WmShowWindow(Message& m)
       at System.Windows.Forms.Form.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)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].************** Loaded Assemblies **************
    mscorlib
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.3603 (GDR.050727-3600)
        CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    ----------------------------------------
    test1
        Assembly Version: 1.0.0.0
        Win32 Version: 1.0.0.0
        CodeBase: file:///I:/抢号软件.exe
    ----------------------------------------
    System.Windows.Forms
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Drawing
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------************** JIT Debugging **************
    To enable just-in-time (JIT) debugging, the .config file for this
    application or computer (machine.config) must have the
    jitDebugging value set in the system.windows.forms section.
    The application must also be compiled with debugging
    enabled.For example:<configuration>
        <system.windows.forms jitDebugging="true" />
    </configuration>When JIT debugging is enabled, any unhandled exception
    will be sent to the JIT debugger registered on the computer
    rather than be handled by this dialog box.
      

  4.   

    我也出现啦:
    程序集绑定日志记录被关闭。
    要启用程序集绑定失败日志记录,请将注册表值 [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD)设置为 1。
    注意: 会有一些与程序集绑定失败日志记录关联的性能损失。
    要关闭此功能,请移除注册表值 [HKLM\Software\Microsoft\Fusion!EnableLog]。
      

  5.   

    ************** 异常文本 **************
    System.IO.FileNotFoundException: 未能加载文件或程序集“Manage.BLL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null”或它的某一个依赖项。系统找不到指定的文件。
    文件名:“Manage.BLL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null”
       在 ManageSo.Login.btnLogin_Click(Object sender, EventArgs e)
       在 System.Windows.Forms.Control.OnClick(EventArgs e)
       在 System.Windows.Forms.Button.OnClick(EventArgs e)
       在 System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       在 System.Windows.Forms.Control.WndProc(Message& m)
       在 System.Windows.Forms.ButtonBase.WndProc(Message& m)
       在 System.Windows.Forms.Button.WndProc(Message& m)
       在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)警告: 程序集绑定日志记录被关闭。
    要启用程序集绑定失败日志记录,请将注册表值 [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD)设置为 1。
    注意: 会有一些与程序集绑定失败日志记录关联的性能损失。
    要关闭此功能,请移除注册表值 [HKLM\Software\Microsoft\Fusion!EnableLog]。************** 已加载的程序集 **************
    mscorlib
        程序集版本: 2.0.0.0
        Win32 版本: 2.0.50727.3615 (GDR.050727-3600)
        基本代码: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    ----------------------------------------
    ManageSo
        程序集版本: 1.0.0.0
        Win32 版本: 1.0.0.0
        基本代码: file:///C:/Documents%20and%20Settings/ksbio/「开始」菜单/程序/管理系统/ManageSo.exe
    ----------------------------------------
    System.Windows.Forms
        程序集版本: 2.0.0.0
        Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
        基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System
        程序集版本: 2.0.0.0
        Win32 版本: 2.0.50727.3614 (GDR.050727-3600)
        基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Drawing
        程序集版本: 2.0.0.0
        Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
        基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    System.Configuration
        程序集版本: 2.0.0.0
        Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
        基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    ----------------------------------------
    System.Xml
        程序集版本: 2.0.0.0
        Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
        基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------
    System.Windows.Forms.resources
        程序集版本: 2.0.0.0
        Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
        基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_zh-CHS_b77a5c561934e089/System.Windows.Forms.resources.dll
    ----------------------------------------
    mscorlib.resources
        程序集版本: 2.0.0.0
        Win32 版本: 2.0.50727.3615 (GDR.050727-3600)
        基本代码: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    ----------------------------------------************** JIT 调试 **************
    要启用实时(JIT)调试,
    该应用程序或计算机的 .config 文件(machine.config)的 system.windows.forms 节中必须设置
    jitDebugging 值。
    编译应用程序时还必须启用
    调试。例如: <configuration>
        <system.windows.forms jitDebugging="true" />
    </configuration>启用 JIT 调试后,任何无法处理的异常
    都将被发送到在此计算机上注册的 JIT 调试器,
    而不是由此对话框处理。
      

  6.   

    有关调用实时(JIT)调试而不是此对话框的详细信息,
    请参见此消息的结尾。************** 异常文本 **************
    System.Configuration.ConfigurationErrorsException: 创建 userSettings/Microsoft.SqlServer.Configuration.LandingPage.Properties.Settings 的配置节处理程序时出错: 未能加载文件或程序集“System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”或它的某一个依赖项。系统找不到指定的文件。 (C:\Users\Administrator\AppData\Local\Microsoft_Corporation\LandingPage.exe_StrongName_ryspccglaxmt4nhllj5z3thycltsvyyx\10.0.0.0\user.config line 5) ---> System.IO.FileNotFoundException: 未能加载文件或程序集“System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”或它的某一个依赖项。系统找不到指定的文件。
    文件名:“System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”
       在 System.Configuration.TypeUtil.GetTypeWithReflectionPermission(IInternalConfigHost host, String typeString, Boolean throwOnError)
       在 System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.Init(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord)
       在 System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.InitWithRestrictedPermissions(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord)
       在 System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory..ctor(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord)
       在 System.Configuration.RuntimeConfigurationRecord.CreateSectionFactory(FactoryRecord factoryRecord)
       在 System.Configuration.BaseConfigurationRecord.FindAndEnsureFactoryRecord(String configKey, Boolean& isRootDeclaredHere)警告: 程序集绑定日志记录被关闭。
    要启用程序集绑定失败日志记录,请将注册表值 [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD)设置为 1。
    注意: 会有一些与程序集绑定失败日志记录关联的性能损失。
    要关闭此功能,请移除注册表值 [HKLM\Software\Microsoft\Fusion!EnableLog]。   --- 内部异常堆栈跟踪的结尾 ---
       在 System.Configuration.BaseConfigurationRecord.FindAndEnsureFactoryRecord(String configKey, Boolean& isRootDeclaredHere)
       在 System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
       在 System.Configuration.BaseConfigurationRecord.GetSection(String configKey, Boolean getLkg, Boolean checkPermission)
       在 System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
       在 System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName)
       在 System.Configuration.ConfigurationManager.GetSection(String sectionName)
       在 System.Configuration.ClientSettingsStore.ReadSettings(String sectionName, Boolean isUserScoped)
       在 System.Configuration.LocalFileSettingsProvider.GetPropertyValues(SettingsContext context, SettingsPropertyCollection properties)
       在 System.Configuration.SettingsBase.GetPropertiesFromProvider(SettingsProvider provider)
       在 System.Configuration.SettingsBase.GetPropertyValueByName(String propertyName)
       在 System.Configuration.SettingsBase.get_Item(String propertyName)
       在 System.Configuration.ApplicationSettingsBase.GetPropertyValue(String propertyName)
       在 System.Configuration.ApplicationSettingsBase.get_Item(String propertyName)
       在 Microsoft.SqlServer.Configuration.LandingPage.Properties.Settings.get_WindowPlacement()
       在 Microsoft.SqlServer.Configuration.LandingPage.LandingPageForm.OnLoad(EventArgs e)
       在 System.Windows.Forms.Form.OnCreateControl()
       在 System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       在 System.Windows.Forms.Control.CreateControl()
       在 System.Windows.Forms.Control.WmShowWindow(Message& m)
       在 System.Windows.Forms.Control.WndProc(Message& m)
       在 System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       在 System.Windows.Forms.ContainerControl.WndProc(Message& m)
       在 System.Windows.Forms.Form.WmShowWindow(Message& m)
       在 System.Windows.Forms.Form.WndProc(Message& m)
       在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    ************** 已加载的程序集 **************
    mscorlib
        程序集版本: 2.0.0.0
        Win32 版本: 2.0.50727.4952 (win7RTMGDR.050727-4900)
        基本代码: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    ----------------------------------------
    mscorlib.resources
        程序集版本: 2.0.0.0
        Win32 版本: 2.0.50727.4952 (win7RTMGDR.050727-4900)
        基本代码: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    ----------------------------------------
    LandingPage
        程序集版本: 10.0.0.0
        Win32 版本: 10.0.1766.0 ((Katmai_RTM_QFE-OD).080930-1348 )
        基本代码: file:///E:/sql/SQLManagementStudio_x86_CHS/x86/LandingPage.exe
    ----------------------------------------
    System.Windows.Forms
        程序集版本: 2.0.0.0
        Win32 版本: 2.0.50727.4927 (NetFXspW7.050727-4900)
        基本代码: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System
        程序集版本: 2.0.0.0
        Win32 版本: 2.0.50727.4927 (NetFXspW7.050727-4900)
        基本代码: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Drawing
        程序集版本: 2.0.0.0
        Win32 版本: 2.0.50727.4927 (NetFXspW7.050727-4900)
        基本代码: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    Microsoft.SqlServer.Configuration.Sco
        程序集版本: 10.0.0.0
        Win32 版本: 10.0.1794.0 ((Katmai_RTM_QFE-CU).090213-1713 )
        基本代码: file:///E:/sql/SQLManagementStudio_x86_CHS/x86/Microsoft.SqlServer.Configuration.Sco.DLL
    ----------------------------------------
    LandingPage.resources
        程序集版本: 10.0.0.0
        Win32 版本: 10.0.1600.22 ((SQL_PreRelease).080709-1414 )
        基本代码: file:///E:/sql/SQLManagementStudio_x86_CHS/x86/zh-CHS/LandingPage.resources.DLL
    ----------------------------------------
    Microsoft.SqlServer.Chainer.Infrastructure
        程序集版本: 10.0.0.0
        Win32 版本: 10.0.1794.0 ((Katmai_RTM_QFE-CU).090213-1713 )
        基本代码: file:///E:/sql/SQLManagementStudio_x86_CHS/x86/Microsoft.SqlServer.Chainer.Infrastructure.DLL
    ----------------------------------------
    System.Xml
        程序集版本: 2.0.0.0
        Win32 版本: 2.0.50727.4927 (NetFXspW7.050727-4900)
        基本代码: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------
    Accessibility
        程序集版本: 2.0.0.0
        Win32 版本: 2.0.50727.4927 (NetFXspW7.050727-4900)
        基本代码: file:///C:/Windows/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
    ----------------------------------------
    Microsoft.SqlServer.Management.Controls
        程序集版本: 10.0.0.0
        Win32 版本: 10.0.1600.22 ((SQL_PreRelease).080709-1414 )
        基本代码: file:///E:/sql/SQLManagementStudio_x86_CHS/x86/Microsoft.SqlServer.Management.Controls.DLL
    ----------------------------------------
    System.Configuration
        程序集版本: 2.0.0.0
        Win32 版本: 2.0.50727.4927 (NetFXspW7.050727-4900)
        基本代码: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    ----------------------------------------
    system.configuration.resources
        程序集版本: 2.0.0.0
        Win32 版本: 2.0.50727.4927 (NetFXspW7.050727-4900)
        基本代码: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration.resources/2.0.0.0_zh-CHS_b03f5f7f11d50a3a/System.Configuration.resources.dll
    ----------------------------------------
    System.Windows.Forms.resources
        程序集版本: 2.0.0.0
        Win32 版本: 2.0.50727.4927 (NetFXspW7.050727-4900)
        基本代码: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_zh-CHS_b77a5c561934e089/System.Windows.Forms.resources.dll
    ----------------------------------------************** JIT 调试 **************
    要启用实时(JIT)调试,
    该应用程序或计算机的 .config 文件(machine.config)的 system.windows.forms 节中必须设置
    jitDebugging 值。
    编译应用程序时还必须启用
    调试。例如: <configuration>
        <system.windows.forms jitDebugging="true" />
    </configuration>启用 JIT 调试后,任何无法处理的异常
    都将被发送到在此计算机上注册的 JIT 调试器,
    而不是由此对话框处理。
      

  7.   

    楼主看一下你的IIS中的默认网站的路径是什么,如果曾做过改变的话,请把它改回“C:\Inetpub\wwwroot”(初始值),然后重启IIS,删除掉缓存目录(应该在类似“C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files”路径里,删除掉里面的所有文件夹),再次访问网站试试。我之前遇到的问题就是这样解决的。