System.NotSupportedException: Specified method is not supported.
at System.Data.Common.DbConnection.EnlistTransaction(Transaction transaction)
I'm using Devart.Data.PostgreSql 7.9.958 (trial).
As I can see PgSqlConnection.EnlistTransaction has no implementation any more, so the base method is used and it throws NotSupportedException
Why? It works before (in Express edition).
PgSqlConnection.EnlistTransaction throws NotSupportedException
-
- Posts: 19
- Joined: Mon 14 Mar 2016 17:11
Re: PgSqlConnection.EnlistTransaction throws NotSupportedException
Please specify:
1) are you using the Devart.* assemblies provided with installation (.NET Framework) or downloaded via NuGet (.NET Core)?
2) is your project type .NET Framework or .NET Core?
1) are you using the Devart.* assemblies provided with installation (.NET Framework) or downloaded via NuGet (.NET Core)?
2) is your project type .NET Framework or .NET Core?
-
- Posts: 19
- Joined: Mon 14 Mar 2016 17:11
Re: PgSqlConnection.EnlistTransaction throws NotSupportedException
Assembles were installed via nuget
A project targets both net462 and netcoreapp2.0, EnlistTransaction method fails on both.
the code:
Output:
A project targets both net462 and netcoreapp2.0, EnlistTransaction method fails on both.
the code:
Code: Select all
using System;
using Devart.Data;
namespace devart_sqlite
{
class Program
{
static void Main(string[] args)
{
using(var con = new Devart.Data.PostgreSql.PgSqlConnection())
{
con.ConnectionString = "...";
con.Open();
con.EnlistTransaction(System.Transactions.Transaction.Current);
Console.WriteLine("opened");
}
}
}
}
Code: Select all
D:\Work\Learn\dotnet\devart_pgsql>dotnet run -f net462
Unhandled Exception: System.NotSupportedException: Specified method is not supported.
at System.Data.Common.DbConnection.EnlistTransaction(Transaction transaction)
at devart_sqlite.Program.Main(String[] args)
D:\Work\Learn\dotnet\devart_pgsql>dotnet run -f netcoreapp2.0
Unhandled Exception: System.NotSupportedException: Specified method is not supported.
at System.Data.Common.DbConnection.EnlistTransaction(Transaction transaction)
at devart_sqlite.Program.Main(String[] args) in D:\Work\Learn\dotnet\devart_pgsql\Program.cs:line 24
Re: PgSqlConnection.EnlistTransaction throws NotSupportedException
.NET Standard 1.x (.NET Core 1.x) doesn't support TransactionScope:
https://github.com/dotnet/corefx/issues/2949
https://docs.microsoft.com/en-us/dotnet ... andard-1.3
Referencing .NET Framework assemblies from .NET Standard project will not solve the issue as well because this allows to only use types within the .NET Standard API set. Refer to https://blogs.msdn.microsoft.com/dotnet ... -core-2-0/ > the "Reference .NET Framework libraries from .NET Standard" section.
We will notify you when .NET Core 2.0 is supported by dotConnect for PostgreSQL.
https://github.com/dotnet/corefx/issues/2949
https://docs.microsoft.com/en-us/dotnet ... andard-1.3
Referencing .NET Framework assemblies from .NET Standard project will not solve the issue as well because this allows to only use types within the .NET Standard API set. Refer to https://blogs.msdn.microsoft.com/dotnet ... -core-2-0/ > the "Reference .NET Framework libraries from .NET Standard" section.
We will notify you when .NET Core 2.0 is supported by dotConnect for PostgreSQL.
Re: PgSqlConnection.EnlistTransaction throws NotSupportedException
.NET Core 2.0 is supported: viewtopic.php?f=3&t=36126.