指定自动生成的Web服务代理类的CLR命名空间

发布于 2024-09-18 09:59:46 字数 448 浏览 1 评论 0原文

当您在 Visual Studio 的 ASP.NET 项目中添加 Web 引用时,始终会添加 Web 应用程序的根命名空间

因此,如果我添加一个名为 MyWebService 的 Web 引用,并且应用程序的默认命名空间为 MyApplication,则生成的代理类的命名空间将为: MyApplication.MyWebService< /强>。

但是,我希望能够指定生成的类使用哪个命名空间(跳过默认命名空间并让命名空间简单地称为 MyWebService)。

通过命令行使用 wsdl.exe 是实现此目的的唯一方法吗?我不想手动编辑生成的类(因为它可以重新生成)。

非常感谢任何帮助! :)

When you add a Web Reference in an ASP.NET project in Visual Studio the web application's root namespace is always added.

So, if I add a web reference called MyWebService and the default namespace of the application is MyApplication the namespace of the generated proxy class will be: MyApplication.MyWebService.

However, I want to be able to specify which namespace to use for the generated class (to skip the default namespace and have the namespace be called simply MyWebService).

Is using wsdl.exe through the command line the only way of accomplishing this? I don't want to manually edit the generated class (since it can get re-generated).

Any help is greatly appreciated! :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

习惯成性 2024-09-25 09:59:46

似乎使用 wsdl.exe 几乎是唯一的选择?

我求助于使用预构建事件来生成代理类。发布一个 在这里发布我是如何做到的

Almost seems using wsdl.exe is the only option?

I resorted to using a pre-build event for generating the proxy class. Put out a post on how I did it here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文