web.config中的ASP.NET MVC 5 6 [英] web.config in ASP.NET 5 MVC 6

查看:162
本文介绍了web.config中的ASP.NET MVC 5 6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个WCF的.dll从web.config文件加载配置。搜索结果
莫非:我使用asp.net 5应用该DLL,当我尝试调用的dll从一个函数,我得到的异常结果
没有发现在ServiceModel客户端配置部分引用合同'WebService.MyWebService默认端点元素。这可能是因为没有配置文件,发现你的应用程序,或者是因为匹配这份合同没有终结点元素可以在客户端的元素被发现。
的搜索结果

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.

有关的DLL配置存在web.config中。结果
本应用于asp.net 6测试版的工作,但现在我已经升级到RC1这是行不通的。

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?

推荐答案

如前所述的这里:< BR>结果
有关完整的.NET框架运行结果
当你现在可以使用系统完整的.NET框架中运行时的app.config支持。配置从基于DNX控制台应用程序访问的app.config配置数据。简单的说旁边的project.json文件的XML配置文件。

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.

所以我只需要复制web.config中的内容对的app.config

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

这篇关于web.config中的ASP.NET MVC 5 6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆