WebConfigurationManager error after adding siteMap
Posted
by aron
on Stack Overflow
See other posts from Stack Overflow
or by aron
Published on 2010-05-16T04:10:23Z
Indexed on
2010/05/16
4:20 UTC
Read the original article
Hit count: 323
Hello I'm getting this error:
Compiler Error Message: CS0118: 'Configuration' is a 'namespace' but is used like a 'type' Configuration myWebConfig = WebConfigurationManager.OpenWebConfiguration("~/");
This code has been in place for 5+ months without this issues, only today after adding this sitemap code do I have this issue.
<siteMap defaultProvider="ExtendedSiteMapProvider" enabled="true">
<providers>
<clear/>
<add name="ExtendedSiteMapProvider" type="Configuration.ExtendedSiteMapProvider" siteMapFile="Web.sitemap" securityTrimmingEnabled="true"/>
</providers>
</siteMap>
I tried adding "System.Web." before the "Configuration ", but that did not work either:
System.Web.Configuration myWebConfig = WebConfigurationManager.OpenWebConfiguration("~/");
Error 1 'System.Web.Configuration' is a 'namespace' but is used like a 'type'
© Stack Overflow or respective owner