.NET Firebird client connection error, System.BadImageFormatException

I keep catching the following exception when trying to open a Firebird SQL connection. I suspect there may be an issue with the connection string I have supplied.

System.BadImageFormatException: 'An attempt was made to load a program with an incorrect format. (0x8007000B)'

This exception was originally thrown at this call stack:
    [External Code]
    KPS_DSR_Updater.DAL.CreateConnecton(FirebirdSql.Data.FirebirdClient.FbConnectionStringBuilder) in DAL.cs

Here is the code I’ve written:

using FirebirdSql.Data.FirebirdClient;
using Microsoft.Extensions.Configuration;
using System.Data;

namespace KPS_DSR_Updater
{
    internal class DAL : IDisposable
    {
        public FbConnectionStringBuilder? _connectionStringBuilder;
        private string? _connectionString;
        private FbConnection? _connection;
        private IConfiguration _configuration;

        public DAL(IConfiguration configuration)
        {
            // Initialize configuration and check for null value.
            _configuration = configuration ??
                throw new ArgumentNullException(nameof(configuration));

            try
            {
                List<string> parsedConnectionInfo = ParseConfiguration(_configuration);

                // Build the connection string using the parsed configuration
                // file containing connection info.
                _connectionStringBuilder = new FbConnectionStringBuilder
                {
                    ClientLibrary = parsedConnectionInfo[0],
                    Database = parsedConnectionInfo[1],
                    UserID = parsedConnectionInfo[3],
                    Password = parsedConnectionInfo[2],
                    ServerType = FbServerType.Embedded
                };
            }
            catch (Exception ex)
            {
                // Error re-thrown for Event Log. Outputting to console for
                // debugging purposes only.
                Console.WriteLine($"Error occured attempting to build connection stringn" +
                    $"{ex.Message}");
                throw;
            }
        }

        public void CreateConnecton(FbConnectionStringBuilder connectionStringBuilder)
        {
            // Build connection string and open connection. Connection string must first be
            // converted to a string, from FbConnectionStringBuilder object.
            try
            {
                // Convert to string
                _connectionString = connectionStringBuilder.ToString();
                _connection = new FbConnection(_connectionString);
                _connection.Open();
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Error occured attempting to make connection to database.n" +
                    $"{ex.Message}");
                throw;
            }
        }

        private List<string> ParseConfiguration(IConfiguration configuration)
        {
            // Grab configuration settings from appsettings.json, if not null.
            List<string> configurationInfo = configuration.GetSection("connection_info").Get<List<string>>() 
                ?? throw new NoNullAllowedException();

            return configurationInfo;
        }

        public void Dispose()
        {
            // If necessary, close connection at program end of lifetime.
            if (_connection != null) _connection.Close();
        }
    }
}

And here is how I’m calling it:

using FirebirdSql.Data.FirebirdClient;
using KPS_DSR_Updater;
using Microsoft.Extensions.Configuration;


// Build config from configuration file.
var configurationBuilder = new ConfigurationBuilder().AddJsonFile("appsettings.json", optional: false, reloadOnChange: true);
var configuration = configurationBuilder.Build();

// Create a new DAL object and apply connection_settings from configuration.
DAL DataAccessLayer = new DAL(configuration);

// Open connection to database.
FbConnectionStringBuilder connectionStringBuilder = DataAccessLayer._connectionStringBuilder!;
DataAccessLayer.CreateConnecton(connectionStringBuilder);

I have tried to hard code the connection string and make the same call, but it is still producing the same error. Interestingly, I’m referring to some work another developer has done that currently works and is in production, and I have followed the same conventions, so I’m not sure why this won’t work in the same way.

For reference, here is the connection string with confidential information removed:

client library=fbclient.dll;initial catalog=DATA.FDB;user id=example;password=example;server type=Embedded

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật