question

CarlAntenor-4278 avatar image
0 Votes"
CarlAntenor-4278 asked TimonYang-MSFT commented

Visual Studio 2019 running Wrong C# file

Hello! I just installed Visual Studio 2019 onto my laptop and the program was working fine until i had a problem, 2 to be exact! The first one was CS0017 where it has more than one entry point, i looked it up in StackOverflow and the guy said he changed Main to MainWindow. so i did what he did and the 1st problem got away! but....whenever i run the file it runs the wrong file like in my other C# Project in VSCode where it was supposed to run the file i told it to run but it runs the default file that Visual Studio created for C#! Pls help me i am a beginner for C#

dotnet-csharp
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@CarlAntenor-4278
There is a way to modify the class that is the entry point of the program.
Advanced C# compiler options

0 Votes 0 ·

1 Answer

Viorel-1 avatar image
0 Votes"
Viorel-1 answered

Find the function that is called Main and rename it to Main1 or remove it if not needed. Then go to MainWindow and rename it back to Main.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.