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
Copy file name to clipboardExpand all lines: README.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -174,6 +174,27 @@ for (int y = 0; y < size; y++)
174
174
}
175
175
```
176
176
177
+
## ⚠️ Troubleshooting
178
+
179
+
### System.Drawing.Common Warnings (QRCode and ArtQRCode renderers)
180
+
181
+
The `QRCode` and `ArtQRCode` renderers depend on `System.Drawing.Common`, which Microsoft has [removed cross-platform support for in .NET 6+](https://learn.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/6.0/system-drawing-common-windows-only). You may encounter one of the following build or runtime errors:
182
+
183
+
```
184
+
CA1416: This call site is reachable on all platforms. 'QRCode.QRCode(QRCodeData)' is only supported on: 'windows'
185
+
186
+
System.TypeInitializationException: The type initializer for 'Gdip' threw an exception.
187
+
188
+
System.PlatformNotSupportedException: System.Drawing.Common is not supported on this platform.
189
+
```
190
+
191
+
Solutions include:
192
+
193
+
1. Use Windows-specific TFMs such as `<TargetFramework>net8.0-windows</TargetFramework>`
194
+
2. Mark methods with the `[SupportedOSPlatform("windows")]` attribute
195
+
3. Add platform guards by wrapping code with `#if WINDOWS` or `if (OperatingSystem.IsWindows())`
196
+
4. Use cross-platform renderers such as `PngByteQRCode`, `SvgQRCode`, or `BitmapByteQRCode`
197
+
177
198
## 🚀 CI Builds
178
199
179
200
The NuGet feed contains only **major/stable** releases. If you want the latest functions and features, you can use the CI builds [via Github packages](https://github.com/Shane32/qrcoder/packages).
0 commit comments