10

I'm trying to call svcutil.exe specifying a namespace parameter, but whatever I do, I get an error, even if I am reusing working examples from the Internet.

For example, here I tried the simplest option just for testing - /namespace:*,My.Proxy.

Here is the whole line which I call from powershell script:

$svcUtilresult =  & "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\svcutil.exe" /namespace:*,My.Proxy /out:$csFile $svcUri /config:$configPath;

And here is the error I'm getting:

svcutil.exe : Error: Invalid value * passed to the /namespace option. Specify a comma-separated target namespace and CLR namespace pair.

I tried passing there real namespaces with and without quotation marks, empty values, other strings and all the time I'm getting the error invalid value.

Could you point me, what I'm doing wrong? Thanks a lot!

Anelook
  • 1,277
  • 3
  • 17
  • 28
  • Have you tried taking the Powershell element out of the equation and just using the `Svcutil.exe` utility on it's own? I've used both `/namespace` and the shorthand `/n` and both work well for me in the native tool. I'm wondering if the asterisk must be enclosed when sending to Powershell and your syntax for `svcutil.exe` are correct. – atconway Nov 05 '13 at 21:28

2 Answers2

6

Try to wrap namespace into quotes, like this:

/namespace:"*,My.Proxy"
JKennedy
  • 18,150
  • 17
  • 114
  • 198
Mikee
  • 626
  • 1
  • 10
  • 23
0

it's how PowerShell interprets the dot "."
Running the same command on command prompt will not generate such error.

Amr Ellafy
  • 730
  • 8
  • 26