codebude / QRCoder

A pure C# Open Source QR Code implementation
MIT License
4.44k stars 1.08k forks source link

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

Open Illeris opened 2 years ago

Illeris commented 2 years ago

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)

Compilation: VS2022

Your Environment

danielhw2 commented 2 years ago

Same problem here...

MarkNorman commented 2 years ago

Also seeing this.

WatchDogsDev commented 2 years ago

Also here. Any solution for this ?

joseph-passineau commented 2 years ago

Here is the explanation and some possible solutions: https://github.com/codebude/QRCoder/issues/361#issuecomment-992152570

chrpai commented 2 years ago

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 commented 2 years ago

roll back to 1.4.1, then the error gone.

akosilataunglahat commented 1 year ago

roll back to 1.4.1, then the error gone.

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

lvlvlvlvlvlv commented 1 year ago

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

PeterHric commented 1 year ago

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

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

simonpinn commented 1 year ago

Same issue #435

ruggedwizard commented 1 year ago

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

SeniorKian commented 1 year ago

ruggedwizard

thank you ...

KC7465128305 commented 11 months ago

I found the problem.

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

jainam33 commented 8 months ago

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