I have done the following:
- Created ContractInterface in ContractProject
- Created WCFServiceClass in WCFServiceProject which implements ContractInterface with all needed connection definitions:
- Created ClientProject with all the needed wrappers
Created ConsoleApplication in sa开发者_如何转开发me solution with all connection definitions and programm which creates client and invokes the wrapper methods.
Ran the Console application with Visual studio 2010 like this: a. Start Service application b. ConsoleApplication and it works just fine.
- Then I created Excel addin in different solution and referenced ContractProject and Client project with same connection definitions as previous Console application which worked:
- 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:
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!
精彩评论