110

For my WCF, I need to generate configuration file for my client application to specify things such as binding of service, the address of the service and the contract.

nellbryant
  • 3,109
  • 4
  • 20
  • 16

6 Answers6

153

Type in the Microsoft Visual Studio Command Prompt: where svcutil.exe. On my machine it is in: C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\SvcUtil.exe

Petar Minchev
  • 46,889
  • 11
  • 103
  • 119
  • 17
    I got it. Open the Visual studio command prompt then type in "where svcutil.exe". Mine is below: c:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NetFX 4.0 Tools\SvcUtil.exe or c:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\SvcUtil.exe – nellbryant Feb 02 '11 at 17:55
  • 8
    The command promt itself is found in the start menu under `Visual Studio 2015\Visual Studio Tools\Developer Command Prompt for VS2015` (for Visual Studio 2015 at least). – Zero3 Mar 03 '16 at 13:24
  • If you're trying to install the v 7.1 of the SDK (and you happen to be on Windows 7 x64), it seems MS has removed svcutil.exe from it. It's nowhere to be found whether you jump through all the hoops to get around the installation errors, or you download the ISO, it's just not there. That wasted about 3 hours of my day... thanks MS. Why would they remove it? Don't know. Anyway I was able to install the 6.1 version of the SDK, which still contains svcutil.exe (in the bin folder), using Chocolatey, from here: https://chocolatey.org/packages/windows-sdk-6.1 – David Barrows Jul 24 '17 at 14:28
  • I n my Windows 11 and Visual Studio 2017 environment, I have it on C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\SvcUtil.exe – sergiol May 25 '22 at 14:58
25

With latest version of windows (e.g. Windows 10, other servers), type/search for "Developers Command prompt.." It will pop up the relevant command prompt for the Visual Studio version.

e.g. Developer Command Prompt for VS 2015

More here https://msdn.microsoft.com/en-us/library/ms229859(v=vs.110).aspx

Venkatesh Muniyandi
  • 5,132
  • 2
  • 37
  • 40
18

If you are using vs 2010 then you can get it in

C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools
Irvin Dominin
  • 30,819
  • 9
  • 77
  • 111
4

Try to generate the proxy class via SvcUtil.exe with command

Syntax:

svcutil.exe /language:<type> /out:<name>.cs /config:<name>.config http://<host address>:<port>

Example:

svcutil.exe /language:cs /out:generatedProxy.cs /config:app.config http://localhost:8000/ServiceSamples/myService1

To check if service is available try in your IE URL from example upon without myService1 postfix

sjngm
  • 12,423
  • 14
  • 84
  • 114
st35ly
  • 1,215
  • 18
  • 24
  • what's the purpose of generating a proxy class? If I add the service reference to a C# project, it seems to generate it for me? – PositiveGuy Oct 14 '13 at 08:02
  • For data deserialization. You can add the service reference to the project, but the solution to have it as own generated classes seems to me much clearer. For example, if you're using validations or mappings. Also when structure is changing to often, regenerating of references always does a lot of mess. – st35ly Feb 09 '14 at 22:01
2

To find any file location

  1. In windows start menu Search box
  2. type in svcutil.exe
  3. Wait for results to populate
  4. Right click on svcutil.exe and Select 'Open file location'
  5. Copy Windows explorer path
James Fleming
  • 2,589
  • 2
  • 25
  • 41
  • 2
    Doesn't work on my system, even though svcutil is present in four locations. – JohnL4 Nov 27 '12 at 17:59
  • 4
    @JohnL4, you might want to consider expanding the location the Windows Search utility looks. You can do this by opening Control Panel->Indexing Options and clicking the Modify button to add additional folders to the Index Locations. (In this case, it appears that "Program Files" or "Program Files (x86)" is not in the current list of your "Included Locations") – kmote Feb 19 '13 at 15:57
2

I don't think it is very important to find the location of Svcutil.exe. You can use Visual Studio Command prompt to execute directly without its absolute path,

Syntax:
svcutil.exe /language:[vb|cs] /out:[YourClassName].[cs|vb] /config:[YourAppConfigFile.config] [YourServiceAddress]

example:
svcutil.exe /language:cs /out:MyClientClass.cs /config:app.config http://localhost:8370/MyService/
itb564
  • 223
  • 4
  • 10
  • 3
    Actually no. Visual Studio Command prompt just sets some environment variables, one of them is `PATH`, before executing cmd.exe. If for any legit reason the `svcutil.exe` is not in any `PATH` directory, you cannot execute it without absolute path. – laika Jul 07 '14 at 15:17