Issue Details (XML | Word | Printable)

Key: DNET-849
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Blocker Blocker
Assignee: Jiri Cincura
Reporter: jack128
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
.NET Data provider

WIN1251 is invalid character on .Net Core projects

Created: 08/Sep/18 09:16 AM   Updated: 09/Sep/18 06:49 PM
Component/s: ADO.NET Provider
Affects Version/s: 6.3.0.0
Fix Version/s: None


 Description  « Hide
Project:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFrameworks>netcoreapp2.1;net461</TargetFrameworks>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="FirebirdSql.Data.FirebirdClient" Version="6.3.0" />
  </ItemGroup>

</Project>

Code:

class Program
    {
        static void Main(string[] args)
        {
            Test();
            Console.ReadKey();
        }

        static void Test()
        {
            var connectionString = new FbConnectionStringBuilder
            {
                Charset = "WIN1251",
                Database = "localhost:D:\\DataBases\\CM\\New2\\CMBASE (2).FDB",
                UserID = "SYSDBA",
                Password = "masterkey"
            };
            
            var connection = new FbConnection(connectionString.ToString());
            try
            {
                connection.Open();
                Console.WriteLine("Connection is successful");
            }
            catch (Exception e)
            {
                Console.Write("ERROR: ");
                Console.WriteLine(e);
            }
            finally
            {
                connection.Close();
            }
        }
    }

build project, run \bin\Debug\net461\MultiTargetConsoleApp.exe, output: "Connection is successful" as expected
but when you run core version dotnet .\bin\Debug\netcoreapp2.1\MultiTargetConsoleApp.dll output: ERROR: FirebirdSql.Data.FirebirdClient.FbException (0x80004005): Invalid character set specified

If I set charset to NONE, error is disappear.


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order

jack128 added a comment - 08/Sep/18 01:34 PM
actually, i think app should call Encoding.RegisterProvider, so issue can be close