How to run svcutil.exe from behind authenticating proxy

前端 未结 1 735
温柔的废话
温柔的废话 2021-01-12 09:52

I want to run the svcutil.exe tool to access a web service on the internet. Unfortunately, whenever I try, I get a bunch of errors that include the following me

相关标签:
1条回答
  • 2021-01-12 10:38

    Well, I think I have figured out the answer to my question:

    It turns out that the default .config file used by svcutil.exe is called svcutil.exe.config, and (at least for me) it lives in this folder:

    C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin
    

    I decided to just edit that file directly (rather than fumble around with the /svcutilConfig switch). I needed Admin privileges to do so.

    The final contents of that file looked like this:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <runtime>
        <generatePublisherEvidence enabled="false" />
      </runtime>
      <system.net> 
        <defaultProxy useDefaultCredentials="true" /> 
      </system.net>
    </configuration>
    

    (with the secret sauce buried in the <system.net> element.)

    In order for this all to work, I had to start the Command Prompt as Administrator, navigate to the folder listed above, and run the svcutil.exe command from there.

    Hope this helps some other poor soul who gets stuck in this mess! Thanks to @AndrewWebb for the clues that got me going!

    0 讨论(0)
提交回复
热议问题