locked
Console.WriteLine Not Working In VB 2010 Express RRS feed

  • Question

  • Hi, I just recently was creating a Console Application in VB 2010 and I try to use Console.Writeline and i get an error that says: Expression is a value and therefore cannot be the target of an assignment. I've used this command multiple times before, so there is no logical reason for it not to work. When I press debug it tells me there were successful build errors and doesn't even let me run the program. Any help would be appreciated.

    Module Module1

        Sub Main()
            Console.WriteLine = ("Hello")

        End Sub

    End Module

    Wednesday, February 13, 2013 12:02 AM

Answers

  • Never mind, I figured it out. In case anyone has the same problem, this is the actual code

    Console.WriteLine("hello")

    instead of

    Console.WriteLine =("hello")

    • Proposed as answer by Devon_Nullman Wednesday, February 13, 2013 4:18 PM
    • Marked as answer by Youen Zen Wednesday, February 20, 2013 8:37 AM
    Wednesday, February 13, 2013 12:11 AM
  • Maybe you need to add Imports System at the top of your Module

    System.Console

    Namespace:    System
    Assembly:   mscorlib (in mscorlib.dll)


    You've taught me everything I know but not everything you know.

    • Proposed as answer by Renee Culver Wednesday, February 13, 2013 5:06 AM
    • Marked as answer by Youen Zen Wednesday, February 20, 2013 8:37 AM
    Wednesday, February 13, 2013 12:11 AM

All replies

  • Never mind, I figured it out. In case anyone has the same problem, this is the actual code

    Console.WriteLine("hello")

    instead of

    Console.WriteLine =("hello")

    • Proposed as answer by Devon_Nullman Wednesday, February 13, 2013 4:18 PM
    • Marked as answer by Youen Zen Wednesday, February 20, 2013 8:37 AM
    Wednesday, February 13, 2013 12:11 AM
  • Maybe you need to add Imports System at the top of your Module

    System.Console

    Namespace:    System
    Assembly:   mscorlib (in mscorlib.dll)


    You've taught me everything I know but not everything you know.

    • Proposed as answer by Renee Culver Wednesday, February 13, 2013 5:06 AM
    • Marked as answer by Youen Zen Wednesday, February 20, 2013 8:37 AM
    Wednesday, February 13, 2013 12:11 AM