views:

567

answers:

2

I am using the Membership API in ASP .NET and I have encountered the following problem on my staging server. The application works fine on my local machine. The data tables are stored on a SQL Server. Both my local and staging server point to the same DB server. When I deploy to my staging server I get the following error:

 Parser Error Message: The connection name 'OraAspNetConString' was not 
 found in the applications configuration or the connection string is empty. 

    Line 135:    <roleManager>
    Line 136:      <providers>
    Line 137:        <add name="OracleRoleProvider" 

type="Oracle.Web.Security.OracleRoleProvider, Oracle.Web, Version=2.111.6.20,
Culture=neutral, PublicKeyToken=89b483f429c47342" 
connectionStringName="OraAspNetConString" applicationName="" />
    Line 138:        <add name="AspNetSqlRoleProvider"   
connectionStringName="LocalSqlServer" applicationName="/" 
type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, 
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    Line 139:        <add name="AspNetWindowsTokenRoleProvider" 
applicationName="/" type="System.Web.Security.WindowsTokenRoleProvider, 
System.Web, Version=2.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a" />


Source File: 
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config
    Line: 137

I do not know why it is even trying to do anything with Oracle, my web.config does not contain anything associated with Oracle.

Does anyone have any insight into why this is happening?

[Edit] On my local machine's machine.config I do not have the OracleRoleProvider key. But my staging server does. If that helps.

A: 

This error is saying you have that in the machine.conf not web.config.

metanaito
Yes, but it's out of my control... is there a work around?
DavidS
The easiest solution would be to find out why that oracle connection string is in the machine.config. If you are not able to remove it then you'll need to override it. Are you sure you have the <clear/> in your web.config which Josh mentioned? I thought that should clear the providers.
metanaito
+2  A: 

You need to define your own provider in your config file for example here is a membership provider:

 <membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="15">
  <providers>
   <clear/>
   <add name="SqlProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="MyConnection" applicationName="MyApp"/>
  </providers>
 </membership>

Basically this will remove all the providers defined at the system level, This is why we are clearing, then you define your new providers. If you need the providers at the system level you can define your own as the default, or in your app code specifically request your provider.

JoshBerke
I already have that there.
DavidS
Well just add a dummy connection string called OraAspNetConString. If your sure you've removed it it shouldn't run. But this might let you continue on your way. Also make sure you did that for the RoleProvier as well as Membership
JoshBerke