向 MVC 项目添加 .net 2.0 Web 服务引用时已声明全局元素“配置" [英] The Global element 'configuration' has already been declared when adding .net 2.0 web service reference to MVC project

查看:30
本文介绍了向 MVC 项目添加 .net 2.0 Web 服务引用时已声明全局元素“配置"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于 web.config 中的警告,我的构建失败.在我将 .net 2.0 Web 服务引用添加到 MVC 项目之前,一切都很好.我收到了全局元素 '{element name}' 的警告已经为我的 web.config 中的所有元素声明.搜索只发现了与我遇到的问题不同的问题.

I am getting build failure due to warning in my web.config. Everything was fine before I added .net 2.0 Web service reference to the MVC project. I got warnings of Global element '{element name}' has already been declared for all the elements in my web.config. Searching has only turned up different issues than the one I am having.

有没有办法解决这个问题,也许是通过告诉配置管理器忽略引用的 WS 程序集中的配置文件?

Is there any way to fix this issue, perhaps by telling the configuration manager to ignore the config file in the referenced WS assembly?

我无法使用常规服务参考,因为我无法通过 https 调用它.或者有没有办法将 2.0 web 服务引用为可以通过 https/ssl 连接调用的常规服务引用?

I can not use the regular service reference as I am not able to call it via https. Or is there a way to reference the 2.0 web service as the regular service reference that can be invoked via https/ssl connection?

我也在项目中声明了一个 WCF 服务引用,这会使事情复杂化吗?

I also have a WCF service reference declared in the project, will that complicate the matter?

推荐答案

我想通了.我不必向项目添加 .net 2.0 WS 引用.我可以在 web.config 中使用将传输协议指定为 https.

I figured out. I don't have to add .net 2.0 WS reference to the project. I can use in web.config to specify the transport protocol to be https.

然而,添加网络引用会使 web.config 元素无效.我想了解其原因,并感谢您的意见.

However, it is wired that adding a web reference would invalidate the web.config elements. I would like to learn the cause of that and would appreciate your input.

这篇关于向 MVC 项目添加 .net 2.0 Web 服务引用时已声明全局元素“配置"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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