Oracle.ManagedDataAccess.Core support for ASP.NET 5 — oracle-tech

    Forum Stats

  • 3,715,496 Users
  • 2,242,776 Discussions
  • 7,845,366 Comments

Discussions

Howdy, Stranger!

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

Oracle.ManagedDataAccess.Core support for ASP.NET 5

user5548540
user5548540 Member Posts: 2 Red Ribbon

Just created new ASP.NET Core project with .NET 5. Added NuGet package Oracle.ManagedDataAccess.Core (2.19.100). But still got BinaryFormatter exception during runtime at "connection.Open()". AddOracleTypesDeserialization at ConfigureService or direct before instantiating OracleConnection does not help here. See https://github.com/dotnet/aspnetcore/issues/27872

Answers

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 2,751 Employee

    You have the following package reference:

        <PackageReference Include="Oracle.ManagedDataAccess.Core" Version="2.19.91" />
    

    The 2.19.100 version should be used instead.

  • user5548540
    user5548540 Member Posts: 2 Red Ribbon

    I use 2.19.100, and I do not use DataTables or anything else. I got NotSupportedException: BinaryFormatter exception during connection.Open() as inner exception of "TypeInitializationException: The type initializer for 'Oracle.ManagedDataAccess.Types.TimeStamp' threw an exception." which is an inner exception of "TypeInitializationException: The type initializer for 'OracleInternal.ServiceObjects.OracleConnectionImpl' threw an exception."

    I want to say, that 2.19.100 seems not to solve all problems with BinaryFormatter. But it looks like only to appear in ASP.NET.

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 2,751 Employee

    Can you upload a simple test case? We'll try to reproduce the problem and debug.

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 2,751 Employee

    Another customer who ran into what is likely the same issue has given us a test case. Can you enable the following to disable the binary formatter until we provide a bug fix?

    <EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>

  • User_DW5ZB
    User_DW5ZB Member Posts: 1
    edited December 2020

    Hello,

    This is a blocker for us to migrate to dot net 5. Do we have any updates on the progress and somewhere we can track?

    We cant use that flag because it has some serious security implications, hence the reason Microsoft decommissioned it.

    Thanks.

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 2,751 Employee

    Oracle will publish a patched ODP.NET version on NuGet Gallery at the beginning of the new year.

Sign In or Register to comment.