Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Couldn't compile

I couldn't compile the console application in DOS prompt as said in Lesson 2 of VB.net

Comments

  • MatthewTSMatthewTS Member Posts: 1
    : I couldn't compile the console application in DOS prompt as said in Lesson 2 of VB.net
    :
    I had the same problem. I found the solution in the MSDN Library. Follow instruction below.

    You can invoke the command-line compiler by typing the name of its executable file into the command line, also known as the MS-DOS prompt. If you compile from the default Windows Command Prompt, you must type the fully qualified path to the executable file into the command prompt. To override this default behavior, you can either use the Visual Studio 2005 Command Prompt, or modify the PATH environment variable. Both allow you to compile from any directory by simply typing the compiler name.

    When compiling from the command line, you must explicitly reference the Microsoft Visual Basic Run-Time Library through the /reference compiler option.

    To invoke the compiler using the Visual Studio .NET Command Prompt
    Open the Visual Studio Tools program folder within the Microsoft Visual Studio program group.

    You can use the Visual Studio 2005 Command Prompt to access the compiler from any directory on your machine, if Visual Studio 2005 is installed.

    Invoke the Visual Studio Command Prompt.

    At the command line, type vbc.exe /reference:Microsoft.VisualBasic.dll, and then press ENTER.

    For example, if you stored your executable files in a directory called "SourceFiles", you would open the command prompt, type cd SourceFiles to change to that directory, and then type vbc.exe.

    To set the PATH environment variable to the compiler for the Windows Command Prompt
    Use the Windows Search feature to find vbc.exe on your local disk.

    The exact name of the directory where the compiler is located depends on the location of the Windows directory and the version of the .NET Compact Framework installed. If you have more than one version of the .NET Compact Framework installed, you must determine which version to use (typically the latest version).

    From your Start Menu, Right-click My Computer, and then right-click on the My Computer window to open the SystemProperties.

    Select the Advanced tab and click the Environment Variables button.

    In the System variables pane, select Path from the list and click Edit.

    In the Edit System Variable dialog box, move the insertion point to the end of the string in the Variable Value field and type a semicolon (;) followed by the full directory name found in Step 1.

    Click OK to confirm your edits and close the dialog boxes.

    After you change the PATH environment variable, you can run the Visual Basic compiler at the Windows command prompt from any directory on the computer.

  • walkerbxwalkerbx Member Posts: 1
    : : I couldn't compile the console application in DOS prompt as said in Lesson 2 of VB.net
    : :
    : I had the same problem. I found the solution in the MSDN Library. Follow instruction below.
    :
    : You can invoke the command-line compiler by typing the name of its executable file into the command line, also known as the MS-DOS prompt. If you compile from the default Windows Command Prompt, you must type the fully qualified path to the executable file into the command prompt. To override this default behavior, you can either use the Visual Studio 2005 Command Prompt, or modify the PATH environment variable. Both allow you to compile from any directory by simply typing the compiler name.
    :
    : When compiling from the command line, you must explicitly reference the Microsoft Visual Basic Run-Time Library through the /reference compiler option.
    :
    : To invoke the compiler using the Visual Studio .NET Command Prompt
    : Open the Visual Studio Tools program folder within the Microsoft Visual Studio program group.
    :
    : You can use the Visual Studio 2005 Command Prompt to access the compiler from any directory on your machine, if Visual Studio 2005 is installed.
    :
    : Invoke the Visual Studio Command Prompt.
    :
    : At the command line, type vbc.exe /reference:Microsoft.VisualBasic.dll, and then press ENTER.
    :
    : For example, if you stored your executable files in a directory called "SourceFiles", you would open the command prompt, type cd SourceFiles to change to that directory, and then type vbc.exe.
    :
    : To set the PATH environment variable to the compiler for the Windows Command Prompt
    : Use the Windows Search feature to find vbc.exe on your local disk.
    :
    : The exact name of the directory where the compiler is located depends on the location of the Windows directory and the version of the .NET Compact Framework installed. If you have more than one version of the .NET Compact Framework installed, you must determine which version to use (typically the latest version).
    :
    : From your Start Menu, Right-click My Computer, and then right-click on the My Computer window to open the SystemProperties.
    :
    : Select the Advanced tab and click the Environment Variables button.
    :
    : In the System variables pane, select Path from the list and click Edit.
    :
    : In the Edit System Variable dialog box, move the insertion point to the end of the string in the Variable Value field and type a semicolon (;) followed by the full directory name found in Step 1.
    :
    : Click OK to confirm your edits and close the dialog boxes.
    :
    : After you change the PATH environment variable, you can run the Visual Basic compiler at the Windows command prompt from any directory on the computer.
    :
    :

    I clearly have a different error message. When i try to compile from command prompt, it reports that 'vbc' is not a recognised internal or external command. So it doesn't even begin to look for the file/ Any ideas?

Sign In or Register to comment.