Skip to content

[Blazor webassembly] "The type initializer for 'Crypto' threw an exception" after upgrading to .net 5 preview 7 #39893

Closed

Description

@julienGrd

Hello guys, i see a similar issue when preview7 was released but im unable to find it, so i prefer open a new issue because its a blocking problem for me to upgrade.

The complete Exception

 Unhandled exception rendering component: The type initializer for 'Crypto' threw an exception.
System.TypeInitializationException: The type initializer for 'Crypto' threw an exception.
 ---> System.DllNotFoundException: libSystem.Security.Cryptography.Native.OpenSsl assembly:<unknown assembly> type:<unknown type> member:(null)
   at Interop.Crypto..cctor()
   --- End of inner exception stack trace ---
   at Internal.Cryptography.HashProviderDispenser.CreateHashProvider(String hashAlgorithmId)
   at System.Security.Cryptography.SHA256Managed..ctor()

How to reproduce :

  • create a new blazor webassembly app .net 5 preview 7
  • put this line of code
    var lHasher = new System.Security.Cryptography.SHA256Managed();

Thanks !

Activity

  1. transferred this issue fromdotnet/aspnetcoreon Jul 24, 2020
  2. added
    untriaged
    on Jul 24, 2020
  3. javiercn commented on Jul 24, 2020

    @javiercn
    Member

    @julienGrd thanks for reporting this issue.

    This problem doesn't seem to be Blazor specific and more of an issue on the runtime on webassembly. We've moved it to the runtime repository since they'll be able to give you a faster and better answer.

  4. campersau commented on Jul 24, 2020

    @campersau
    Contributor

    Looks similar to #39756

  5. bartonjs commented on Jul 24, 2020

    @bartonjs
    Member

    Yep, duplicate of #39756

  6. ghost locked as resolved and limited conversation to collaborators on Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Securityuntriaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions