Deployed .net application on a new computer and receiving "The system cannot execute the specified program"

I have a .net console application that runs excel. I have work on my development, but I cannot get it to work in my production environment. When I try to start it, I get the following error: "The system cannot execute the specified program." I installed .net 2.0 sp2 on my production server. Any ideas?

Thanks,

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 
  { ... } 
}
+3
source share
2 answers

They say that there is no such thing as a stupid question, just stupid people. Good thing here. I had an error in my configuration file. I adjusted the configuration file and it works.

+8

, C ; , , Excel.

+1

Source: https://habr.com/ru/post/1709234/


All Articles