Solved

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

Posted on 2016-10-06
6
69 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 34

Assisted Solution

by:ste5an
ste5an earned 200 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 70

Accepted Solution

by:
Éric Moreau earned 300 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 34

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 70

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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

617 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