简体   繁体   中英

SvcUtil.exe vs Add Reference

当VS.NET中的“添加服务引用”提供您需要的所有代理类时,为什么有人会使用SvcUtil.exe?

Sometimes Add Service Reference in VS fails to create a useful proxy. Instead it gives you an empty Reference.cs details here and here file. I've created a series of bat files to call SvcUtil.exe to generate the proxy classes.

Both svcutil.exe & 'Add Service reference' will use the same proxy generation code underneath. Think of 'Add service reference' as a UI way to generate proxy where it pre-populates a set of switches that you will have to do in svcutil command line. For example when you add service reference in VS the UI lets you to reuse types from referenced assemblies, specify the kind of proxy to be generated (sync-async / task based etc). svcutil will also be useful if you want to automate service reference generation.

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