Forum: Windows

Here is a forum space for SDK: Windows.

201. c# deployment -- Exception Info: System.IO.FileNotFoundException    at lab651_ptt.PTTService..cctor()

We have a successful build we are happy with in C#.
We are trying to run the executable on another windows machine.

The exception is below.

Any ideas?

Log Name:      Application
Source:        .NET Runtime
Date:          12/6/2020 12:14:11 PM
Event ID:      1026
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      DESKTOP-CAQ0O3D
Description:
Application: lab651_ptt.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileNotFoundException
   at lab651_ptt.PTTService..cctor()

Exception Info: System.TypeInitializationException
   at lab651_ptt.PTTService.getInstance()
   at lab651_ptt.LoginWindow.onLoginClicked(System.Object, System.Windows.RoutedEventArgs)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
   at System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
   at System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs)
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()
   at System.Windows.Controls.Button.OnClick()
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(System.Windows.Input.MouseButtonEventArgs)
   at System.Windows.UIElement.OnMouseLeftButtonUpThunk(System.Object, System.Windows.Input.MouseButtonEventArgs)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate, System.Object)
   at System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
   at System.Windows.UIElement.ReRaiseEventAs(System.Windows.DependencyObject, System.Windows.RoutedEventArgs, System.Windows.RoutedEvent)
   at System.Windows.UIElement.OnMouseUpThunk(System.Object, System.Windows.Input.MouseButtonEventArgs)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate, System.Object)
   at System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
   at System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
   at System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs)
   at System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs, Boolean)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs)
   at System.Win

Dec 6 '20 at 20:18 (GMT0) created by Mike

 
Dear Mike,
Please check the sample project(HelloPTT).
Is it working?
"FileNotFoundException"
I guess the file could mean DLL files.
Please check it also.
Regards.
ProPTT2

Dec 7 '20 at 05:56 (GMT0) created by ProPTT2 dev

 
 
HelloPTT, without modifications, results in the same exception.
(It can't deploy either) 

The programs will run on a machine with Visual Studio installed, but they won't run on a machine without it.

Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileNotFoundException
   at lab651_ptt.PTTService..cctor()

Exception Info: System.TypeInitializationException
   at lab651_ptt.PTTService.getInstance()

It is almost like PTTService.getInstance() is opening a file. 

It is possible it is a setting in my system...
Any thoughts?

We have tried the Linux API, SIP, even experimented a bit with Android to get our application to work. We have a successful application with C#,  but we can't demo it on anything with visual studio installed.  Thank you for your help.


Dec 7 '20 at 11:32 (GMT0) created by Mike

 
 
To deploy, you need to check the dependuncy files by depends.exe(Mocrosoft tool).
I think you need to install Microsoft Visual C++ 2005 Redistribution.
https://www.microsoft.com/en-US/download/details.aspx?id=40784
Thanks,
ProPTT2

Dec 8 '20 at 01:48 (GMT0) created by ProPTT2 dev