Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6005991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:28:34+00:00 2026-05-23T01:28:34+00:00

All, I have a WPF application built upon SQLite database and user/application Configuration settings.

  • 0

All,

I have a WPF application built upon SQLite database and user/application Configuration settings. The application builds and runs fine in development environment. I created a Setup and Deployment project, added the “Project output” of above said application and then proceeded to create a setup. The pre-requisites and the .NET Framework versions are same in the Application and in the setup project:

.NET Framework 3.5 Client Profile
MS Visual Basic Powerpacks 10.0.0
Windows Installer 3.1

But when I move it onto another PC with identical .NET Framework installed (but without the development environment), the application does not start. It gives a “has encountered a problem and needs to close” Error. I found that this would mean a uncaught exception in the application. So, I tried to comment out parts of the application that did not have them handled and left all but a single window to display (the Main window that does nothing) but yet the application fails. I begin to suspect that the problem could be that the dependancies are not handled for the app start. Here is what I did with them:

  1. SQLite needed a DLL that is automatically added to the “Detected Dependencies” It gets copied to the Application Directory
  2. SQLite databases are added manually to the project and they are copied to the Application Directory
  3. The Application.exe.config files are NOT copied. I am not sure where to put them

At this point, I would like to know how I can find out the root-cause for the problem. I tried running another simple app with a single window (and no functionality) and it works on the target machine. TIA

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T01:28:35+00:00Added an answer on May 23, 2026 at 1:28 am

    If you think the problem lies in the dependencies then it might be worth having a look at the “Assembly Binding Log Viewer” (i.e. fuslogvw.exe). This tool should be able to tell you exactly which assemblies were requested and how the requests were satisfied, or not satisfied. The catch is that this only works for managed assemblies.

    If however you want to find out what the unhandled exception is then you could wrap a try .. catch around the application entry point. The catch in WPF is that this is generated by the compiler / Visual Studio so you can’t normally change it. If you do want to change it, say to put a try .. catch around it then you need to (example taken from http://www.infosysblogs.com/microsoft/2008/09/how_to_write_custom_main_metho.html):

    1. Find the App.xaml and App.xaml.cs files
    2. Open the property page for App.xaml and change the build action to ‘Page’
    3. In App.xaml.cs add a Main() method which should look like:

      [STAThread]
      public static void Main()
      {
          var app = new App();
          app.InitializeComponent();
          app.Run();
      }
      

    If you wrap a try .. catch around the entire method body then you could write what ever the error information is to a text file. Hopefully that will help you find out what is wrong.

    ===== EDIT =====

    If the unhandled exception is not being caught by the try .. catch construct then it can be a binder problem. Because the JIT compiler compiles methods on a as-needed basis it may help to move nearly all code out of the entry method. For example:

    <!-- language: lang-cs -->
    
        [STAThread]
        public static void Main()
        {
            try
            {
                MyMethod();
            }
            catch(Exception e)
            {
                // ... Write to file here
            }
        }
    
        private static void MyMethod()
        {
            // .. Do actual work here
        }
    

    By doing this you make sure that you are inside the try .. catch construct before the run-time tries to locate the right assemblies etc. However note that there are some exceptions that can’t be caught (OutOfMemoryException, StackOverflowException and some others).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Anyone using WPF for real LOB applications? We have all seen the clever demos
I have decided that all my WPF pages need to register a routed event.
I have WPF application that has a login form. I would like to make
I have a WPF application that has just one button. When the button is
In my WPF application I have a lot of custom dialog boxes that pop
I have a Main WPF application and other modules and I am using PRISM
I'm sure we all have received the wonderfully vague Object reference not set to
I have created a bunch of movie clips which all have similar names and
I have a bunch of projects in parallel subdirectories that all have etc/lighttpd.conf files.
I have a MFC dialog with 32 CComboBoxes on it that all have the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.