Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not load type 'QRCoder.QRCode' #100

Closed
thanhnntq opened this issue Mar 30, 2022 · 4 comments
Closed

Could not load type 'QRCoder.QRCode' #100

thanhnntq opened this issue Mar 30, 2022 · 4 comments

Comments

@thanhnntq
Copy link

thanhnntq commented Mar 30, 2022

System.TypeLoadException: Could not load type 'QRCoder.QRCode' from assembly 'QRCoder, Version=1.4.3.0, Culture=neutral, PublicKeyToken=c4ed5b9ae8358a28'.
   at Google.Authenticator.TwoFactorAuthenticator.GenerateQrCodeUrl(Int32 qrPixelsPerModule, String provisionUrl)
   at Google.Authenticator.TwoFactorAuthenticator.GenerateSetupCode(String issuer, String accountTitleNoSpaces, Byte[] accountSecretKey, Int32 qrPixelsPerModule, Boolean generateQrCode)
   at Google.Authenticator.TwoFactorAuthenticator.GenerateSetupCode(String issuer, String accountTitleNoSpaces, String accountSecretKey, Boolean secretIsBase32, Int32 qrPixelsPerModule)
   at Security.Authentication.TwoFactorAuthenticatorProvider.GenerateSetupCode(String issuer, String title, String secretKey, String email)

private readonly TwoFactorAuthenticator _authenticator;

    public TwoFactorAuthenticatorProvider()
    {
        _authenticator = new TwoFactorAuthenticator();
    }
public SetupCode GenerateSetupCode(string issuer, string title, string secretKey)
    {
        var sc = _authenticator.GenerateSetupCode(issuer, title, secretKey, false, 3);
        return sc;
    }

image

@naviln
Copy link

naviln commented Mar 30, 2022

Yeah I'm having this problem with .NET 6.
Downgrading/Staying on version 2.3.0 of this library worked for me

@FighterLuo
Copy link

I have the same problem, .NET 6
please fix it, thanks

@neosonne
Copy link

me too

@flytzen
Copy link
Collaborator

flytzen commented Apr 13, 2022

Fixed in #102. Will be released in 2.5 - see #104

@flytzen flytzen closed this as completed Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants