4

Briefing:

My program says:

Program has more than one entry point defined. Compile with /main to specify the type that contains the entry point.

And it gave me the error code CS0017.

What I've experienced:

When I change the Main-Method to MainWindow, the error disappears, but as I said, I'm not that experienced to see if this solution is right or wrong.

Now:

Yes, I took a look at this (Stack Overflow post about the same issue), but that post didn't help much because it's program specific (I think it's because the xUnit package used in it).

The code below is part of a class named Rechteck (yes, I do speak German).

I'm a beginner and I don't know much. And even though I've had a bunch of errors, I never saw something like this. How can I fix this?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RechteckWPF
{
    class Programm
    {
        static void Main(string[] args)
        {
            // Neues Objekt erstellen
            Rechteck k = new Rechteck();
        try
        {

        }
        catch (Exception e)
        {

            Console.WriteLine("Error: {0}", e.Message);
        }

        // Ausgeben
        Console.WriteLine($"Umfang: {k.Umfang}\nFläche: {k.Fläche}");
        Console.ReadKey();
    }
}
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
eifach_CJ
  • 63
  • 2
  • 7
  • Possible duplicate of : http://stackoverflow.com/questions/11747761/added-a-new-class-to-my-project-and-get-error-say-program-main-has-more-then-o – vishwarajanand Mar 22 '17 at 09:45

0 Answers0