Dll with WebServices from .Net to vb6 - how to setup app.config

匆匆过客 提交于 2020-01-05 06:19:44

问题


I have a DLL that works with a webServices.

I developed some projects with .NET that consume this DLL and work without problems.

I also have some projects developed in VB6 and I need to consume this DLL, but when I call the method where the webservice is running, it shows me the following message.

Could not find default endpoint element that references contract 'MYDLLNAME' in the service model client configuaration section. This might be because no configuaration file was found for your application or because no end point element matching this contract could be found in the client element

I solved this problem at the beginning with the projects of .NET, I added a part of the app.config of the project of the DLL in the app.config of the project main and it worked correctly.

My question is, how do I resolve it in VB6?


回答1:


Imagine you have:

  • a DLL called project1.dll written in .NET, that requires an app.config
  • a EXE called project2.exe written in .NET
  • a EXE called project3.exe written in VB6.

You need to copy a part of the project1 app.config to project3.exe.config.

What you did before was to copy the relevant section to project2 app.config, that when compiled is renamed to project2.exe.config.

Please note, that while you are using the VB6 IDE, the process that requires an app.config is the VB6.exe, so I would also copy that app.config to the VB6 folder and renamed it as VB6.exe.config. See this answer



来源:https://stackoverflow.com/questions/47842565/dll-with-webservices-from-net-to-vb6-how-to-setup-app-config

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!