I have created windows application to .. I need to add arguments to Main method so I changed my main method by overloading string[] parameter.
if I change any changes to Program class main method it's not updating through my application .exe why?
copied code Before changing Program.cs
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
copied code below after adding arguments to mainb method i am checking for value and calling a method from other class
static class Program
{
private static string x= string.Empty;
private static string y= string.Empty;
private static string z= string.Empty;
public static void Main(string[] args)
{
try
{
if (args.Count() > 0)
{
if (args.Count() != 3)
{
RootDirectory = args[0];
SourceFile = args[1];
DestinationFile = args[2];
Form1.GetCommandLineArgs(x, y, z);
}
else
{
throw new Exception("");
}
}
else
{
throw new Exception();
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
catch (Exception ex)
{
Common.AppUtilties.LogError(ex, "OnFailure, " + ex.Message);
Environment.Exit(0);
}
}
}