Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Friday, June 12, 2015 3:33 PM
I'm a new person to C#, and I have the following code.
namespace ODBCCExportCustomers
{
public class CustomerExport
{
static int Main (string[] args)
{
if (args[1].Length == 0)
{
return 1;
}
else
{
Customer(args[1]);
return 0;
}
}
static void Customer(string starter)
{
Lots of code here that works
}
}
}
However, when I try to compile it, I get one warning and one error:
Warning 1 'ODBCCExportCustomers.CustomerExport.Main(string)' has the wrong signature to be an entry point C:\Development\Visual Studio 2013\Projects\ODBCExportCustomers\ODBCExportCustomers\MainCustExport.cs 16 20 ODBCExportCustomers
Error 2 Program 'c:\Development\Visual Studio 2013\Projects\ODBCExportCustomers\ODBCExportCustomers\obj\Debug\ODBCExportCustomers.exe' does not contain a static 'Main' method suitable for an entry point C:\Development\Visual Studio 2013\Projects\ODBCExportCustomers\ODBCExportCustomers\CSC ODBCExportCustomers
I have searched everywhere to try and find a solution, and everywhere I look, I see the same code as the recommended solutions.
Does anyone have any idea of what might be the issue here?
Thanks
Mark
All replies (5)
Friday, June 12, 2015 4:41 PM ✅Answered
Should main() be capitalised as Main?
Friday, June 12, 2015 4:56 PM ✅Answered
It was capitalized as Main - I changed it to main, that failed and then back to Main and it worked - thanks for the input - it's working now
Friday, June 12, 2015 4:56 PM
What happens if you remove the public:
namespace ODBCCExportCustomers
{
class CustomerExport
{
What sort of project is this?
Hope that helps.
Technet articles: WPF: Change Tracking; All my Technet Articles
Sunday, June 14, 2015 10:24 AM
It was capitalized as Main - I changed it to main, that failed and then back to Main and it worked - thanks for the input - it's working now
Haha, thanks for the update!
Sunday, September 24, 2017 3:35 PM
This is crazy! But it fixed mine too.
Thanks!
D