简体   繁体   中英

Using the Command Window in Visual Studio

I'm trying to follow this walk-through:

Hosting a WCF in a Windows Service

Up to this step:

Step 6: Install the Windows Service In this step, you install the Windows service and run it from the Services console.

  1. Rebuild the solution and open a Visual Studio command prompt.
  2. Browse to the bin directory of the project where WindowsService1.exe is located.
  3. Run the following command to install the service:

Installutil WindowsService1.exe

I've never used VS Command Prompt before. How do I do number 2 Browse to the bin directory of the project where WindowsService1.exe is located ?
What do I type in after the >
Using normal command line syntax like cd doesn't work so how do I browse to a location using this tool? For example if I type this into the Command Window cd "C:\\" it returns Command "cd" is not valid.

edit hmmm have found something ... MSDN

cd does work. However, keep in mind that if the path you're trying to get to has spaces, you need quotes around it (the path). Eg:

cd "C:\Program Files\Microsoft Visual Studio 10.0"

Also, note that the "Visual Studio command prompt " that is mentioned in Step 6 is not the "Visual Studio Command Window " - I think this is where the problem comes from. The command prompt is a separate executable that you can start by clicking Start, point to All Programs, point to Microsoft Visual Studio, point to Visual Studio Tools, and then click Visual Studio Command Prompt. Alternatively, just search "Visual Studio" in the search bar in the Start menu, and it should show up

The easier way to "Step 6" whytheq would be to right click on your project in Visual Studio and then click on "Open Folder in Windows Explorer". A window should pop up and you should see your "Bin" directory. Just hold down "Shift" and right click on the "Bin" directory and click "Open Command Window Here". That should open a command window right where you need to complete step 6 above!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM