2
I have a dll
which is responsible for carrying out the consultations in the bank. Therein dll
, in the connection class, I have a method that opens the connection to the bank and returns the connection to me, as shown below:
private OracleConnection _IniciarConexao()
{
///Limpa as variáveis de erro
this.UltimaExcecao = null;
this.Erros = new List<Exception>();
OracleConnection conexao = null;
try
{
conexao = new OracleConnection("Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=***)(PORT=***)))(CONNECT_DATA=(SERVICE_NAME=****)(SERVER = DEDICATED))); User Id=***; Password=***;");
conexao.Open();
}
catch (Exception ex)
{
this.UltimaExcecao = ex;
this.Erros.Add(ex);
}
return conexao;
}
To dll
used for Oracle references is the System.Data.OracleClient.dll Versão 2.0.50727
.
That one dll
is consumed by a web application using MVC 4
with C#
and the .Net Framework 4.0
.
When I use that dll
on a project Windows Forms
I can connect to the database without problems, but when I use in a system MVC
or WebForms
an error occurs in connection with the database.
The error that occurs is the ORA-06413
. The image below can illustrate what happened:
I’m already on the second day of unsuccessful research on how to solve this problem.
When publishing the system to the production server it can connect normally, but in the local, to use debug mode, I cannot connect to the database.
Does anyone know how to fix this error, or any source that can tell me to fix this problem?
In the Oracle database server have the logs, check if this connection is coming, or check if it is going through the firewall !!! You also have View Details in Exception check the most detailed error data !!!
– Cezar
You are using this package? Or else, this other?
– Leonel Sanches da Silva
Are you using full OSI or Express? Your error may be being caused by having an Oracle 32bit client and running a 64bit application, or vice versa. Try switching between 32 and 64bit in your application (directly in the pool if it’s IIS or Visual Studio).
– Marcus Vinicius
@Cezar will check the logos of the bank and the issue of firewall. The details of the exception have nothing, I have looked several times.
– Richard Dias
@Ciganomorrisonmendez am not using any Nuget package, only the own dll that is used in the company’s projects.
– Richard Dias
So that’s it. I’ll answer.
– Leonel Sanches da Silva
@Marcusvinicius I’m using IIS Express, which comes with VS 2013 Express For Web. I’m going to check out this question you mentioned
– Richard Dias
The option to use the 64bit version of IIS Express is on
TOOLS > Options > Projects And Solutions > Web Projects > [x] Use the 64 bit version of IIS Express for web sites and projects
– Marcus Vinicius
@Marcusvinicius your solution worked. If you want to post an answer I accept it.
– Richard Dias
@Richarddias published the answer with an explanation of how to configure 32/64bit in Web apps . Net (http://answall.com/a/92072/23593)
– Marcus Vinicius