AlHal2
asked on
Problem with Filesystemobject or .NET version
This code works on my local machine, but not the server.
Dim Odrive As System.IO.DriveInfo
Odrive = My.Computer.FileSystem.Get DriveInfo( "H:\")
The code is enclosed in a try catch block, but I still get an unhandled error exception "Input string not in the correct format". Here is the stack information.
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumb er(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(S tring s, NumberStyles style, NumberFormatInfo info)
at System.Convert.ToInt32(Str ing value)
at DiskRoom.Form1.Form1_Load( Object sender, EventArgs e)
at System.EventHandler.Invoke (Object sender, EventArgs e)
at System.Windows.Forms.Form. OnLoad(Eve ntArgs e)
at System.Windows.Forms.Form. OnCreateCo ntrol()
at System.Windows.Forms.Contr ol.CreateC ontrol(Boo lean fIgnoreVisible)
at System.Windows.Forms.Contr ol.CreateC ontrol()
at System.Windows.Forms.Contr ol.WmShowW indow(Mess age& m)
at System.Windows.Forms.Contr ol.WndProc (Message& m)
at System.Windows.Forms.Scrol lableContr ol.WndProc (Message& m)
at System.Windows.Forms.Conta inerContro l.WndProc( Message& m)
at System.Windows.Forms.Form. WmShowWind ow(Message & m)
at System.Windows.Forms.Form. WndProc(Me ssage& m)
at System.Windows.Forms.Contr ol.Control NativeWind ow.OnMessa ge(Message & m)
at System.Windows.Forms.Contr ol.Control NativeWind ow.WndProc (Message& m)
at System.Windows.Forms.Nativ eWindow.Ca llback(Int Ptr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.36366 built by: FX452RTMLDR
CodeBase: file:///C:/Windows/Microso ft.NET/Fra mework/v4. 0.30319/ms corlib.dll
-------------------------- ---------- ----
DiskRoom
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///O:/Loaders/Global/ DataStream /DiskRoom/ DiskRoom.e xe
-------------------------- ---------- ----
Microsoft.VisualBasic
Assembly Version: 10.0.0.0
Win32 Version: 12.0.20806.33440 built by: FX45W81RTMREL
CodeBase: file:///C:/windows/Microso ft.Net/ass embly/GAC_ MSIL/Micro soft.Visua lBasic/v4. 0_10.0.0.0 __b03f5f7f 11d50a3a/M icrosoft.V isualBasic .dll
-------------------------- ---------- ----
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.36366 built by: FX452RTMLDR
CodeBase: file:///C:/windows/Microso ft.Net/ass embly/GAC_ MSIL/Syste m/v4.0_4.0 .0.0__b77a 5c561934e0 89/System. dll
-------------------------- ---------- ----
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.36366 built by: FX452RTMLDR
CodeBase: file:///C:/windows/Microso ft.Net/ass embly/GAC_ MSIL/Syste m.Core/v4. 0_4.0.0.0_ _b77a5c561 934e089/Sy stem.Core. dll
-------------------------- ---------- ----
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.36366 built by: FX452RTMLDR
CodeBase: file:///C:/windows/Microso ft.Net/ass embly/GAC_ MSIL/Syste m.Windows. Forms/v4.0 _4.0.0.0__ b77a5c5619 34e089/Sys tem.Window s.Forms.dl l
-------------------------- ---------- ----
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.36366 built by: FX452RTMLDR
CodeBase: file:///C:/windows/Microso ft.Net/ass embly/GAC_ MSIL/Syste m.Drawing/ v4.0_4.0.0 .0__b03f5f 7f11d50a3a /System.Dr awing.dll
-------------------------- ---------- ----
System.Runtime.Remoting
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.36366 built by: FX452RTMLDR
CodeBase: file:///C:/windows/Microso ft.Net/ass embly/GAC_ MSIL/Syste m.Runtime. Remoting/v 4.0_4.0.0. 0__b77a5c5 61934e089/ System.Run time.Remot ing.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.
Dim Odrive As System.IO.DriveInfo
Odrive = My.Computer.FileSystem.Get
The code is enclosed in a try catch block, but I still get an unhandled error exception "Input string not in the correct format". Here is the stack information.
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumb
at System.Number.ParseInt32(S
at System.Convert.ToInt32(Str
at DiskRoom.Form1.Form1_Load(
at System.EventHandler.Invoke
at System.Windows.Forms.Form.
at System.Windows.Forms.Form.
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Scrol
at System.Windows.Forms.Conta
at System.Windows.Forms.Form.
at System.Windows.Forms.Form.
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Nativ
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.36366 built by: FX452RTMLDR
CodeBase: file:///C:/Windows/Microso
--------------------------
DiskRoom
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///O:/Loaders/Global/
--------------------------
Microsoft.VisualBasic
Assembly Version: 10.0.0.0
Win32 Version: 12.0.20806.33440 built by: FX45W81RTMREL
CodeBase: file:///C:/windows/Microso
--------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.36366 built by: FX452RTMLDR
CodeBase: file:///C:/windows/Microso
--------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.36366 built by: FX452RTMLDR
CodeBase: file:///C:/windows/Microso
--------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.36366 built by: FX452RTMLDR
CodeBase: file:///C:/windows/Microso
--------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.36366 built by: FX452RTMLDR
CodeBase: file:///C:/windows/Microso
--------------------------
System.Runtime.Remoting
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.36366 built by: FX452RTMLDR
CodeBase: file:///C:/windows/Microso
--------------------------
************** 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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks.
Open in new window