473,387 Members | 1,536 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Exception JIT

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
5 1303
Plater
7,872 Expert 4TB
Are you able to trap that error with try/catch?
Aug 22 '08 #2
arggg
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
7,872 Expert 4TB
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
arggg
91
What exception should I try to use? I used Exception along with SystemException and it didnt work.
Aug 22 '08 #5
kenobewan
4,871 Expert 4TB
You need catch the exception as ex (eg) and exit the function/sub after displaying/writing the message...
Aug 23 '08 #6

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

Similar topics

4
by: Nicolas Fleury | last post by:
Hi, I've made a small utility to re-raise an exception with the same stack as before with additional information in it. Since I want to keep the same exception type and that some types have very...
1
by: Old Wolf | last post by:
1. What is the difference between #include <stdexcept> and #include <exception> ? 2. Is there a list somewhere of what each standard exception is used for? either to throw them, or throw...
11
by: Master of C++ | last post by:
Hi, I am writing a simulation package in C++, and so far I've written about 8000 lines of code and have about 30 classes. I haven't used C++ exceptions so far (for various reasons). The only two...
4
by: maricel | last post by:
I have the following base table structure - DDL: CREATE TABLE "ADMINISTRATOR"."T1" ( "C1" INTEGER NOT NULL ) IN "TEST_TS" ; ALTER TABLE "ADMINISTRATOR"."T1" ADD PRIMARY KEY
44
by: craig | last post by:
I am wondering if there are some best practices for determining a strategy for using try/catch blocks within an application. My current thoughts are: 1. The code the initiates any high-level...
40
by: Kevin Yu | last post by:
is it a bad programming design to throw exception in the try block then catch it??
6
by: Vadivel Kumar | last post by:
I've a problem in handling a custom exception The following is my custom exception class: public class AppException : public Exception { public AppException (string message, Exception...
3
by: JohnDeHope3 | last post by:
First let me say that I understand that Asp.Net wraps my exception in an HttpUnhandledException. I have found a lot of discussion about that on the web, which was informative, but not helpful. Let...
7
by: Sek | last post by:
Hi Folks! I was pondering over a code and noticed that exception handlers were present in the private, protected as well as public methods. And, ofcourse, public methods were calling priv/prot...
2
by: Darko Miletic | last post by:
Recently I wrote a dll in c++ and to simplify the distribution I decided to link with multithreaded static library (/MT or /MTd option). In debug everything works fine but in release I get this: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.