Erik Karlstrand
Erik Karlstrand

Reputation: 1537

Program won't start without a Visual Studio installation?

We have been working on a booking system for a company. When we first tried to run it on their computer it said we needed to download the .NET Framework 4.0. So we did that (or rather we downloaded version 4.5 as the link for 4.0 didn't work). Now, when we try to run it, nothing happens.

We've built the program in C# with Entity Framework - Code First if that narrows it down.

Are we missing something in the settings when publishing? We've tried compiling it in release and the publish wizard but neither work.

Upvotes: 6

Views: 1668

Answers (2)

VladL
VladL

Reputation: 13043

If your application has a GUI and it doesn't show means, that your application fails in the constructor. The best thing you can do is to log every step from constructor with something like this:

public void log(string msg)
{
  StreamWriter file2 = new StreamWriter(@"c:\file.txt", true);
  file2.WriteLine(msg);
  file2.Close();
}

and than call it after every line in constructor like

log("InitializeComponent");

If you use FormLoad events, you should also do it there. Also check your code for empty try catches.

Upvotes: 0

daryal
daryal

Reputation: 14929

This is most probably due to a missing assembly. In your development configuration, you have all of your libraries to run the program and in the deployment, there is/are missing dll(s).

What you may try is to control the GAC of the development machine, and try to locate if any of the libraries you are using except .net libraries are installed in the GAC. Then, you may have been referencing the dll from GAC, and in the deployment this library may be missing in the GAC. I have seen this in a sharepoint project before.

Also, checking the windows event log is useful. You may locate the actual exception.

p.s. if this is a asp.net project, do not forget to run regiis.exe after framework deployment.

Upvotes: 1

Related Questions