asp.net - WebConfigurationManager error after adding siteMap -


Compiler Error Message: CS0118: 'Configuration' A 'Namespace 'Is used but it is used as' configuration' myWebConfig = WebConfigurationManager.OpenWebConfiguration ("~ /");

This code has been done for 5 + months without this problem, only after adding this Sitemap I have this problem in code.

  & lt; Sitemap default provider = "Extended Sitemap Provider" enabled = "true" & gt; & Lt; Providers & gt; & Lt; Clear /> & Lt; Add name = "extended sitemap provider" type = "configuration. Extended sitemap provider" siteMapFile = "Web.sitemap" securityTrimmingEnabled = "true" /> & Lt; / Providers & gt; & Lt; / Sitemap & gt;  

I tried to add "system web." Before "configuration", but it does not work either:

  System. Web. Configuration myWebConfig = WebConfigurationManager.OpenWebConfiguration ("~ /"); Error 1 'System.Web.Configuration' is a 'namespace', but it is used as 'type'   

the system. Configuration. Configuration instead of System.Web.configuration

  // Obtain configuration object for a web application // Server running on local server. System.configuration.Configuration config = WebConfigurationManager.OpenWebConfiguration ("/ ~") as System.Configuration.configuration;  

Comments