0

I started in the development of a RESTful web service with asp.net core.

I use a home framework for oracle database access, this home framework is used in all my projects but this one uses the Oracle.ManagedDataAccess dll.

When I want to use a method from a framework .dll to get some data from my database I get the error: System.TypeLoadException: 'Could not load type' System.Security.Principal.WindowsImpersonationContext 'from assembly mscorlib, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089 '.'

Is there a solution ?

I am new to asp.net CORE, if I do the same thing with an ASP.NET Web API service, it works.

I tried with the NuGets to install Oracle.managedDataAccess but I have the same problem

I also tried with Oracle.ManagedDataAccess.Core ==> System.IO.FileLoadException: Could not load file or assembly 'Oracle.ManagedDataAccess

I find it a shame that I can not use my .dll files Do you have a solution to offer me?

Thanks in advance

 string _connStr = "Data Source = " + Connector.tnsName + "; User ID = " + Connector.user + "; Password = " + Connector.password + "; Min Pool Size=10;Connection Lifetime=120;Connection Timeout=60;Incr Pool Size=5; Decr Pool Size=2";
        mConn = new OracleConnection(_connStr);
        if (OpenConnection)
        {
            try
            {
                mConn.Open(); ==>Could not load type' System.Security.Principal.WindowsImpersonationContext

1 Answer 1

0

You can try Oracle.ManagedDataAccess.Core only , if you install both , you may meet the errors .

Reference : Connect to Oracle database in dotnet mvc application

Here is the code sample : Getting Started with ODP.NET Core

Sign up to request clarification or add additional context in comments.

1 Comment

If I use Oracle.ManagedDataAccess.Core I have the following error message in my .dll: ex = {System.IO.FileLoadException: Could not load file or assembly 'Oracle.ManagedDataAccess, Version = 4.121.1.0, Culture = neutral, PublicKeyToken = 89b483f429c47342'. The location of the meeting is not the same. (Exception from ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.