开发者

Trying to create WCF client in Visual Studio 2010

开发者 https://www.devze.com 2023-02-16 22:53 出处:网络
I have done the following: Created ContractInterface in ContractProject Created WCFServiceClass in WCFServiceProject which implements ContractInterface with all needed connection definitions:

I have done the following:

  1. Created ContractInterface in ContractProject
  2. Created WCFServiceClass in WCFServiceProject which implements ContractInterface with all needed connection definitions:

Trying to create WCF client in Visual Studio 2010

  1. Created ClientProject with all the needed wrappers
  2. Created ConsoleApplication in sa开发者_如何转开发me solution with all connection definitions and programm which creates client and invokes the wrapper methods.

  3. Ran the Console application with Visual studio 2010 like this: a. Start Service application b. ConsoleApplication and it works just fine.

  4. Then I created Excel addin in different solution and referenced ContractProject and Client project with same connection definitions as previous Console application which worked:

Trying to create WCF client in Visual Studio 2010

  1. Ran the addin in Visual Studio 2010 like this: a. Start Service application in one instance of Visual Studio 2010 b. Start Addin in different instance of Visual Studio

And I had a following massage:

Trying to create WCF client in Visual Studio 2010

Can you please tell me what do i do wrong?


The problem is that your config file is not getting loaded. This is quite a common problem: http://bytes.com/topic/visual-basic-net/answers/373562-can-we-use-app-config-excel-add-component

http://www.netframeworkdev.com/windows-communication-foundation/web-services-dll-appconfig-52966.shtml

You can either do what the configuration file is doing by programmatically instantiating the service.

Or you can try creating an excel.exe.config file in the same directory as excel and putting your configuration in that file.

I would go with the first approach!

0

精彩评论

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