开发者

How to Generate a proxy class in a specific project by using svcutil.exe?

By default svcutil.exe generates proxy class and its .config in C:\Program Files\Microsoft Visual Studio 9.0\VC. What 开发者_Go百科is syntax for generating a proxy class in a specific project by using svcutil.exe ?


Use the /directory option.
To quote directly from the help which is displayed when you type svcutil /? :

 /directory:<directory>      - Directory to create files in (default: current directory) (Short Form: /d)

Just to elaborate a little more... svcutil just generates the files, it doesn't manipulate the .proj file to add a file to the project, you have to do that yourself. What you might want to do is:

  • show all files in the Solution Explorer, then refresh the folder containing the generated files, then select them all and add them to the project (you should remove the existing files before doing a manual generation)
  • write a little batch script or command line app that iterates the folder the files are created in and inserts entries for them into the .proj file.
  • if possible use the Add Service Reference option from the context menu in the Solution Explorer, that generates the files and adds them to the project for you
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜