0

I opened a program I had made yesterday which ran just fine yesterday but today in Visual Studio 2013 Express for Windows, the 'Console' part of all of the 'Console.WriteLine("");' are underlined in red, giving the error 'doesnt exist in current context' - Ive looked for several solutions but I cant find any - I've just started out and its frustrating not being able to test my programs, the code below is a super simple version that gives the same error. Thanks in advance for any help.

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

class Start
{
    static void Main(string[] args)
    {
        Console.WriteLine("This is an Error :S");
    }
}
oscholten
  • 37
  • 4

2 Answers2

0

There is no namespace. Wrap the existing class in a namespace.

B-Rad
  • 383
  • 1
  • 14
0

If I understand correctly, you're trying to create a Windows 8 app. Console is unavailable in this type of app as explained here.

Types and members that are not applicable to developing Windows Store apps (such as console and ASP.NET types).

keyboardP
  • 68,824
  • 13
  • 156
  • 205
  • That makes sense but he said he tried yesterday and it was working – chiapa Jul 22 '14 at 14:14
  • Ah sorry, you're right, I missed that. It's strange it would work in a Windows 8 app in the first place :/ – keyboardP Jul 22 '14 at 14:15
  • thats it!! :D <3 i was on my laptop yesterday (windows 7) thankyou – oscholten Jul 22 '14 at 14:27
  • @oscholten - do you realise that saying "it worked yesterday" usually implies, without further qualification, "on this machine, using this version of Visual Studio", rather than "on a completely different machine using a different version of Visual Studio" - how were we meant to guess at that when you just said "it worked yesterday"? – Damien_The_Unbeliever Jul 22 '14 at 14:46