Click here to Skip to main content
15,905,875 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
CSS
Problem signature:
Problem Event Name:CLR20r3
Problem Signature 01:xpro.exe
Problem Signature 02:2.1.1.3
Problem Signature 03:503bf27a
Problem Signature 04:Microsoft.VisualBasic
Problem Signature 05:10.0.0.0
Problem Signature 06:4ba2183b
Problem Signature 07:88
Problem Signature 08:8
Problem Signature 09:System.IO.FileNotFoundException
OS Version:6.1.7600.2.0.0.256.1
Locale ID:3081
Additional Information 1:0a9e
Additional Information 2:0a9e372d3b4ad19135b953a78882e789
Additional Information 3:0a9e
Additional Information 4:0a9e372d3b4ad19135b953a78882e789


This are the error details when my program xPro crashes when opening. Why exactly is it crashing?

In my computer it works. It fails in my customer's computers.

The only thing this program has to do with reading any file on form load is reading s few files that are online so everyone has access to them. The only other thing I can think of is with newer versions of my program with the auto updater. I have it to delete and download the updater everytime the program opens the 'Check For Updates' form so I can make sure everyone has the latest version of the updater incase I find any bugs in it or make any changes. The code for deleting the old updater is in a try statement so I don't see how it would cause the program to not load if it can't find the file and I know everyone has the updater because it is installed into the directory with the program when someone installs it.

I figured the System.IO was the part of the error details that was causing it

The code that seems to cause the issue is the following one:
VB
Try
            Dim instance As WebClient = New WebClient
            Dim address As String = "https://dl.dropbox.com/u/76035776/xPro/xProNews/XboxNews.txt"
            Dim returnValue As String
            returnValue = instance.DownloadString(address)
            KryptonTextBox1.Text = returnValue
        Catch ex As Exception

        End Try
        Try
            Dim instance As WebClient = New WebClient
            Dim address As String = "https://dl.dropbox.com/u/76035776/xPro/xProNews/Battlefield.txt"
            Dim returnValue As String
            returnValue = instance.DownloadString(address)
            KryptonTextBox2.Text = returnValue
        Catch ex As Exception

        End Try
        Try
            Dim instance As WebClient = New WebClient
            Dim address As String = "https://dl.dropbox.com/u/76035776/xPro/xProNews/Minecraft.txt"
            Dim returnValue As String
            returnValue = instance.DownloadString(address)
            KryptonTextBox3.Text = returnValue
        Catch ex As Exception

        End Try
        Try
            Dim instance As WebClient = New WebClient
            Dim address As String = "https://dl.dropbox.com/u/76035776/xPro/xProNews/Other%20Games.txt"
            Dim returnValue As String
            returnValue = instance.DownloadString(address)
            KryptonTextBox4.Text = returnValue
        Catch ex As Exception

        End Try
        If Not File.Exists("C:\xPro\xProUpdater.exe") Then
            Try
                link = "https://dl.dropbox.com/u/76035776/xPro/xProUpdater.exe"
                Dim wr As WebRequest
                wr = WebRequest.Create(link)
                Dim webr As WebResponse = wr.GetResponse
                Dim wc As New WebClient
                wc.DownloadFile(link, "C:\xPro\xProUpdater.exe")
            Catch ex As Exception

            End Try
        Else
            'Do Nothing
        End If
        If My.Settings.AutoUpdate = Nothing Then
            My.Settings.AutoUpdate = "On"
        End If
        If My.Settings.AutoUpdate = "On" Then
            AutoupdateToolStripMenuItem.Text = "Autoupdate: On"
            Try
                KryptonLabel3.Text = Me.ProductVersion
                Dim instance As WebClient = New WebClient
                Dim address As String = "https://dl.dropbox.com/u/76035776/xPro/Version.txt"
                Dim returnValue As String
                returnValue = instance.DownloadString(address)
                KryptonLabel4.Text = returnValue
                If KryptonLabel3.Text >= KryptonLabel4.Text Then

                Else
                    CheckUpdate.Show()
                End If
                Me.Refresh()
            Catch ex As Exception
                MessageBox.Show("Error: Failed to check latest version.")
            End Try
        ElseIf My.Settings.AutoUpdate = "Off" Then
            AutoupdateToolStripMenuItem.Text = "Autoupdate: Off"
        End If
        Me.Show()
        Timer1.Start()
        NotifyIcon1.Text = "xPro " + Me.ProductVersion
        If My.Settings.SearchEngine = Nothing Then
            My.Settings.SearchEngine = "Google"
        End If
        Try
            KryptonManager1.GlobalPaletteMode = My.Settings.Theme
        Catch ex As Exception
            KryptonManager1.GlobalPaletteMode = ComponentFactory.Krypton.Toolkit.PaletteModeManager.Office2007Black
        End Try

        KryptonComboBox1.Text = My.Settings.SearchEngine
Posted
Updated 28-Aug-12 19:31pm
v2
Comments
[no name] 28-Aug-12 12:51pm    
System.IO.FileNotFoundException
Kuthuparakkal 28-Aug-12 12:56pm    
post the code, am very poor in guessin you damn code
lewax00 28-Aug-12 13:14pm    
Simple: the program is trying to access a file that doesn't exist. Without the code it's hard to tell you more than that.
Zack Mcintosh 28-Aug-12 14:42pm    
https://dl.dropbox.com/u/76035776/xPro/xProSource.zip
You can download the source of my program there. I hope that helps.
[no name] 28-Aug-12 15:02pm    
It is highly unlikely that you will get too many takers for downloading an unknown project from an unknown source.

Problem Signature 09:System.IO.FileNotFoundException
You have not shared too much of an info, but the error has this line that does states that some file is missing that would be required. Looks like program needs a file which is no more there.
 
Share this answer
 
Obviously the real error is
C#
System.IO.FileNotFoundException
which occurs when a file cannot be found. Look into your code, maybe you're loading a setting from a file that no longer exists and attempt using
C#
System.IO.File.Exists()
function to detect if that file exists before performing the action and of course if you're just going to create a new file, check that the directory where the file would reside has already been created, and again you can use
C#
System.IO.Directory.Exists()
function.

C#
using System.IO; // Remember to import this namespace.
  if (!Directory.Exists("C:\\My Settings Folder")
            {
                Directory.CreateDirectory("C:\\My Settings Folder");
            }

            if (File.Exists("C:\\My Settings Folder\\My Settings.xml")
            {
                //You can then create a file or load one depending on what you want to do.
            }
 
Share this answer
 
Another part of your problem, that I'm surprised nobody pointed out, is that you've got a bunch of empty Catch blocks in your code. That just takes any exception generated and swallows it. You'll never know what your code is actually trying to tell you like that.

You really need to put some code in the blocks that logs the exception somewhere so you can refer to it in instances like this where you can't reproduce the problem.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900