SvcUtil.exe vs Add Reference

坚强是说给别人听的谎言 提交于 2020-01-04 01:53:06

问题


Why would someone use SvcUtil.exe when Add Service Reference in VS.NET provides all the proxy classes you'll need?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/13402810/svcutil-exe-vs-add-reference

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!