开发者

Consuming a WCF service within a VS 2010 extension

开发者 https://www.devze.com 2023-03-17 19:21 出处:网络
I am developing a VS 2010 extension using the Visual Studio 2010 SDK SP1 that is designed to consume a WCF service.The extension is a ToolWindow that docks in the IDE and provides interfacing with dat

I am developing a VS 2010 extension using the Visual Studio 2010 SDK SP1 that is designed to consume a WCF service. The extension is a ToolWindow that docks in the IDE and provides interfacing with database objects and service operations that I can integrate with my code. I have connected to this service elsewhere in my solution without any problems.

The problem seems to arise from the fact that VS exten开发者_如何学JAVAsions do not have an App.config file that they can use to store the service configuration. I know it is possible to define the service and consume it programmatically, but that would require a large rewrite of my existing networking code. The exception message I get while debugging the extension is:

Could not find default endpoint element that references contract 'IDataServerService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.

Is there any way to have a VS extension read WCF service configuration from the config file rather than define the client proxy programmatically?

Thanks for your help.


You can try to add your service configuration to Visual Studio's config file: devenv.exe.config located by default in %VSINSTALLDIR%\Common7\IDE


I think the best way to do this is to do it programmatically if you dont want to edit the devenv.exe.config file.

0

精彩评论

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

关注公众号