Hello Friends,
I am getting error as 'Console' does not exist in the current context' while creating an application in visual studio ?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Shweta LodhaRank #31 · 39.8K reputationPosted Mar 3, 2014, 11:17 AM EST
even I didn't found any issue with your code. I hope you are using the correct template for console application. Apart from this, I can't see any issue with your code :(
leelha75 reputationPosted Mar 4, 2014, 8:49 AM EST
@Vulpes: while copying code here, I missed the braces, but in actual code i have all the paired braces.
@Shweta: thanks for providing me the pointer. Actulaly I am new to application developemnt. The VS version i was using was not having Console application template. So, I thought that I need to create it from scratch.
Shweta LodhaRank #31 · 39.8K reputationPosted Mar 3, 2014, 10:17 AM EST
Are you working on console application ? If possible, please post your code.
leelha75 reputationPosted Mar 3, 2014, 11:16 AM EST
Hi Shweta,
Yes it is console application and code is very simple.
namespace myNamespace{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("welcome");
Console.ReadLine();
}
VulpesRank #55 · 29.2K reputationPosted Mar 3, 2014, 11:29 AM EST
using System;
namespace myNamespace{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("welcome");
Console.ReadLine();
}
}
}
Abhay ShankerRank #375 · 6.7K reputationPosted Mar 3, 2014, 6:55 PM EST
using System;