.NET 2.0 SiteMap使用的时候有一个错误

在代码中:SiteMap.Providers引发了一个ConfigurationErrorException,我检查了一下相关的XML配置没有发现异常,跟踪发现异常信息如下:
BareMessage = "The connection name ‘OraAspNetConString’ was not found in the applications configuration or the connection string is empty."
Message = "The connection name ‘OraAspNetConString’ was not found in the applications configuration or the connection string is empty. (c:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\Config\\machine.config line 145)"

这个信息显示了一个Oracle的异常,奇怪,我的程序使用的是SQL Server数据库啊,没有Oracle的东西啊,根据提示信息找以后发现,原来我的机器上安装了Oracle ODAC 11g时,可能安装了一个Oracle11g的一个siteMap for .NET的插件,这个程序修改了我的machine.config配置文件,打开那个machine.config文件,将其中siteMap部分注释掉以后,可以用了。:)

<!–siteMap>
  <providers>
    <add name="OracleSiteMapProvider" type="Oracle.Web.SiteMap.OracleSiteMapProvider, Oracle.Web, Version=2.111.6.20, Culture=neutral, PublicKeyToken=89b483f429c47342" connectionStringName="OraAspNetConString" applicationName="" securityTrimmingEnabled="true" />
  </providers>
</siteMap–>

This entry was posted in IT技术文章. Bookmark the permalink.

Leave a comment