Не выходит зацепить базу огненнной птицы. или баян про mscorlib 4.0.0.0 - C#

Узнай цену своей работы

Формулировка задачи:

Have a nice day ALL) Суть проблемы такова: Есть разработчик ПО (softsintez) и их ПП: "Электронный заказ 6.0" Оно работает с базой данных

fdb

через либу

fbclient.dll

(v. 2.1.1.17910) и уж очень хочется открыть эту базу в шарпе. Как я все запорол: 1. Скачал тут последний нэт-провайдер 2. Проект > Добавить ссылку > Обзор > FirebirdSql.Data.FirebirdClient.dll (Добавилось) 3. Задействовал его в "using" Компиляция проходит, а при запуске получаю ош:
Не удалось загрузить тип \"System.Runtime.CompilerServices.ExtensionAttribute\" из сборки \"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=
Собсно Вопрос: Какой версии драйвер скачать и под какой фреймворк собирать чтобы

mscorlib

успокоилась? Код проекта консольного приложения:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO; // чтоб пути до файлов проверять
//-----------------------------------------------------------------------------
using FirebirdSql.Data.FirebirdClient; // задействуем возможности агонь-птицы
using FirebirdSql.Data.Isql;
//-----------------------------------------------------------------------------
 
namespace fb_test
{
    class Program
    {
        static void Main(string[] args)
        {
            //Some constant parameters used to form up the connection string... 
            #region constant literals 
            const String User = "eorder";
            const String Password = "eorder";
            const String DBPath = "c:\\1\\eOrderClient.fdb";
            const String DLLPath = @"c:\\1\\fbclient.dll";
            const String Charset = "WIN1251";
            const int Dialect = 3;
            #endregion
 
            //I check whether we actually have a database file nearby
            //and fbembed.dll. If we don't - we leave
            if (File.Exists(DBPath) == true && File.Exists(DLLPath) == true) // чтоб все было (база и библиотека)
            {
                //I form up a connection string out of literals I've declared above
                FbConnectionStringBuilder CStr = new FbConnectionStringBuilder();
 
                CStr.ServerType = FbServerType.Embedded;
                CStr.UserID = User;
                CStr.Password = Password;
                CStr.Dialect = Dialect;
                CStr.Database = DBPath;
                CStr.Charset = Charset;
                CStr.ClientLibrary = DLLPath;
 
                //And then I finally try to connect
                FbConnection Conn = new FbConnection(CStr.ToString());
 
                try
                {
                    //See what we've got in the end
                    Console.WriteLine(CStr.ToString());
                    //And try to connect
                    Conn.Open();
                }
                catch (Exception Ex)
                {
                    //Show me what has gone wrong
                    Console.WriteLine("\n" + Ex.Message.ToString());
                    Console.ReadKey();
                }
                finally
                {
                    Conn.Close();
                }
            }
        }
    }
}

Решение задачи: «Не выходит зацепить базу огненнной птицы. или баян про mscorlib 4.0.0.0»

textual
Листинг программы
   в FirebirdSql.Data.Common.IscHelper.VaxInteger(Byte[] buffer, Int32 index, Int32 length)
   в FirebirdSql.Data.Common.IscHelper.ParseDatabaseInfo(Byte[] buffer)
   в FirebirdSql.Data.Client.Native.FesDatabase.GetDatabaseInfo(Byte[] items, Int32 bufferLength)
   в FirebirdSql.Data.Client.Native.FesDatabase.GetServerVersion()
   в FirebirdSql.Data.Client.Native.FesDatabase.Attach(DatabaseParameterBuffer dpb, String dataSource, Int32 port, String database)
   в FirebirdSql.Data.FirebirdClient.FbConnectionInternal.Connect()
   в FirebirdSql.Data.FirebirdClient.FbConnectionPool.Create()
   в FirebirdSql.Data.FirebirdClient.FbConnectionPool.CheckOut()
   в FirebirdSql.Data.FirebirdClient.FbConnection.Open()
   в ConsoleApplication1.Program.Main(String[] args) в C:\2\ConsoleApplication1\ConsoleApplication1\Program.cs:строка 27
   в System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   в System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   в Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   в System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   в System.Threading.ThreadHelper.ThreadStart()

ИИ поможет Вам:


  • решить любую задачу по программированию
  • объяснить код
  • расставить комментарии в коде
  • и т.д
Попробуйте бесплатно

Оцени полезность:

7   голосов , оценка 3.571 из 5
Похожие ответы