Sergey Kucher
Sergey Kucher

Reputation: 4180

Trying to create WCF client in Visual Studio 2010

I have done the following:

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

enter image description here

  1. Created ClientProject with all the needed wrappers
  2. Created ConsoleApplication in same 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:

enter image description here

  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:

enter image description here

Can you please tell me what do i do wrong?

Upvotes: 0

Views: 719

Answers (1)

Varun Chatterji
Varun Chatterji

Reputation: 5099

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!

Upvotes: 1

Related Questions