简体   繁体   English

将.net 2.0 Web服务引用添加到MVC项目时,已经声明了全局元素“配置”

[英]The Global element 'configuration' has already been declared when adding .net 2.0 web service reference to MVC project

I am getting build failure due to warning in my web.config. 由于我的web.config中出现警告,导致构建失败。 Everything was fine before I added .net 2.0 Web service reference to the MVC project. 在将.net 2.0 Web服务引用添加到MVC项目之前,一切都很好。 I got warnings of Global element '{element name}' has already been declared for all the elements in my web.config. 我收到警告,已经为我的web.config中的所有元素声明了全局元素'{element name}'。 Searching has only turned up different issues than the one I am having. 搜索只会发现与我遇到的问题不同的问题。

Is there any way to fix this issue, perhaps by telling the configuration manager to ignore the config file in the referenced WS assembly? 是否可以通过告诉配置管理器忽略引用的WS程序集中的配置文件来解决此问题?

I can not use the regular service reference as I am not able to call it via https. 我无法使用常规服务参考,因为我无法通过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? 还是有一种方法可以将2.0 Web服务引用为可以通过https / ssl连接调用的常规服务引用?

Edit: I also have a WCF service reference declared in the project, will that complicate the matter? 编辑:我在项目中也声明了WCF服务引用,这会使事情复杂化吗?

I figured out. 我想通了。 I don't have to add .net 2.0 WS reference to the project. 我不必向项目添加.net 2.0 WS参考。 I can use in web.config to specify the transport protocol to be https. 我可以在web.config中使用以指定传输协议为https。

However, it is wired that adding a web reference would invalidate the web.config elements. 但是,可以确定的是,添加Web参考将使web.config元素无效。 I would like to learn the cause of that and would appreciate your input. 我想了解原因,并感谢您的投入。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM