3

I have a WCF .dll that loads configuration from web.config file.
I'm using that dll in asp.net 5 application, when I try to call a function from dll, I'm getting exception:

Could not find default endpoint element that references contract 'WebService.MyWebService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.

The configuration for dll exists in web.config.
This used to work in asp.net beta 6, but now that I upgraded to rc1 it doesn't work.

How can I make this work?

4

1 回答 1

5

As stated here:

Support for app.config when running on the full .NET Framework
When running on the full .NET Framework you can now use System.Configuration to access configuration data in app.config from a DNX based console application. Simply put your XML configuration file next to your project.json file.

So I only had to copy contents of web.config to app.config

于 2015-12-02T09:56:43.937 回答