I see many hits to my post related to Entity Framework and Oracle related articles. I thought I will share some information which I figured out after fighting for sometime.
Depending on how you manage your TNS names, your connection string in web.config and app.config may not work sometime. The best way to mitigate that risk to have your connection string as follows. I am assuming that you have downloaded the EF provider from Oracle’s web site and installed it.
<add name=”MyEntities” connectionString=”metadata=res://*/OracleModel.csdl|res://*/OracleModel.ssdl|res://*/OracleModel.msl;provider=Oracle.DataAccess.Client;provider connection string="DATA SOURCE= (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = MY-SERVERNAME-OR-IP)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = PRODUCTION) ) );PASSWORD=MySecret*1;PERSIST SECURITY INFO=True;USER ID=JAMES.BOND"” providerName=”System.Data.EntityClient” />
Oracle provider assemblies are added to GAC. So, it is important to install this on every machine from where you want to access Oracle database using Entity Framework.