Connection Error to Oracle 10G Although it is working from within visual studio

Jeddah 86 Reputation points
2021-11-13T12:31:10.317+00:00

Hello

I am using Visual Studio 2019, Asp.net core 3.1 , MVC on windows 2019 server

I already deployed Oracle Instant Client and add the environmental variable

I need to connect to Oracle 10g DB so I am using Oracle.ManagedDataAccess.Core library that I got it from Nuget.

When I run the application from within Visual Studio, it works fine and I am able to open connection without error

However, when I deployed it to IIS , the connection is not opening and giving me error says

"TNS:could not resolve the connect identifier specified"

Any help is appreciated.

Internet Information Services
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,774 questions
0 comments No comments
{count} votes

Accepted answer
  1. Sam Wu-MSFT 7,536 Reputation points Microsoft Vendor
    2021-11-14T01:50:34.803+00:00

    @Jeddah

    When you are running application in Visual Studio you are in the security of the logged in user(you), but when you are running in IIS you are in the security context of the identity of the application pool, default is Network Service, so you need make sure Network Service has access to your TNS directories or change your App Pool to run as you.

    About how to grant user permissions you can refer to this link: iis7-permissions-overview-applicationpoolidentity.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.