Skip to content

Commit dd133b3

Browse files
committed
release 1.2.6 - provider detection fix
1 parent 3e4b071 commit dd133b3

File tree

4 files changed

+31
-7
lines changed

4 files changed

+31
-7
lines changed

Connection/StaticInit.vb

+27-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Imports System.Configuration
1+
Imports System.Configuration
22
Imports System.Data.Common
33
Imports System.IO
44
Imports System.Reflection
@@ -46,14 +46,15 @@ Partial Public MustInherit Class Connection
4646
End Sub
4747

4848
Private Shared Sub _staticInitCompleteProviders()
49-
Dim asms As New Dictionary(Of String, Reflection.Assembly)
49+
Dim asms As New List(Of String)
5050
Dim asmName As String
5151
Dim connectionType As Type
5252
Dim conn As Connection
5353
Dim referencedAsms As Reflection.Assembly() = AppDomain.CurrentDomain.GetAssemblies()
5454
For Each asm As Reflection.Assembly In referencedAsms
55+
asmName = asm.GetName().Name
56+
asms.Add(asmName)
5557
If Connection._staticInitIsDatabasicSubAssembly(asm) Then
56-
asmName = asm.GetName().Name
5758
connectionType = asm.GetType(asmName + ".Connection")
5859
If Not TypeOf connectionType Is Type Then Continue For
5960
conn = Activator.CreateInstance(connectionType)
@@ -63,6 +64,29 @@ Partial Public MustInherit Class Connection
6364
)
6465
End If
6566
Next
67+
Try
68+
Dim appDirAsms As IEnumerable(Of Assembly) = (
69+
From file In Directory.GetFiles(AppDomain.CurrentDomain.BaseDirectory)
70+
Where Path.GetExtension(file).ToLower() = ".dll"
71+
Select Assembly.LoadFrom(file)
72+
)
73+
For Each asm As System.Reflection.Assembly In appDirAsms
74+
asmName = asm.GetName().Name
75+
If (
76+
Not asms.Contains(asmName) And
77+
Connection._staticInitIsDatabasicSubAssembly(asm)
78+
) Then
79+
connectionType = asm.GetType(asmName + ".Connection")
80+
If Not TypeOf connectionType Is Type Then Continue For
81+
conn = Activator.CreateInstance(connectionType)
82+
Connection._supportedProviders.Add(conn.ClientName, connectionType)
83+
Connection._providersResources.Add(
84+
conn.ClientName, Activator.CreateInstance(conn.ProviderResource)
85+
)
86+
End If
87+
Next
88+
Catch ex As Exception
89+
End Try
6690
End Sub
6791

6892
Private Shared Function _staticInitIsDatabasicSubAssembly(asm As Reflection.Assembly) As Boolean

Databasic.nuspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
33
<metadata minClientVersion="2.6">
44
<id>Databasic.Core</id>
5-
<version>1.2.5.0</version>
5+
<version>1.2.6.0</version>
66
<title>Databasic - Core</title>
77
<authors>Tom Flidr</authors>
88
<owners>Tom Flidr</owners>

My Project/AssemblyInfo.vb

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ Install this package only with specific database package like:
3737
' by using the '*' as shown below:
3838
' <Assembly: AssemblyVersion("1.0.*")>
3939

40-
<Assembly: AssemblyVersion("1.2.5.0")>
41-
<Assembly: AssemblyFileVersion("1.2.5.0")>
40+
<Assembly: AssemblyVersion("1.2.6.0")>
41+
<Assembly: AssemblyFileVersion("1.2.6.0")>

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Databasic - Core Package
22

3-
[![Latest Stable Version](https://img.shields.io/badge/Stable-v1.2.5-brightgreen.svg?style=plastic)](https://github.com/databasic-net/databasic-core/releases)
3+
[![Latest Stable Version](https://img.shields.io/badge/Stable-v1.2.6-brightgreen.svg?style=plastic)](https://github.com/databasic-net/databasic-core/releases)
44
[![License](https://img.shields.io/badge/Licence-BSD3-brightgreen.svg?style=plastic)](https://raw.githubusercontent.com/databasic-net/databasic-core/master/LICENCE.md)
55
![.NET Version](https://img.shields.io/badge/.NET->=4.0-brightgreen.svg?style=plastic)
66

0 commit comments

Comments
 (0)