Skip to content

Commit

Permalink
Merge pull request #28 from linq2db/master
Browse files Browse the repository at this point in the history
Release 2.9.3
  • Loading branch information
MaceWindu authored Oct 30, 2019
2 parents b879594 + 17b6cb5 commit 8eda5fe
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
22 changes: 22 additions & 0 deletions Source/DriverHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

using LINQPad.Extensibility.DataContext;
using System.Reflection;
using System.IO;

namespace LinqToDB.LINQPad
{
Expand Down Expand Up @@ -190,5 +191,26 @@ public static void ConfigureRedirects()
return typeof(DataContext).Assembly;
};
}

public static void SapHanaSPS04Fixes()
{
// recent SAP HANA provider (SPS04) uses Assembly.GetEntryAssembly() calls during native dlls discovery, which
// leads to NRE as it returns null under NETFX, so we need to fake this method result to unblock HANA testing
// https://github.com/microsoft/vstest/issues/1834
// https://dejanstojanovic.net/aspnet/2015/january/set-entry-assembly-in-unit-testing-methods/
try
{
var assembly = Assembly.GetCallingAssembly();

var manager = new AppDomainManager();
var entryAssemblyfield = manager.GetType().GetField("m_entryAssembly", BindingFlags.Instance | BindingFlags.NonPublic);
entryAssemblyfield.SetValue(manager, assembly);

var domain = AppDomain.CurrentDomain;
var domainManagerField = domain.GetType().GetField("_domainManager", BindingFlags.Instance | BindingFlags.NonPublic);
domainManagerField.SetValue(domain, manager);
}
catch { /* ne shmagla */ }
}
}
}
1 change: 1 addition & 0 deletions Source/LinqToDBDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class LinqToDBDriver : DynamicDataContextDriver
static LinqToDBDriver()
{
DriverHelper.ConfigureRedirects();
DriverHelper.SapHanaSPS04Fixes();
}

public override string GetConnectionDescription(IConnectionInfo cxInfo)
Expand Down
10 changes: 5 additions & 5 deletions Source/linq2db.LINQPad.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Company>linq2db</Company>
<Product>linq2db.LINQPad</Product>
<AssemblyTitle>$(Product)</AssemblyTitle>
<Version>2.9.1</Version>
<Version>2.9.3</Version>
<AssemblyVersion>$(Version)</AssemblyVersion>
<FileVersion>$(Version)</FileVersion>
<Copyright>Copyright © 2018 Igor Tkachev, Ilya Chudin, Svyatoslav Danyliv, Dmitry Lukashenko</Copyright>
Expand All @@ -20,14 +20,14 @@
<PackageReference Include="Extended.Wpf.Toolkit" Version="3.6.0" />
<PackageReference Include="FirebirdSql.Data.FirebirdClient" Version="7.1.1" />
<PackageReference Include="JetBrains.Annotations" Version="2019.1.3" />
<PackageReference Include="linq2db" Version="2.9.1" />
<PackageReference Include="linq2db" Version="2.9.3" />
<PackageReference Include="linq2db4iSeries" Version="2.9.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="1.3.2" />
<PackageReference Include="Microsoft.SqlServer.Types" Version="14.0.1016.290" />
<PackageReference Include="MySql.Data" Version="8.0.17" />
<PackageReference Include="MySql.Data" Version="8.0.18" />
<PackageReference Include="Npgsql" Version="4.0.10" />
<PackageReference Include="Oracle.ManagedDataAccess" Version="19.3.1" />
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.111" />
<PackageReference Include="Oracle.ManagedDataAccess" Version="19.5.0" />
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.112" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 8eda5fe

Please sign in to comment.