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

  • SEARCH
  • Home
  • 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 9141719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:40:57+00:00 2026-06-17T09:40:57+00:00

I have been googling this problem for 2 days, and all the solutions I’ve

  • 0

I have been googling this problem for 2 days, and all the solutions I’ve seen doesn’t quite fit my scenario, or the fix doesn’t work.

I have a WPF desktop application. When I’m debugging the project everythings is working fine and 100%. But the moment I deploy my app (even on the PC I developed it), it crashes. It seems to crash on the first class instantiation it finds and throws an exception who’s innerException is always a nullreference exception. The former exception keeps changing though, like TargetInvocationException, TypeInitializationException etc.

Here is the stacktrace:

    System.TypeInitializationException: The type initializer for 'eTute.BusinessLayer' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at eTute.BusinessLayer..cctor()
   --- End of inner exception stack trace ---
   at eTute.BusinessLayer.EncryptPassword(String password)
   at eTute.MainWindow.imgLock_MouseDown(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at System.Windows.Application.Run()

The “BusinessLayer” is like my Data Access layer (DAL). At first it was instance driven, but i changed the whole class to be static when it started crashing on the BusinessLayer’s contructor. Now it seems to just crash at the next instantiation.

NOTE: To create the installer, I just used Visual Studio’s Setup Wizard. The app uses a SQL Express database, but it never even gets to use it, since it crashes on any little instance.

Please, any help or comment will be profoundly appreciated. I have never done an install before, but feel that it shouldn’t be this complicated!

UPDATE
The problem seemed to be related to accessing the connectionStrings in the app.config file. When I replaced the code that said ConfigurationManager.ConnectionStrings["name"].ConnectingString with a hardcoded string variable, the problem disapeared.

But then how am I supposed to use the app.config file when my app is deployed?

  • 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-06-17T09:40:58+00:00Added an answer on June 17, 2026 at 9:40 am

    So after a few struggles, I was able to determine the problem with my install file. I followed a tutorial on a website and it actually taught me to do something that should actually not be done, as is why the error occurred.

    The problem was that the app.config file was not in the same folder as the exe of the app. Therefore, the exe could not locate the app.config file upon start up, and thus the app crashed.

    I hope this helps someone with a similar problem. Was a quite easy fix, if I only new why it occurred. 😉

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

Sidebar

Related Questions

So I have been Googling and I am quite sure my problem emerge from
I have been googling about this problem and couldn't find any good websites.... I
I swear I have seen an example of this but have been googling for
Morning, I have been working on this problem for a few days and cannot
This problem is really killing me, I have been googling for a VERY long
I have been Googling a problem that I have with trying to integrate the
I've been battling with this issue for a couple of days now. I have
I have been googling/SO:ing this issue for a while and many seem to be
I have been googling for quite a long time but still find no solution.
I have been googling for a solution, and I only find solutions where FrameLayout

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.