Using IronBarcode With C#, VB.NET & F#

IronBarcode is built on .NET Standard 2.0, which means it works natively across C#, VB.NET, and F# without any additional configuration. The API surface is identical regardless of language — every method, class, and property available in C# is equally accessible in VB.NET and F# projects.

Installation

Install IronBarcode from NuGet using the package manager for your language environment:

Install-Package BarCode

The same BarCode package works for all three languages. No language-specific packages are required.

C# Example

C# is the most common language used with IronBarcode. The following example generates a QR code and saves it as an image:

using IronBarCode;

// Generate a QR code and save it
var qrCode = QRCodeWriter.CreateQrCode("https://ironsoftware.com", 250);
qrCode.SaveAsPng("qr-code.png");

// Read a barcode from an image
var result = BarcodeReader.Read("qr-code.png");
Console.WriteLine(result.First().Value);
using IronBarCode;

// Generate a QR code and save it
var qrCode = QRCodeWriter.CreateQrCode("https://ironsoftware.com", 250);
qrCode.SaveAsPng("qr-code.png");

// Read a barcode from an image
var result = BarcodeReader.Read("qr-code.png");
Console.WriteLine(result.First().Value);
Imports IronBarCode

' Generate a QR code and save it
Dim qrCode = QRCodeWriter.CreateQrCode("https://ironsoftware.com", 250)
qrCode.SaveAsPng("qr-code.png")

' Read a barcode from an image
Dim result = BarcodeReader.Read("qr-code.png")
Console.WriteLine(result.First().Value)
$vbLabelText   $csharpLabel

VB.NET Example

VB.NET developers can use IronBarcode with the same methods. The syntax differs, but the functionality is identical:

Imports IronBarCode

' Generate a QR code and save it
Dim qrCode = QRCodeWriter.CreateQrCode("https://ironsoftware.com", 250)
qrCode.SaveAsPng("qr-code.png")

' Read a barcode from an image
Dim result = BarcodeReader.Read("qr-code.png")
Console.WriteLine(result.First().Value)

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
let qrCode = QRCodeWriter.CreateQrCode("https://ironsoftware.com", 250)
qrCode.SaveAsPng("qr-code.png")

// Read a barcode from an image
let result = BarcodeReader.Read("qr-code.png")
printfn "%s" (result.First().Value)
open IronBarCode

// Generate a QR code and save it
let qrCode = QRCodeWriter.CreateQrCode("https://ironsoftware.com", 250)
qrCode.SaveAsPng("qr-code.png")

// Read a barcode from an image
let result = BarcodeReader.Read("qr-code.png")
printfn "%s" (result.First().Value)
F#

Supported .NET Versions

IronBarcode supports a wide range of .NET runtimes across all three languages:

  • .NET 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

What languages are supported by IronBarcode?

IronBarcode supports C#, VB.NET, and F# with an identical API, making it versatile across different .NET languages.

How do I install IronBarcode?

You can install IronBarcode from NuGet using the package manager for your respective language environment with the command `Install-Package BarCode`.

Can I use IronBarcode with .NET Core and .NET Framework?

Yes, IronBarcode is compatible with both .NET Core and .NET Framework, supporting .NET Core 3.x, 2.x, and .NET Framework 4.6.2+.

Is there a difference in using IronBarcode between C#, VB.NET, and F#?

The API surface is identical across C#, VB.NET, and F#, so the functionality remains the same, with only syntax differences.

How can I generate a QR code using C# with IronBarcode?

In C#, you can generate a QR code using IronBarcode by calling `QRCodeWriter.CreateQrCode("https://ironsoftware.com", 250)` and saving it with `qrCode.SaveAsPng("qr-code.png")`.

Is IronBarcode compatible with F# Interactive?

Yes, IronBarcode can be used in F# Interactive by referencing it directly with the `#r` directive.

What .NET versions does IronBarcode support?

IronBarcode supports a wide range of .NET versions including .NET 9, 8, 7, 6, 5, .NET Core 3.x, 2.x, and .NET Framework 4.6.2+.

Do I need language-specific packages to use IronBarcode?

No, the same `BarCode` package from NuGet works for C#, VB.NET, and F# without the need for language-specific packages.

How do I read a barcode from an image using VB.NET?

Using VB.NET, you can read a barcode from an image with IronBarcode by calling `BarcodeReader.Read("qr-code.png")` and accessing the result.

Are there platform-specific installation guides for IronBarcode?

Yes, for platform-specific NuGet packages (Windows, Linux, macOS, iOS, Android), you can refer to the advanced installation guide.

Curtis Chau
Technical Writer

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.

...

Read More
Ready to Get Started?
Nuget Downloads 2,094,439 | Version: 2026.3 just released
Still Scrolling Icon

Still Scrolling?

Want proof fast? PM > Install-Package BarCode
run a sample watch your string become a barcode.