none
program crashes on startup...sometimes RRS feed

  • Question

  • hello.

    my program makes use of the 3rd party library system.data.sqlite.dll
    this library requires full trust to run properly.

    i want to make this program automatically start up on login.

    it works perfect if i make a shortcut and add it to the start up menu, however, one of our customers is using windows XP embedded, and the start menu is disabled.

    so, i figured that using the registry would work.  i added an entry to the following location.
    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

    however, when i log on my program crashes with a kernel32.dll error.  this happens on all versions of XP.

    what are the differences between the 2 start up methods, and is there a way for me to elevate required privileges to get my application to run?

    thanks!
    Tuesday, April 22, 2008 6:01 PM

Answers

  • sorry guys, i made a boo boo.
    the registry doesn't have a startup path....so Environment.CurrentDirectory didn't give the right path.
    and since i had a static constructor it wouldn't show the proper exception information.

    thanks for the input.
    Wednesday, April 23, 2008 6:40 PM

All replies

  • whoops, i forgot...the reason i mentioned the sqlite library is because that is the dll that is throwing an exception on startup through the registry.  running the application through the start up menu, or manually loads just fine.
    Tuesday, April 22, 2008 8:56 PM
  • You must provide the exact error message of the exception as well as a stack trace.
    Tuesday, April 22, 2008 9:32 PM
    Moderator
  • It seems that your program is starting too early. Some system services are still starting up (including SQL server) which may not be fully up and running at this time.

     

    1. Try to make the connection to the SQL server more gracefully and retry it more than once

    2. Do not use HKLM but HKCR to start your program when the user logs on and not when the machine is started.

       That should help to minimize possible race conditions.

     

    Yours,

       Alois Kraus

     

    Wednesday, April 23, 2008 2:31 PM
  • thanks for the replies.

    i am not using sql server.  i am using sqlite.  this is a file-based database, and system.data.sqlite is a ado.net wrapper.  the wrapper has a C dll in it, which means that it must run unmanaged code, which is why the library must be run in full trust mode.

    the exception is thrown my the sqlite dll, but i only know this because i have an exception catcher that generates an email message.  i actually don't see the regular .net crash with a debug and close button.  i see the other one where you should report it to microsoft, and i can view the contents of the report and see a whole bunch of hex information.  the error report says that something in kernel32.dll messed up, which is very odd because usually that information contains a .net assembly.

    i tried using HKCR as well and i have the same problem.

    the call stack is unlikely to help because the exception is generated within the sqlite library (and methods that i don't have public access to), probably due to loading the internal unmanaged dll.
    Wednesday, April 23, 2008 2:45 PM
  • "whole bunch of hex information", "something in kernel32.dll messed up".  Sounds like very useful information for others to diagnose what might be going on.  Best place to post that information is in a SqlLite support forum.
    Wednesday, April 23, 2008 3:41 PM
    Moderator
  • http://i32.tinypic.com/b96ov7.png

    there is a screenshot of the error.  i am unable to supply any information about the hex information because that screen does not allow me to copy/paste any information.  i also think that information is largely irrelevant.

    this is not a problem with sqlite because the program runs perfectly fine when i manually run it or if i use the startup menu shortcut.  it is only a problem when i use the registry.  as mentioned previously, i must use the registry because our customer disabled the start menu in their XP embedded installation.

    i did research and the sqlite wrapper requires full trust to run properly.  my hypothesis is that there is a difference in privileges levels between the start menu/manual startup vs the registry startup.

    thanks.
    Wednesday, April 23, 2008 4:11 PM
  • sorry guys, i made a boo boo.
    the registry doesn't have a startup path....so Environment.CurrentDirectory didn't give the right path.
    and since i had a static constructor it wouldn't show the proper exception information.

    thanks for the input.
    Wednesday, April 23, 2008 6:40 PM