Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Can not connect to Oracle DB from ASP.Net application

SPNickJan 22 2016 — edited Jan 25 2016

Hello! I need some help with it, tried many variants but no results.

Today we've deployed a new virtual server, I've made a copy of my ASP.Net app on it.

First of all I installed "Oracle_ODAC121024_x64".

Then opened my Visual Studio 2013 project and attached all DLL's from "instantclient-basic-windows.x64-12.1.0.2.0" into main folder at Solution Explorer.

referencescreen.PNG

After that I added a reference to Oracle.DataAccess from the GAC64 directory:

dllscreen.PNG

I also changed the compiler option to x86:

cpuscreen.PNG

There is not any specific changes in my web.config:

<?xml version="1.0" encoding="utf-8"?>

<configuration>

<configSections>

<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />

</configSections>

<system.web>

<compilation debug="true" targetFramework="4.5" />

<httpRuntime targetFramework="4.5" />

</system.web>

<connectionStrings>

<remove name="LocalSqlServer" />

<remove name="OracleDBServer" />

<add name="LocalSqlServer" connectionString="Data Source=SSP01T; database=Zaliffka; Integrated Security=True;" providerName="System.Data.SqlClient" />

<add name="OracleDBServer" connectionString="SERVER=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.44.444.44)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=STEEL)));uid = USR; pwd = PaSS;" />

</connectionStrings>

</configuration>

No changes in any other configuration files too.

When I trying to run debug IE shows me an error:

Server Error in '/' Application.


Could not load file or assembly 'Oracle.DataAccess, Version=2.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'Oracle.DataAccess, Version=2.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified.

Source Error:

*nothing interesting here*
Source File: c:\Users\myLogin\Documents\Visual Studio 2013\Projects\MyProject\MyProject\Default.aspx.cs Line: 317
Assembly Load Trace: The following information can be helpful to determine why the assembly 'Oracle.DataAccess, Version=2.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342' could not be loaded.

=== Pre-bind state information ===

LOG: DisplayName = Oracle.DataAccess, Version=2.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342

(Fully-specified)

LOG: Appbase = file:///C:/Users/MyLogin/Documents/Visual Studio 2013/Projects/MyProject/MyProject/

LOG: Initial PrivatePath = C:\Users\MyLogin\Documents\Visual Studio 2013\Projects\MyProject\MyProject\bin

Calling assembly : MyProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.

===

LOG: This bind starts in default load context.

LOG: Using application configuration file: C:\Users\MyLogin\Documents\Visual Studio 2013\Projects\MyProject\MyProject\web.config

LOG: Using host configuration file: C:\Users\MyLogin\Documents\IISExpress\config\aspnet.config

LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.

LOG: Post-policy reference: Oracle.DataAccess, Version=2.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342

LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/bdbb10c9/22597ba2/Oracle.DataAccess.DLL.

LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/bdbb10c9/22597ba2/Oracle.DataAccess/Oracle.DataAccess.DLL.

LOG: Attempting download of new URL file:///C:/Users/MyLogin/Documents/Visual Studio 2013/Projects/MyProject/MyProject/bin/Oracle.DataAccess.DLL.

LOG: Attempting download of new URL file:///C:/Users/MyLogin/Documents/Visual Studio 2013/Projects/MyProject/MyProject/bin/Oracle.DataAccess/Oracle.DataAccess.DLL.

LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/bdbb10c9/22597ba2/Oracle.DataAccess.EXE.

LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/bdbb10c9/22597ba2/Oracle.DataAccess/Oracle.DataAccess.EXE.

LOG: Attempting download of new URL file:///C:/Users/MyLogin/Documents/Visual Studio 2013/Projects/MyProject/MyProject/bin/Oracle.DataAccess.EXE.

LOG: Attempting download of new URL file:///C:/Users/MyLogin/Documents/Visual Studio 2013/Projects/MyProject/MyProject/bin/Oracle.DataAccess/Oracle.DataAccess.EXE.

Stack Trace:

[FileNotFoundException: Could not load file or assembly 'Oracle.DataAccess, Version=2.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified.]

MyProject.Default.Page_Load(Object sender, EventArgs e) in c:\Users\MyLogin\Documents\Visual Studio 2013\Projects\MyProject\MyProject\Default.aspx.cs:317

System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51

System.Web.UI.Control.OnLoad(EventArgs e) +92

System.Web.UI.Control.LoadRecursive() +54

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772

Can someone help me?.. Don't know what to do..

This post has been answered by Alex Keh-Oracle on Jan 22 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 22 2016
Added on Jan 22 2016
3 comments
2,895 views