Using IronBarcode With C#, VB.NET & F#
IronBarcode is built on .NET Standard 2.0, so it works natively with C#, VB.NET, and F# without additional configuration. The API surface is consistent across all three languages. Every method, class, and property available in C# is also accessible in VB.NET and F# projects.
Installation
Install IronBarcode from NuGet:
The same BarCode package works for all three languages. No language-specific packages are required.
C# Example
C# is the most widely used language with IronBarcode. This example generates a QR code and saves it as a PNG:
using IronBarCode;
// Generate a QR code and save it as an image
var qrCode = QRCodeWriter.CreateQrCode("https://ironsoftware.com", 250);
qrCode.SaveAsPng("qr-code.png");
// Read the barcode back from the saved image
var result = BarcodeReader.Read("qr-code.png");
Console.WriteLine(result.First().Value);Imports IronBarCode
' Generate a QR code and save it as an image
Dim qrCode = QRCodeWriter.CreateQrCode("https://ironsoftware.com", 250)
qrCode.SaveAsPng("qr-code.png")
' Read the barcode back from the saved image
Dim result = BarcodeReader.Read("qr-code.png")
Console.WriteLine(result.First().Value)Output


QRCodeWriter.CreateQrCode produces a 250×250 QR code that BarcodeReader.Read decodes back to https://ironsoftware.com.
VB.NET Example
VB.NET uses the same IronBarcode methods as C#. Only the syntax changes:
Imports IronBarCode
' Generate a QR code and save it as an image
Dim qrCode = QRCodeWriter.CreateQrCode("https://ironsoftware.com", 250)
qrCode.SaveAsPng("qr-code.png")
' Read the barcode back from the saved image
Dim result = BarcodeReader.Read("qr-code.png")
Console.WriteLine(result.First().Value)
The output is identical to the C# example above.
VB.NET is supported across both .NET Framework and .NET Core projects. For a detailed walkthrough, see the VB.NET barcode generation tutorial.
F# Example
F# developers can reference IronBarcode directly. The library works in standard F# projects and in F# Interactive using the #r directive:
open IronBarCode
// Generate a QR code and save it as an image
let qrCode = QRCodeWriter.CreateQrCode("https://ironsoftware.com", 250)
qrCode.SaveAsPng("qr-code.png")
// Read the barcode back from the saved image
let result = BarcodeReader.Read("qr-code.png")
printfn "%s" (result.First().Value)
The output is identical to the C# example above.
Supported .NET Versions
IronBarcode supports a wide range of .NET runtimes across all three languages:
- .NET 10, 9, 8, 7, 6, 5
- .NET Core 3.x, 2.x
- .NET Framework 4.6.2+
- .NET Standard 2.0
For platform-specific NuGet packages (Windows, Linux, macOS, iOS, Android), refer to the advanced installation guide.
Frequently Asked Questions
Is IronBarcode compatible with all .NET languages?
Yes, IronBarcode is fully compatible with C#, VB.NET, and F#. It provides a consistent API across these .NET languages without the need for additional configuration.
How do I install IronBarcode for use in a .NET project?
You can install IronBarcode via NuGet using the command: `Install-Package BarCode`. This package works across C#, VB.NET, and F#, so there are no language-specific packages needed.
Can IronBarcode generate and read QR codes using F#?
Absolutely, IronBarcode can generate and read QR codes in F#. You can use the `QRCodeWriter.CreateQrCode` and `BarcodeReader.Read` methods to perform these operations, similar to C# and VB.NET.
What .NET versions does IronBarcode support?
IronBarcode supports a wide range of .NET versions, including .NET 10 down to 5, .NET Core 3.x and 2.x, .NET Framework 4.6.2 and later, and .NET Standard 2.0.
Is there any difference in using IronBarcode between C# and VB.NET?
No, there is no difference in functionality when using IronBarcode between C# and VB.NET. The methods, classes, and properties are the same; only the syntax differs.
How do I save a generated QR code as an image in C# using IronBarcode?
In C#, you can save a generated QR code as an image by calling `qrCode.SaveAsPng("qr-code.png")` on the created QRCode object from the `QRCodeWriter.CreateQrCode` method.
Can IronBarcode be used with .NET Core projects?
Yes, IronBarcode can be used with .NET Core projects, supporting versions from .NET Core 2.x through .NET Core 3.x and beyond.
Is VB.NET supported for both .NET Framework and .NET Core with IronBarcode?
Yes, IronBarcode supports VB.NET for projects based on both .NET Framework and .NET Core.
What is the advantage of using IronBarcode across different .NET languages?
The advantage of using IronBarcode across different .NET languages is its consistent API, which allows developers to efficiently implement barcode functionality without having to learn different methods or classes for each language.
How do I confirm a QR code is read correctly using IronBarcode?
To confirm a QR code is read correctly using IronBarcode, you can use the `BarcodeReader.Read` method to decode the QR code and then compare the result against the expected value.

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.