?
Solved

VB.Net application which runs on one machine crashes on another although OS is excalty the same

Posted on 2016-10-06
6
Medium Priority
?
98 Views
Last Modified: 2016-10-06
Hi

I have developed a VB.Net application on a vitual machine running under Windows Server 2008 R2 Standard with SP1, and on that machine, that app runs without any single problem.

Now for the first time I compiled it and copied the corresponding files to a test server which is running under exactly the same OS version, and my app crashes right away badly and I can't even find out why, because the only option offered to me is to "close the program". And although the console windows appears, it's full of weird statements about where the app was, but I can't even look at the contents becaus when I click on that window then Windows gives me the choice between closing the app or searching for the error, which returns nothing, so I'm pretty stuck with the whole thing.

The compatibility check tells me that the app is incompatible (!) although I have 2 other very similar VB.Net apps running perfectly well on that server machine. The only difference is that these 2 apps are Windows forms apps, whereas the new one is a console app, but otherwise their functionality is very similar (the new app should replace the 2 old apps)..

1) any idea what it could be ?

2) any possibility for me to debug the app on the server ? I have no idea how that should be done (if it can be done at all..)

Thanks for your help
Bernard
0
Comment
Question by:bthouin
  • 2
  • 2
  • 2
6 Comments
 
LVL 37

Assisted Solution

by:ste5an
ste5an earned 800 total points
ID: 41831525
Step 1: Add error handling and logging.
Step 2: Check your references. Has the second machine the same .NET framework installed?
0
 
LVL 71

Accepted Solution

by:
Éric Moreau earned 1200 total points
ID: 41831623
it looks like you are missing files. Have you deployed all the files you have found in the same folder as your .exe?

To add tracing to your application, check http://emoreau.com/Entries/Articles/2003/11/Code-diagnostic-an-article-on-tracing-and-debugging.aspx
0
 
LVL 1

Author Comment

by:bthouin
ID: 41831641
Step 1: done since the start of devlopment, but I get no logging (I'm logging in a SQL Server DB)

Step2: The second machine must have the same or a compatible .Net framwork installed, as my 2 other apps have been compiled on the same development machine as this new app. On dev machine: .Net framework 4.5.1, on server 4.5.2, which does not seem to bother the old apps

Actually, there are 2 hints:
- the error is "System.InvalidOperationException"
- the error seems to happen when the new app wants to log an error, probably the error that causes all the ensuing problems and crash, because the Evnt viewer shows the following:
.NET Runtime error:
Description: The process was terminated due to an unhandled exception.
Exception Info: System.TypeInitializationException
Stack:
   at BBgDataRetrievalNewApp.AppLogging.HandleErrors(System.String)
   at BBgDataRetrievalNewApp.ClassMain.Main()

AppLogging is the VB routine which logs a string text into a table in the AS/400 DB2 database, but it has full error handling with Try/Catch and showing any error on the console as well as logging the error.
There IS a difference between the new app and the old ones: the old ones log their activities and errors in a central log table in the SQL Server DB, whereas the new one uses a log table in an AS/400 DB2 table. But that table poses no problem when the app is running on the first machine, so I'm puzzled. And also, one of the old app happily writes into tables on the AS/400 DB2 tableswhile running on the server...

So how can I find out exactly what is happening ?
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
LVL 37

Expert Comment

by:ste5an
ID: 41831649
By logging I'm mean a working logging mechanism. Any logging which logs to a database must be able to log to a local file or the event log in the case that the database is not available for whatever reasons.

But as you said, you're using AS/400: Have you installed the same driver and components on the second machine? Does your AS/400 control access by IP?
0
 
LVL 71

Expert Comment

by:Éric Moreau
ID: 41831654
>>Step 1: done since the start of devlopment, but I get no logging (I'm logging in a SQL Server DB)

But if your application cannot start correctly or cannot connect to your SQL database, you get no debugging info. This is why you need more basic stuff like the one proposed in my article.

>>whereas the new one uses a log table in an AS/400 DB2

Do you need to deploy any DB2 related DLLs?

>>So how can I find out exactly what is happening ?

You need to add tracing (other than your database) in order to see exactly where your application trigger the error.
0
 
LVL 1

Author Comment

by:bthouin
ID: 41831677
Sorry guys, I found out what it was: as Eric wrote, I had not copied all the files to the server, and the config file was missing !

That file contained precious info about a web service I'm using in the app, so it conked out because of that: I found out by setting the console window to a much bigger size, and then I saw exactly what the problem was. So it was not a problem of the "environment" (OS, drivers, etc.) but just a problem of copying all the files in the deployment directory of the dev machine...

Sorry to have wasted your time :(
Bernard
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
The video will let you know the exact process to import OST/PST files to the cloud based Office 365 mailboxes. Using Kernel Import PST to Office 365 tool, one can quickly import numerous OST/PST files to Office 365. Besides this, the tool also comes…
Watch the video to learn how one can deal with PST file corruption issue with an outstanding Kernel for Outlook PST Repair Tool easily. Using this tool, non-technical users can swiftly perform the repair process to restore their essential data witho…
Suggested Courses
Course of the Month7 days, 2 hours left to enroll

593 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question