Access a COM component from a classic ASP that uses a WCF throw error

I created a COM interaction component using ClassLibrary that uses WCF. Now, when I call the COM component of Method (which uses WCF) from my classic ASP page, I get the following error.

Type of error: System.ServiceModel (0x80131509) Could not find the default value for the end element that refers to the contract "DLSWS.IDLSWS" in the ServiceModel client configuration section. This may be because no configuration file was found for your application, or because there is no endpoint element matching this contract, you can find the element in the client.

From the above error, I understand that the asp page cannot read the WCF configuration from the app.config file in the COM component. How can I solve this problem?

+1
source share
2 answers

You can either set the endpoint programmatically when creating a client channel inside your COM object, or use app.config.

To install app.config for a COM + application:

If you are using Windows 2000 and your COM + application is server-side, app.config should be called dllhost.exe.config and should be the same as dllhost.exe (% SystemRoot% \ System32).

If you use Windows 2003, you can go to the COM + Activation tab and set the property of the application root directory to the location of your preference, and in this directory you should place a file called application.config (with configuration settings) and another file caller application.manifest with the image below:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> </assembly> 
+2
source

Does the COM component have an App.config file? If not, it is likely that COM will not be able to access the configuration in web.config.

Create the App.config file for the component or transfer the Endpoint instance from the web application.

0
source

All Articles