You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
.NET 6.0 Compilation Error: The type or namespace name 'QRCode' does not exist in the namespace 'QRCoder' #382
[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
Reacted by Perito Werner, Ahmed Mohamed Abdel-Razek, Jawand Singh, MarkStaffArgentex, Igor Wolbers, Aingeru, Julia Wells, Deepu Madhusoodanan, Ringgo De Jesus, expjw and 5 more
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.
This issue is existing still in 2025. I have managed to fix the issue by setting solution properties - target OS -> Windows. However this fix will only work for me for local development as I will need to deploy on Linux.
Is there a solution once I will try to build the code for Linux?
@codebude My best understanding at this point, is that if I want to be multiplatform, I should use the BitmapByteQRCode renderer class, correct? (With QRCode being only available if I specifically set target OS to Windows in VS solution properties)
Also as a unasked-for-feedback, I have run into your library via GPT research recommendation. I think there are likely going to be more users coming from this channel in the future. The information that I cant use the main renderer if I want to compile, but should use the BitmapByteQRCode is quite too deep in the docs. What would help me personally is some specific mention in third pargraph here https://github.com/codebude/QRCoder/wiki
saying something like in bold font:
If you want to use the QRCode render and are OK being Windows only, set solution - properties - target OS -> Windows
If you need to be multiplatform, dont use QRCode render, but x, y renderer.
I bet this docs change will decrease potential lib users bounces in the future.
Activity
danielhw2 commentedon Jan 30, 2022
Same problem here...
MarkNorman commentedon Jan 31, 2022
Also seeing this.
WatchDogsDev commentedon Feb 1, 2022
Also here. Any solution for this ?
joseph-passineau commentedon Feb 1, 2022
Here is the explanation and some possible solutions:
#361 (comment)
chrpai commentedon 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 commentedon Mar 18, 2022
roll back to 1.4.1, then the error gone.
akosilataunglahat commentedon Jul 21, 2022
This works for me. Thank you @wensaint .. :)
lvlvlvlvlvlv commentedon Aug 25, 2022
QRCode qrcode = new QRCode(codeData); ?????
PeterHric commentedon Aug 25, 2022
Actually no - I had to take it back..
Apparently I solved it other way.. Dunno how :)
simonpinn commentedon Dec 13, 2022
Same issue #435
ruggedwizard commentedon Jan 10, 2023
rollback to version 1.4.1, this fixes the QRCode issues on Dotnet 6.0 and also 7.0
SeniorKian commentedon Mar 23, 2023
thank you ...
KC7465128305 commentedon Jul 23, 2023
I found the problem.
Go to the project properties, in the Target OS, specify it to Windows. Rebuild the solution. Problem solved.
jainam33 commentedon Nov 6, 2023
Just switch to Nuget package manager version 1.4.1
first uninstall latest version of QRCoder then install 1.4.1
Michael-Bohin commentedon Jun 1, 2025
This issue is existing still in 2025. I have managed to fix the issue by setting solution properties - target OS -> Windows. However this fix will only work for me for local development as I will need to deploy on Linux.
Is there a solution once I will try to build the code for Linux?
I have read through the mention #512
@codebude My best understanding at this point, is that if I want to be multiplatform, I should use the BitmapByteQRCode renderer class, correct? (With QRCode being only available if I specifically set target OS to Windows in VS solution properties)
Also as a unasked-for-feedback, I have run into your library via GPT research recommendation. I think there are likely going to be more users coming from this channel in the future. The information that I cant use the main renderer if I want to compile, but should use the BitmapByteQRCode is quite too deep in the docs. What would help me personally is some specific mention in third pargraph here
https://github.com/codebude/QRCoder/wiki
saying something like in bold font:
If you want to use the QRCode render and are OK being Windows only, set solution - properties - target OS -> Windows
If you need to be multiplatform, dont use QRCode render, but x, y renderer.
I bet this docs change will decrease potential lib users bounces in the future.
Shane32 commentedon Jun 1, 2025
The link below shows which renderers are available for various TFMs.
https://github.com/codebude/QRCoder/wiki/Advanced-usage---QR-Code-renderers
Shane32 commentedon Oct 2, 2025
Tracked by: