Could not load file or assembly 'System.DirectoryServices.Protocols, Version=4.0.0.0, Culture=neutra — oracle-tech

    Forum Stats

  • 3,715,657 Users
  • 2,242,821 Discussions
  • 7,845,481 Comments

Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Could not load file or assembly 'System.DirectoryServices.Protocols, Version=4.0.0.0, Culture=neutra

4225766
4225766 Member Posts: 6
edited April 2020 in ODP.NET

Good afternoon,

Environment: ms VS 2019, Microsoft.EntityFrameworkCore (2.1.0), Oracle.ManagedDataAccess.Core (2.19.60 Oracle.Entity.FrameworkCore.dll installed Trying to scaffold from Oracle 12c

From Package Manager Console:

Scaffold-DbContext "User Id=userid;Password=password;Data Source=oradb:1521/ORCL;” Oracle.EntityFrameworkCore -OutputDir Models

response:

2020-04-06 14:16:05.185000 ThreadID:1   (ERROR)   OracleDatabaseModelFactory.Create() :  System.IO.FileNotFoundException: Could not load file or assembly 'System.DirectoryServices.Protocols, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

File name: 'System.DirectoryServices.Protocols, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

   at OracleInternal.ConnectionPool.PoolManager`3.CreateNewPR(Int32 reqCount, Boolean bForPoolPopulation, ConnectionString csWithDiffOrNewPwd, OracleConnection connRefForCriteria, String instanceName, List`1 switchFailedInstNames)

   at OracleInternal.ConnectionPool.PoolManager`3.Get(ConnectionString csWithDiffOrNewPwd, Boolean bGetForApp, OracleConnection connRefForCriteria, String affinityInstanceName, Boolean bForceMatch)

   at OracleInternal.ConnectionPool.OraclePoolManager.Get(ConnectionString csWithNewPassword, Boolean bGetForApp, OracleConnection connRefForCriteria, String affinityInstanceName, Boolean bForceMatch)

   at OracleInternal.ConnectionPool.OracleConnectionDispenser`3.Get(ConnectionString cs, PM conPM, ConnectionString pmCS, SecureString securedPassword, SecureString securedProxyPassword, OracleConnection connRefForCriteria)

   at Oracle.ManagedDataAccess.Client.OracleConnection.Open()

   at Oracle.EntityFrameworkCore.Scaffolding.Internal.OracleDatabaseModelFactory.Create(DbConnection connection, IEnumerable`1 tables, IEnumerable`1 schemas)

I found the file in:

C:\Windows\assembly\GAC_MSIL\System.DirectoryServices.Protocols\2.0.0.0__b03f5f7f11d50a3a\System.DirectoryServices.Protocolls.dll

Any idea how I could resolved this issue?

Michel

pcpaasche

Best Answer

  • 4225766
    4225766 Member Posts: 6
    edited April 2020 Accepted Answer

    I have resolved my issue by going to Nuget and installing System.DirectoryServices.Protocols v4.7.0 in Visual Studio 2019. Note that System.DirectoryServices.Protocols v2.2 was installed on my machine and that was the issue.

    pcpaasche

Answers

Sign In or Register to comment.