none
Error: Could not find 'PeriodeStatistik.Program' specified for Main method C5StatMenu

    Question

  • and my Main looks like this:

    using System;
    using System.Collections.Generic;
    using System.Windows.Forms;

    namespace C5StatMenu
    {
    static class Program
    {
    /// <summary>
    /// The main entry point for the application.
    /// </summary>
    [STAThread]
    static void Main()
    {
    Application.EnableVisualStyles();
    Application.SetCompatibleTextRenderingDefault(false);
    Application.Run(new frmC5StatMenu());
    }
    }
    }

    What is wrong ?

    Best regards
    KSor, Denmark

    Friday, June 27, 2008 9:03 AM

Answers

  • Hi PSASor,

    I do think there is no error in your code snippet above, if you cannot figure the issue out, the most convenient way is create a new windows form project and paste the code.

    1. Open the Visual Studio IDE, Create a new “Windows forms Application” project in C#, you can named the project as “C5StatMenu”.
    2. Add a new form item to the project which named “frmC5StatMenu”, and then paste your code snippet to the “Program.cs” file.
    3. Compile and run the project.

    Regards,
    Xun


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    • Marked as answer by jack 321 Wednesday, July 02, 2008 10:51 AM
    Tuesday, July 01, 2008 6:12 AM

All replies

  • Hi PSASor,

    I do think there is no error in your code snippet above, if you cannot figure the issue out, the most convenient way is create a new windows form project and paste the code.

    1. Open the Visual Studio IDE, Create a new “Windows forms Application” project in C#, you can named the project as “C5StatMenu”.
    2. Add a new form item to the project which named “frmC5StatMenu”, and then paste your code snippet to the “Program.cs” file.
    3. Compile and run the project.

    Regards,
    Xun


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    • Marked as answer by jack 321 Wednesday, July 02, 2008 10:51 AM
    Tuesday, July 01, 2008 6:12 AM
  • Hello,

    you can directly rename the periodeStatik.Program by C5StatMenu.Program in the "yourProjectName.csproj" file, in the balise :

     

    <PropertyGroup>

        <StartupObject>C5StatMenu.Program</StartupObject>

      </PropertyGroup>

     

     

    Regards,

    Michael

    Tuesday, August 24, 2010 3:43 PM