By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,725 Members | 1,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,725 IT Pros & Developers. It's quick & easy.

Exception JIT

P: 91
I want to make my program so if the dll cannot be found the program will not continue to load. Right now it gives the option to either quit or to continue. I want to make it so the user cannot continue if the dll cannot be loaded.

I am including the dll i made by Using namespace;

Expand|Select|Wrap|Line Numbers
  1. See the end of this message for details on invoking 
  2. just-in-time (JIT) debugging instead of this dialog box.
  3.  
  4. ************** Exception Text **************
  5. System.IO.FileNotFoundException: Could not load file or assembly 'PB_Sock, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
  6. File name: 'PB_Sock, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
  7.    at PB_Login.Login..ctor()
  8.    at WindowsFormsApplication1.MainGUI.MainGUI_Load(Object sender, EventArgs e) in C:\Users\Brian\Documents\Visual Studio 2008\Projects\PATc\PATc\MainGUI.cs:line 22
  9.    at System.Windows.Forms.Form.OnLoad(EventArgs e)
  10.    at System.Windows.Forms.Form.OnCreateControl()
  11.    at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
  12.    at System.Windows.Forms.Control.CreateControl()
  13.    at System.Windows.Forms.Control.WmShowWindow(Message& m)
  14.    at System.Windows.Forms.Control.WndProc(Message& m)
  15.    at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
  16.    at System.Windows.Forms.ContainerControl.WndProc(Message& m)
  17.    at System.Windows.Forms.Form.WmShowWindow(Message& m)
  18.    at System.Windows.Forms.Form.WndProc(Message& m)
  19.    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
  20.    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
  21.    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
  22.  
  23. WRN: Assembly binding logging is turned OFF.
  24. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
  25. Note: There is some performance penalty associated with assembly bind failure logging.
  26. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
  27.  
  28.  
  29.  
  30. ************** Loaded Assemblies **************
  31. mscorlib
  32.     Assembly Version: 2.0.0.0
  33.     Win32 Version: 2.0.50727.1434 (REDBITS.050727-1400)
  34.     CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
  35. ----------------------------------------
  36. PATc
  37.     Assembly Version: 1.0.0.0
  38.     Win32 Version: 1.0.0.0
  39.     CodeBase: file:///C:/Users/Brian/Documents/Visual%20Studio%202008/Projects/PATc/PATc/bin/Release/PATc.exe
  40. ----------------------------------------
  41. System.Windows.Forms
  42.     Assembly Version: 2.0.0.0
  43.     Win32 Version: 2.0.50727.1434 (REDBITS.050727-1400)
  44.     CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
  45. ----------------------------------------
  46. System
  47.     Assembly Version: 2.0.0.0
  48.     Win32 Version: 2.0.50727.1434 (REDBITS.050727-1400)
  49.     CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
  50. ----------------------------------------
  51. System.Drawing
  52.     Assembly Version: 2.0.0.0
  53.     Win32 Version: 2.0.50727.1434 (REDBITS.050727-1400)
  54.     CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
  55. ----------------------------------------
  56.  
  57. ************** JIT Debugging **************
  58. To enable just-in-time (JIT) debugging, the .config file for this
  59. application or computer (machine.config) must have the
  60. jitDebugging value set in the system.windows.forms section.
  61. The application must also be compiled with debugging
  62. enabled.
  63.  
  64. For example:
  65.  
  66. <configuration>
  67.     <system.windows.forms jitDebugging="true" />
  68. </configuration>
  69.  
  70. When JIT debugging is enabled, any unhandled exception
  71. will be sent to the JIT debugger registered on the computer
  72. rather than be handled by this dialog box.
  73.  
Aug 22 '08 #1
Share this Question
Share on Google+
5 Replies


Plater
Expert 5K+
P: 7,872
Are you able to trap that error with try/catch?
Aug 22 '08 #2

P: 91
Are you able to trap that error with try/catch?
What exception should I use?

I can use a try catch however it still lets me use Continue
Aug 22 '08 #3

Plater
Expert 5K+
P: 7,872
Well if the try/catch block can ACTUALLY catch the exception, then you can handle it however you like.
Since the stack trace shows user code as the topmost, I would think that you could trap it with a try/catch
Aug 22 '08 #4

P: 91
What exception should I try to use? I used Exception along with SystemException and it didnt work.
Aug 22 '08 #5

kenobewan
Expert 2.5K+
P: 4,871
You need catch the exception as ex (eg) and exit the function/sub after displaying/writing the message...
Aug 23 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.