tags:

views:

217

answers:

2

I have a .net console app that launches excel. I have it working on my development enviornment, but I can't get it running on my production environment. When I try to run it I receive the following error "The system cannot execute the specified program". I have installed .net 2.0 sp2 on my production server. Any ideas?

Thank you,

Code

static void Main(string[] args) 
{ 

  DateTime priceDate; 
  bool runningForMidDay; 
  if (args.Length == 0) 
  { 
   priceDate = DateTime.Now; 
   runningForMidDay = false; 
  } 
  else 
  { 
     if (args[0].ToString() == "-?") 
     { 
        Console.WriteLine("This application..."); 
        Console.ReadLine(); 
        return; 
     } 
     if (!DateTime.TryParse(args[0].ToString(), out priceDate)) 
        priceDate = DateTime.Now; 
     if (!bool.TryParse(args[1].ToString(), out runningForMidDay)) 
        runningForMidDay = false; 
  } 
  if (runningForMidDay) 
  { ... } 
  else 
  { ... } 
}
+1  A: 

I've seen this sort of thing happen previously when the C runtime libraries aren't installed on the deployment machine; normally they're not necessary, but they may be required since your app launches Excel.

McWafflestix
Yes, I know that excel 2003 is installed on the server
mikemurf22
If the console app doesn't even launch, then it wouldn't matter if Excel was installed or not.
Dennis Palmer
+1  A: 

They say there is no such thing as a dumb question, just dumb people. Well that is the case here. I had an error in my config file. I have corrected the config file and it works.

mikemurf22
While this wasn't one, I firmly believe that there are dumb questions. The existence of dumb people is easily proven by driving pretty much anywhere in America.
Michael Kohne