Visual Studio 2008 是否使用 SvcUtil.exe,如果“否"使用 svcutil 有什么缺点吗? [英] Does Visual Studio 2008 Use SvcUtil.exe and if "No" is there any disadvantage to using svcutil?

查看:23
本文介绍了Visual Studio 2008 是否使用 SvcUtil.exe,如果“否"使用 svcutil 有什么缺点吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在谷歌上搜索了一下之后,对于 Visual Studio 2008 是否使用 svcutil.exe 没有明确的答案?Visual Studio 2005 确实使用了它,但是 Visual Studio 2008 的 RTM 版本是否使用 svcutil?一些博客说它没有(并使它看起来令人惊讶)

After googling a bit there is no definite answer of whether Visual Studio 2008 uses svcutil.exe or not? Visual Studio 2005 did use it, but do the RTM versions of Visual Studio 2008 use svcutil? A few blogs say it doesn't (and make it seem surprising)

其他网站都说可以.

我问的原因是我们正在使用自定义端点行为扩展(IWsdlExportExtension/IEndpointBehavior 的实现)扁平化我们的 WCF wsdl,并通过 Visual Studio 2008 的添加引用使用扁平化的 wsdl 给我们带来编译错误,因为它正在复制类型/班级.添加引用没有任何错误.另一方面,SvcUtil 将重复的类扔到一个单独的命名空间中,从而解决了构建问题.

The reason I'm asking is we are flattening our WCF wsdl with a custom endpoint behavior extension (an implementation of IWsdlExportExtension/IEndpointBehavior) and using the flattened wsdl via Visual Studio 2008's Add Reference gives us compile errors as it is duplicating Types/Classes. The reference is added without any errors. SvcUtil, on the other hand, throws the duplicate class into a seperate namespace which fixes the build issue.

所以 SvcUtil 可以工作,但 Visual Studio 2008 不能在我们的一些扁平化 wsdls 上运行.如果 Visual Studio 中的添加服务引用不起作用,我们可以继续使用 svcutil,但想知道是否有人知道这样做是否有任何影响.我找不到任何证据表明我们不应该"使用 svcutil,只是它不像在 Visual Studio 2008 中使用添加服务引用那么容易.

So SvcUtil works, but Visual Studio 2008 doesn't on some of our flatten wsdls. We are fine with continueing to use svcutil if the Add Service Reference in Visual Studio doesn't work, but are wondering if anyone knows if there are any implications in doing so. I couldn't find any evidence that we "shouldn't" be using svcutil, just that it isn't as easy as using the Add Service Reference in Visual Studio 2008.

推荐答案

svcutil 和 VS2008 最终调用到相同的 WCF 代码位.它是使用实际的 exe 还是调用 dll 是一个小细节.如果有的话,我更喜欢命令行工具,因为它具有更大的灵活性(或者我可能只是喜欢命令行;-p).

svcutil and VS2008 ultimately call into the same bit of WCF code. Whether it uses the actual exe or calls into a dll is a minor detail. If anything, I prefer the command line tool, as it allows more flexibility (or maybe I just like command line ;-p).

请注意,WCF 可以通过 IDE 和命令行 (/r?) 重新使用现有类型.但这种命名空间问题只是我更喜欢使用命令行版本的众多事情之一.

Note that WCF can re-use existing types, both via the IDE and from the command-line (/r?). But this type of namespace issue is just one of many things I prefer about using the command-line version.

这篇关于Visual Studio 2008 是否使用 SvcUtil.exe,如果“否"使用 svcutil 有什么缺点吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆