Another ASP Membership Issue

I am using ASP.NET Membership API and I have encountered the following problem on my staging server. The application works fine on my local machine. Data tables are stored on SQL Server. Both my local and intermediate server point to the same database 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 he is even trying to do something with Oracle, my web.config does not contain anything related to Oracle.

Does anyone have an idea why this is happening?

[edit] On my local machine.config machine, I do not have the OracleRoleProvider key. But my server is intermediate settings. If it helps.

+4
source share
4 answers

The old question is here, but I just ran into it and wanted to share more detailed information.

First, the easiest solution if you need to make <clear/> in your connectionStrings block is to add an empty entry to the OraAspNetConString connection string back to your web.config:

 <connectionStrings> <clear /> <add name="OraAspNetConString" connectionString=" "/> </connectionStrings> 

What happens when you install the Oracle.NET package on any of your computers, it installs a ton of different providers in your machine.config along with OraAspNetConString as the machine level of connectionString. The <clear/> element gets rid of this OraAspNetConString, and thanks to the addition of Oracle machine.config, all other Oracle providers loaded by default fail when they cannot find the connectionString.

The other answer here, where you studied the use of the element for membership providers, did not work, because most of the other oracle providers added to machine.config will still look for this OraAspNetConString , so cleaning up only that one provider will not help you.

These are all the providers they installed in my machine.config:

 <membership><providers> <add name="OracleMembershipProvider" type="Oracle.Web.Security.OracleMembershipProvider, Oracle.Web, Version=4.112.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" connectionStringName="OraAspNetConString" applicationName="" /> </providers></membership> <profile><providers> <add name="OracleProfileProvider" type="Oracle.Web.Profile.OracleProfileProvider, Oracle.Web, Version=4.112.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" connectionStringName="OraAspNetConString" applicationName=""/> </providers></profile> <roleManager><providers> <add name="OracleRoleProvider" type="Oracle.Web.Security.OracleRoleProvider, Oracle.Web, Version=4.112.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" connectionStringName="OraAspNetConString" applicationName=""/> </providers></roleManager> <siteMap><providers> <add name="OracleSiteMapProvider" type="Oracle.Web.SiteMap.OracleSiteMapProvider, Oracle.Web, Version=4.112.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" connectionStringName="OraAspNetConString" applicationName="" securityTrimmingEnabled="true"/> </providers></siteMap> <webParts> <personalization> <providers> <add name="OraclePersonalizationProvider" type="Oracle.Web.Personalization.OraclePersonalizationProvider, Oracle.Web, Version=4.112.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" connectionStringName="OraAspNetConString" applicationName=""/> </providers> </personalization> </webParts> <healthMonitoring><providers> <add name="OracleWebEventProvider" type="Oracle.Web.Management.OracleWebEventProvider, Oracle.Web, Version=4.112.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" connectionStringName="OraAspNetConString" buffer="true" bufferMode="OracleNotification"/> </providers></healthMonitoring> 

So, if you do not want to add an empty OraAspNetConString, you need to make sure that you either <clear/> for each of the following Oracle providers, or go in and add the <remove name=x /> element to each provider class, for example this:

 <membership><providers> <remove name="OracleMembershipProvider" /> </providers></membership> <profile><providers> <remove name="OracleProfileProvider" /> </providers></profile> <roleManager><providers> <remove name="OracleRoleProvider" /> </providers></roleManager> <siteMap><providers> <remove name="OracleSiteMapProvider" /> </providers></siteMap> <healthMonitoring><providers> <remove name="OracleWebEventProvider" /> </providers></healthMonitoring> 

I never looked at any site code or health monitoring code in my web application, but I still had to manually add these <remove/> elements for different providers in my web file or something failed looking for the OraAspNetConString connection string. which was not there not.

+5
source

You need to define your provider in your configuration file, for example, there is a membership provider here:

  <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 providers defined at the system level. That's why we clean, then you identify your new suppliers. If you need providers at the system level, you can define your own by default, or in the application code specifically request your provider.

+4
source

This error says that you have this in the machine.conf file, not web.config.

0
source

Just add an empty ConnectionString for the "OraAspNetConString" that worked for me

 <connectionStrings> <clear /> <add name="OraAspNetConString" connectionString=" "/> .................. your other connectionstrings goes here ..... </connectionStrings> 
0
source

All Articles