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

.NET 6.0 Compilation Error: The type or namespace name 'QRCode' does not exist in the namespace 'QRCoder' #382

Open
Illeris opened this issue Jan 30, 2022 · 14 comments

Comments

@Illeris
Copy link

Illeris commented Jan 30, 2022

Type of issue

[X] Bug
[ ] Question (e.g. about handling/usage)
[ ] Request for new feature/improvement

Expected Behavior

.NET 5.0 project with QRCoder assembly reference compiles without error.
.NET 6.0 project with QRCoder assembly reference does not compile : The type or namespace name 'QRCode' does not exist in the namespace 'QRCoder'

Current Behavior

Possible Solution (optional)

Steps to Reproduce (for bugs)

  • Include library in .NET 5.0 assembly project
  • Include QRCoder (sth like this):
    QRCoder.QRCodeGenerator qrGenerator = new QRCoder.QRCodeGenerator();
    QRCoder.QRCodeData qrCodeData = qrGenerator.CreateQrCode(payloadMessage, eccLevel);
    QRCoder.QRCode qrCode = new QRCoder.QRCode(qrCodeData);
  • Compile : will work
  • Switch target of project to .NET 6.0 : error

Compilation: VS2022

Your Environment

@danielhw2
Copy link

Same problem here...

@MarkNorman
Copy link

Also seeing this.

@WatchDogsDev
Copy link

Also here. Any solution for this ?

@joseph-passineau
Copy link

joseph-passineau commented Feb 1, 2022

Here is the explanation and some possible solutions:
#361 (comment)

@chrpai
Copy link

chrpai commented Mar 12, 2022

I'm new here but my experience was like this....

I need to create a program to generate some QR codes. Ok new console app and take default of .net 6.
Open nuget... this was has 8M downloads lets give it a try. Go to the project and find the 5 line sample and paste it in.
Hmmm that's strange this type isn't recognized.
Go to issues page and find this issue. Switch to target windows only and not it compiles.

So I'd that a notation be placed in the README.md for newcomers like myself.

@wensaint
Copy link

roll back to 1.4.1, then the error gone.

@akosilataunglahat
Copy link

roll back to 1.4.1, then the error gone.

This works for me. Thank you @wensaint .. :)

@lvlvlvlvlvlv
Copy link

QRCode qrcode = new QRCode(codeData); ?????

@PeterHric
Copy link

QRCode qrcode = new QRCode(codeData); ?????

Actually no - I had to take it back..
Apparently I solved it other way.. Dunno how :)

@simonpinn
Copy link

Same issue #435

@ruggedwizard
Copy link

rollback to version 1.4.1, this fixes the QRCode issues on Dotnet 6.0 and also 7.0

@SeniorKian
Copy link

ruggedwizard

thank you ...

@KC7465128305
Copy link

I found the problem.

Go to the project properties, in the Target OS, specify it to Windows. Rebuild the solution. Problem solved.

@jainam33
Copy link

jainam33 commented Nov 6, 2023

Just switch to Nuget package manager version 1.4.1
first uninstall latest version of QRCoder then install 1.4.1

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