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

為{幸葍}努か 提交于 2019-12-25 04:46:14

问题


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.

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

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?

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


回答1:


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.

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.



来源:https://stackoverflow.com/questions/32261126/the-global-element-configuration-has-already-been-declared-when-adding-net-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!