是否可以从VS2010插件刷新WCF服务参考? [英] Is it possible to refresh WCF service reference from VS2010 addin?

查看:107
本文介绍了是否可以从VS2010插件刷新WCF服务参考?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在VS2010插件中模拟右键单击/更新服务参考命令。我有一个对包含(Silverlight ...)项目的引用,我知道服务引用的名称和服务的url。

我发现了这一点: http://dedjo.blogspot.com/2007/03/adding-web- references-to-your-vs.html ,但仅适用于asmx(它使用System.Web.Services而不是System.ServiceModel),而不适用于wcf。
可以选择但是从代码中调用svcutil吗?如果是这样,怎么办? (我使用svcutil还是slsvcutil?如何从插件内部调用它?)

谢谢

I want to "simulate" the Right click/Update service reference command in a VS2010 addin. I have a reference to the containing (Silverlight...) project, I know the name of the service reference and the url of the service.
I've found this: http://dedjo.blogspot.com/2007/03/adding-web-references-to-your-vs.html , but it only works for asmx (it uses System.Web.Services instead of System.ServiceModel), not wcf. Is there any choice but call svcutil from code? if so, how? (do I use svcutil or slsvcutil? How do I call it from inside the addin?)
thanks

推荐答案

我相信Visual Studio的命令是 Project.UpdateServiceReference 。因此,我想您可以尝试选择您感兴趣的节点,然后像下面这样运行该命令:

I believe the visual studio command for this is "Project.UpdateServiceReference". So I guess you can try to select the node you're interested in, and run this command, like this:

envDTE.Windows.Item(vsWindowKindSolutionExplorer).Activate();
envDTE.ActiveWindow.Object.GetItem(@"MyProject\Service References\Proxy").Select(vsUISelectionType.vsUISelectionTypeSelect);
envDTE.ExecuteCommand("Project.UpdateServiceReference");

这篇关于是否可以从VS2010插件刷新WCF服务参考?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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