Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem visual studio code
Message
From
15/03/2022 10:54:42
 
 
To
15/03/2022 10:04:26
General information
Forum:
C#
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01683863
Message ID:
01683868
Views:
36
Bill,

Problem was in fact with my version of build. So 2 solutions here. Either install new version of visual studio or add a json file for omnisharp.

Content of the omnisharp json file should be

{ "msbuild": { "useBundledOnly": true } }

This file should be in the main directory of the project.

Thank yhou for your code.

regards


>>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.");
>        }
>    }
>}
>
*******************************************************
Save a tree, eat a beaver.
Denis Chassé
Previous
Reply
Map
View

Click here to load this message in the networking platform