question

HieuHO-0395 avatar image
0 Votes"
HieuHO-0395 asked YangDavid-8839 published

Program not running in Visual Studio 2019

Hello,

I just installed Visual Studio 2019 onto my laptop and I can't run or debug anything since I installed the program. I am assuming I have nothing in my "solutions". Is that why nothing is working? I appreciate if someone can guide me to fixing this error.



84234-error.png


c++vs-debugging
error.png (47.1 KiB)
· 3
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.

You seem to be missing a function named main.

0 Votes 0 ·

The code that you are showing, as well as the name of
the program, indicates that you are trying to build a
C# (C Sharp) program. You have posted your question with
the C++ "Tag". You should remove that Tag and add the
dotnet-csharp Tag instead.

  • Wayne

0 Votes 0 ·

Thanks I didn't realize that. I changed it .

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

Before writing the program, try creating a project: go to menu, File, New, Project, select C# language, select “Console App (.NET Framework”), press "Next", etc. This will create a simple program that can be run. Then enter your code inside the Main function.

· 2
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.

90889-error-2.png



I got this error when i tried it. do you know why this is happening?


0 Votes 0 ·
error-2.png (17.0 KiB)

I think that it happened because of damaged Visual Studio. Did you already try to repair or re-install it?

0 Votes 0 ·
DylanZhu-MSFT avatar image
0 Votes"
DylanZhu-MSFT answered DylanZhu-MSFT commented

Hi HieuHO,

In visual studio , you need a solution with a project for C# development(build, debug..., etc). You can follow this document to start the trip of C#: Quickstart: Use Visual Studio to create your first C# console app

Best Regards,
Dylan


If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 2
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.

This did now work for me :(. I am still missing a solution when I create it from the way the instruction were told. any other Suggestion?

0 Votes 0 ·

Hi @HieuHO-0395 , it seems that there is something wrong with visual studio installation. You can try to re-install visual studio. If it doesn't work, I'm afraid that you need to re-install your system.

0 Votes 0 ·
RafaelSiqueiraDeFreitas-6137 avatar image
0 Votes"
RafaelSiqueiraDeFreitas-6137 answered

Hi @HieuHO-0395

Did you manage to solve your problem?
I'm Facing the same error and can't find a way to solve it; :(

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.

SaeedMZF-5001 avatar image
0 Votes"
SaeedMZF-5001 answered

Hello

Please let me know if you find a solution
I am also involved in this problem.

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.

YangDavid-8839 avatar image
0 Votes"
YangDavid-8839 answered YangDavid-8839 published

Hi, a simple solution for me was using the default folder they specified to keep the programs in. For example

C:\Users\<Your Name>\source\repos

This was the one they automatically set for you and if you change where you store the project, it may not know where to look for the files.

Hope this helps!

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.

GamageIshiniSavishka-3320 avatar image
0 Votes"
GamageIshiniSavishka-3320 answered

Go to Tools->Options->Debugging->General and see if the option "Use Managed compatibility mode" is selected. If it is, uncheck it and try again.

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.