Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem visual studio code
Message
 
 
To
15/03/2022 10:04:26
General information
Forum:
C#
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01683863
Message ID:
01683870
Views:
38
>>Hi Bill,
>>
>>I didn't have it
>>
>>Now I have code that looks like this
>>
>>using system;
>>Console.WriteLine("Veuillez saisir votre prénom.");
>>string prenom = console.readline();
>>console.writeline("Veuillez saisir votre age.");
>>string age = console.readline();
>>console.WriteLine("Bonjour " + prenom + ", vous avez " + age + " ans.");
>>
>>
>>>>Hello all,
>>>>
>>>>I am beginning to learn C# with video classes.
>>>>
>>>>Weird thing happening. Some times (rarely) intelllisense kicks in. Then I'm allowed to add lines of code and then execute afterwards.
>>>>
>>>>I can't enter "Console.writeline" for example because intellisense doesn't show me the rest of what is available.
>>>>
>>>>So I entered the lines of code even if intellisense doesn't seem to be active thinking that the code should execute.
>>>>
>>>>When I try a "dotnet run" I have many errors. Of those errors there is one saying "Console" doesn't exist in the actual context.
>>>>
>>>>I have the Omnisharp extension installed.
>>>
>>>Does your code include:
>>>using System;
>>>?
>
>I created a simple console application and put your code into it.
>It wouldn't compile.
>.NET is case sensitive.
>I made some changes.
>See below.
>That compiled.
>
>
>
>
>using System;
>using System.Collections.Generic;
>using System.Linq;
>using System.Text;
>
>namespace ConsoleApplication1
>{
>    class Program
>    {
>        public void tester()
>        {
>            Console.WriteLine("Veuillez saisir votre prénom.");
>            string prenom = Console.ReadLine();
>            Console.WriteLine("Veuillez saisir votre age.");
>            string age = Console.ReadLine();
>            Console.WriteLine("Bonjour " + prenom + ", vous avez " + age + " ans.");
>        }
>    }
>}
>
Sorry for jumping in with a question. I created a console application, exactly as you wrote (above), but when I run it I get error:
Error		Program does not contain a static 'Main' method suitable for an entry point	
I changed the name of the Tester to Main but I get the same error.

What am I missing?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform