Results 1 to 11 of 11

Thread: Users getting an error when starting my application

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2012
    Posts
    26

    Users getting an error when starting my application

    Hello !

    Just wrote a small console application which converts images into other image file formats.
    When I am running it on my computer it doesn't give any error messages but when users run it then the application gives out this message:


    And the code is here:
    Code:
    Imports System.Drawing
    Imports System.IO
    Module Module1
    
        Sub Main()
            Console.WriteLine("Converting images")
            Try
                command()
            Catch ex As Exception
                Console.WriteLine(ex.Message)
            End Try
            Console.WriteLine("Done")
            Console.ReadLine()
        End Sub
        Private Sub command()
            Console.WriteLine(My.Application.Info.DirectoryPath)
            Dim di As New IO.DirectoryInfo(My.Application.Info.DirectoryPath & "\")
            Dim diar1 As IO.FileInfo() = di.GetFiles()
            Dim dra As IO.FileInfo
            For Each dra In diar1
                Dim path1 As String = dra.ToString
                Try
                    Dim bmp As New Bitmap(path1)
                    Dim file_path As String = Path.GetDirectoryName(path1)
                    Console.WriteLine(file_path)
                    Dim name As String = Path.GetFileNameWithoutExtension(path1)
                    Dim new_file_path As String = My.Application.Info.DirectoryPath & "\" & name & ".dds"
                    DevIL.DevIL.SaveBitmap(new_file_path, bmp)
                    Console.WriteLine(new_file_path)
                Catch ex As Exception
                    Console.WriteLine(ex.Message)
                End Try
            Next
        End Sub
    End Module
    Also I will attach a dll file and compiled exe file.
    Application should be build with 3.5 framework and as 86x bit (32x), in the attachment exe file was compiled with VB2008 .Net version.
    Where might be a problem ... ?
    Thank you
    Last edited by Joacim Andersson; May 11th, 2013 at 09:03 AM. Reason: Removed attachment

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Users getting an error when starting my application

    It is against forum rules to attach binary files to your posts. I have notified the mods and they will remove your attachment if you do not do so first.

    When these users are running your application, is that DevIL.NET2.dll in the same folder as your EXE?

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Oct 2012
    Posts
    26

    Re: Users getting an error when starting my application

    Prieviously when I made a post I was asked to add some files as attachment ... as users couldn't test the file without them ...

    When these users are running your application, is that DevIL.NET2.dll in the same folder as your EXE?
    Yes it is in the same fodler as exe file ... and it is very strange, can't uderstand where is the difference between my pc and their ...
    As my pc don't have that error bu they have ...
    Do you have any other ideas where the problem might be ... ?

  4. #4
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Users getting an error when starting my application

    Where did you reference the file when building the application? That's where the application is searching for it, not necessarily in the same folder as the exe.
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Users getting an error when starting my application

    Quote Originally Posted by newbie11 View Post
    Prieviously when I made a post I was asked to add some files as attachment ... as users couldn't test the file without them ...
    It's OK to attach files to a post but not binaries. If you attach project files then we can see what's in them but if you attach binaries and we execute them we have no way of knowing that they are safe. If some third-party DLL is required to run your project then we simply can't run your project unless there's some other source from which it can be obtained.

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Oct 2012
    Posts
    26

    Re: Users getting an error when starting my application

    It's OK to attach files to a post but not binaries. If you attach project files then we can see what's in them but if you attach binaries and we execute them we have no way of knowing that they are safe. If some third-party DLL is required to run your project then we simply can't run your project unless there's some other source from which it can be obtained.
    Ok won't do that.
    Where did you reference the file when building the application? That's where the application is searching for it, not necessarily in the same folder as the exe.
    I was attaching dll files as usual always worked in this way:
    Name:  image.png
Views: 130
Size:  49.0 KB

  7. #7
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,532

    Re: Users getting an error when starting my application

    The key maybe the 5 words that happen after the assembly name ... "or one of its dependencies." ... which means that DevIL.NET2 may be relying on yet more assemblies, which aren't being carried over to the project's folder...

    What IS DevIL.NET anyways?

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Oct 2012
    Posts
    26

    Re: Users getting an error when starting my application

    Quote Originally Posted by techgnome View Post
    The key maybe the 5 words that happen after the assembly name ... "or one of its dependencies." ... which means that DevIL.NET2 may be relying on yet more assemblies, which aren't being carried over to the project's folder...

    What IS DevIL.NET anyways?

    -tg
    That's a library which alows to load dds images as bitmap into vb.net ... in the code written above it's shown.

  9. #9
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,532

    Re: Users getting an error when starting my application

    ok, so it sounds like that it is "relying on yet more assemblies, which aren't being carried over to the project's folder..."

    where did you source your binaries from exactly?

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  10. #10
    Addicted Member
    Join Date
    Jan 2013
    Posts
    177

    Re: Users getting an error when starting my application

    I would suggest using Process Monitor ---> http://technet.microsoft.com/en-ca/s.../bb896645.aspx

    Filter the list to show only your application. Then when you start your application you will be able to see everything your application is looking for along with the ones it cannot find. And go from there.

    Make sure you run it on a computer that is giving you the error

  11. #11
    Hyperactive Member Philly0494's Avatar
    Join Date
    Apr 2008
    Posts
    485

    Re: Users getting an error when starting my application

    The DLL you are using is a .NET wrap the original devIL.dll, which is a COM dll I believe. You need to have devIL.dll in the folder as well because devIL.NET.dll references it, I believe.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width