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:
Install-Package BarCode
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:
:path=/static-assets/barcode/content-code-examples/get-started/net-language-support/net-language-support.cs
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)
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)
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)
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 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.

