diff --git a/EntityFrameworkCore.Jet.sln b/EntityFrameworkCore.Jet.sln
index eacda3f..4566bf5 100644
--- a/EntityFrameworkCore.Jet.sln
+++ b/EntityFrameworkCore.Jet.sln
@@ -30,6 +30,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCore.Jet.FunctionalTests"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{B7FF1850-23D0-465A-9D45-7EDEB9A23AD8}"
ProjectSection(SolutionItems) = preProject
+ docs\DevNotes.md = docs\DevNotes.md
docs\README.md = docs\README.md
EndProjectSection
EndProject
@@ -42,6 +43,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build help", "build help", "{20B764C9-8664-4609-A743-8CF32BA6CA69}"
ProjectSection(SolutionItems) = preProject
Directory.Build.targets = Directory.Build.targets
+ NuGet.Config = NuGet.Config
EndProjectSection
EndProject
Global
diff --git a/NuGet.Config b/NuGet.Config
new file mode 100644
index 0000000..7bd67a6
--- /dev/null
+++ b/NuGet.Config
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/DevNotes.md b/docs/DevNotes.md
new file mode 100644
index 0000000..dc8fd4b
--- /dev/null
+++ b/docs/DevNotes.md
@@ -0,0 +1,56 @@
+# Notes for Developers/Builders
+
+## Important Notes as of Feb 21, 2020
+- System.Data.OleDb currently has several issues with x86, testing on x64 is recommended.
+
+## System.Data.OleDb Issues
+- Current Nuget.org package (version 4.7.0) contains several significant bugs:
+ - https://github.com/dotnet/runtime/issues/32509
+ - (fixed, awaiting merge) https://github.com/dotnet/runtime/issues/31177
+ - (fixed, merged) https://github.com/dotnet/runtime/issues/981
+- Use NuGet.Config (see below) to get nightly builds instead of using the published version
+
+## Nuget.Config
+- Used to get latest nightly builds of System.Data.OleDb
+- When a public release is posted to NuGet.org, having the NuGet.Config file likely won't be necessary
+
+## .NET Core 3.0/3.1 Issues
+- using the dynamic keyword with COM objects not supported on .NET Core 3.0/3.1
+- instead, System.Data.Jet.csproj includes two COMReference nodes for ADODB.dll & ADOX.dll, which generate strongly-typed references to these packages. No x86/x64 issues have been encountered during preliminary tests, but I believe .NET 5.0 may support using the dynamic keyword with COM objects, so the code could possibly be reverted to the way it was, if issues with the COM wrappers are found.
+- Affects AdoxWrapper.cs, JetStoreSchemaDefinitionRetrieve.cs & JetSyntaxHelper.cs
+- FYI: Paths to msadox.dll:
+ - C:\Program Files\Common Files\System\ado
+ - C:\Program Files (x86)\Common Files\System\ado
+
+## Directory.Build.targets
+- Used due to conflict between the EF Core 2.2 and .NET Core 3.1 versions of IAsyncGrouping<,> & IAsyncEnumerable<>. Invoked via setting an Alias attribute on the appropriate PackageReference.
+- Affects SharedTypeExtensions.cs
+
+## Test Design Guidelines
+- Consider extracting out global test configuration settings to a single file:
+ - Provider [string]: "Microsoft.ACE.OLEDB.15.0"
+ - TempDirectoryPath [string]: "C:\TEMP"
+ - RunSqlCeTests [bool] : true/false
+ - RunSqlServerTests [bool] : true/false
+ - RunSqliteTests [bool] : true/false
+
+## Prerequisites for Building/Running Tests
+- Install SQL Compact 4.0
+ - x86 or x64 (whichever applies to the version of Windows used)
+- Install Microsoft Access 2013 Runtime (https://www.microsoft.com/en-us/download/details.aspx?id=39358)
+ - x86, x64, or Both (not sure if installing both x86 and x64 side-by-side works properly)
+- The folder "C:\TEMP" must exist, certain tests will throw if it does not
+
+## Test Runner Issues
+- Test projects need to use Microsoft.NET.Test.SDK version 16.4.0 or higher to switch between x86/x64, otherwise Visual Studio test runner does not respect the "Processor Architecture for Any CPU" setting and still tries to run x86 tests on x64.
+- Refer to: https://developercommunity.visualstudio.com/content/problem/697732/test-runner-wont-execute-net-core-tests-in-32-bit.html
+- Ensure xUnit test projects contain a reference to the nuget package xunit.runner.visualstudio to run the test from Visual Studio Test Explorer
+
+## General Resources
+- Multitargeting
+https://docs.microsoft.com/en-us/dotnet/core/tutorials/libraries#how-to-multitarget
+- MS Access Data Manipulation Language
+https://docs.microsoft.com/en-us/office/client-developer/access/desktop-database-reference/data-manipulation-language
+
+## Outdated Notes that Probably are No Longer Important
+- Probably want to set Visual Studio to use PackageReference instead of packages.config by default (Options->Nuget Package Manager)
\ No newline at end of file
diff --git a/docs/README.md b/docs/README.md
index 7994dfe..09015c5 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -7,24 +7,6 @@ the .NET Core runtime (netcore and netstandard).
You can find the latest build on [NuGet](https://www.nuget.org/packages/EntityFrameworkCore.Jet/)
-## Prerequisites for building tests
-- Install SQL Compact 4.0
- - x86 or x64 (whichever applies)
-- Install Microsoft Access 2013 Runtime (https://www.microsoft.com/en-us/download/details.aspx?id=39358)
- - x86, x64, or Both
-- (maybe?) Install Microsoft Access Database Engine 2010 Redistributable (https://www.microsoft.com/en-US/download/details.aspx?id=13255)
- - x86, x64, or Both
-- The folder "C:\TEMP" must exist
-- Ensure xUnit test projects contain a reference to the nuget package xunit.runner.visualstudio to run the test from Visual Studio Test Explorer
-
-## Random Notes
-- Will need to upgrade test projects to use Microsoft.NET.Test.SDK version 16.4.0 or higher, otherwise Visual Studio test runner still tries to run x86 tests on x64. Refer to: https://developercommunity.visualstudio.com/content/problem/697732/test-runner-wont-execute-net-core-tests-in-32-bit.html
-- Paths to msadox.dll:
- - C:\Program Files\Common Files\System\ado
- - C:\Program Files (x86)\Common Files\System\ado
-- Probably want to set Visual Studio to use PackageReference instead of packages.config by default (Options->Nuget Package Manager)
-- https://docs.microsoft.com/en-us/dotnet/core/tutorials/libraries#how-to-multitarget
-
## More documentation
More documentation can be found on project [Wiki](https://www.github.com/bubibubi/EntityFrameworkCore.Jet/wiki)
diff --git a/src/EFCore.Jet/EFCore.Jet.csproj b/src/EFCore.Jet/EFCore.Jet.csproj
index 6924ed6..0c97c8d 100644
--- a/src/EFCore.Jet/EFCore.Jet.csproj
+++ b/src/EFCore.Jet/EFCore.Jet.csproj
@@ -1,7 +1,7 @@
- net461;netcoreapp3.1
+ netstandard2.0;net461;netcoreapp3.1
false
EntityFrameworkCore.Jet
EntityFrameworkCore.Jet
diff --git a/src/System.Data.Jet/AdoxWrapper.cs b/src/System.Data.Jet/AdoxWrapper.cs
index 4feedb7..14c91c6 100644
--- a/src/System.Data.Jet/AdoxWrapper.cs
+++ b/src/System.Data.Jet/AdoxWrapper.cs
@@ -24,7 +24,6 @@ namespace System.Data.Jet
}
finally
{
- //catalog.ActiveConnection.Close();
((ADODB.Connection)catalog.ActiveConnection).Close();
}
}
@@ -50,7 +49,6 @@ namespace System.Data.Jet
}
finally
{
- //catalog.ActiveConnection.Close();
((ADODB.Connection)catalog.ActiveConnection).Close();
}
}
@@ -75,7 +73,6 @@ namespace System.Data.Jet
}
catch (Exception e)
{
- //catalog.ActiveConnection.Close();
((ADODB.Connection)catalog.ActiveConnection).Close();
throw new Exception("Cannot rename index. Cannot retrieve the table '" + tableName + "'", e);
}
@@ -87,7 +84,6 @@ namespace System.Data.Jet
}
catch (Exception e)
{
- //catalog.ActiveConnection.Close();
((ADODB.Connection)catalog.ActiveConnection).Close();
throw new Exception("Cannot rename index. Cannot retrieve the old index '" + indexName + "'", e);
}
@@ -104,7 +100,6 @@ namespace System.Data.Jet
}
finally
{
- //catalog.ActiveConnection.Close();
((ADODB.Connection)catalog.ActiveConnection).Close();
}
@@ -156,7 +151,6 @@ CREATE UNIQUE INDEX [ParentIdName] ON [MSysAccessStorage] ([ParentId], [Name]);"
try
{
- //catalog.ActiveConnection.Close();
var x = ((ADODB.Connection)catalog.ActiveConnection);
x.Close();
}
@@ -172,30 +166,7 @@ CREATE UNIQUE INDEX [ParentIdName] ON [MSysAccessStorage] ([ParentId], [Name]);"
private static ADOX.Catalog GetCatalogInstance(string errorPrefix)
{
- var catalog = new ADOX.Catalog();
- return catalog;
-
- //Type adoxCatalogType;
- //dynamic catalog;
-
- //try
- //{
- // adoxCatalogType = Type.GetTypeFromProgID("ADOX.Catalog", true);
- //}
- //catch (Exception e)
- //{
- // throw new Exception(errorPrefix + ". Cannot retrieve ADOX.Catalog type. Check ADOX installation.", e);
- //}
-
- //try
- //{
- // catalog = System.Activator.CreateInstance(adoxCatalogType);
- //}
- //catch (Exception e)
- //{
- // throw new Exception(errorPrefix + ". Cannot create an instance of ADOX.Catalog type.", e);
- //}
- //return catalog;
+ return new ADOX.Catalog();
}
private static ADOX.Catalog GetCatalogInstanceAndOpen(string errorPrefix, string connectionString)
@@ -204,7 +175,6 @@ CREATE UNIQUE INDEX [ParentIdName] ON [MSysAccessStorage] ([ParentId], [Name]);"
try
{
- //catalog.ActiveConnection = connectionString;
ADODB.Connection cnn = new ADODB.Connection();
cnn.Open(ConnectionString: connectionString);
catalog.ActiveConnection = cnn;
diff --git a/src/System.Data.Jet/System.Data.Jet.csproj b/src/System.Data.Jet/System.Data.Jet.csproj
index 2269f55..40add48 100644
--- a/src/System.Data.Jet/System.Data.Jet.csproj
+++ b/src/System.Data.Jet/System.Data.Jet.csproj
@@ -1,7 +1,7 @@
- net461;netcoreapp3.1
+ netstandard2.0;net461;netcoreapp3.1
false
AnyCPU;x86;x64
@@ -63,7 +63,7 @@
-
+
\ No newline at end of file
diff --git a/test/EFCore.Jet.Integration.Test/AssemblyInitialization.cs b/test/EFCore.Jet.Integration.Test/AssemblyInitialization.cs
index d9cc7ff..2018060 100644
--- a/test/EFCore.Jet.Integration.Test/AssemblyInitialization.cs
+++ b/test/EFCore.Jet.Integration.Test/AssemblyInitialization.cs
@@ -25,7 +25,7 @@ namespace EFCore.Jet.Integration.Test
Helpers.DeleteSqlCeDatabase();
Helpers.CreateSqlCeDatabase();
#elif NETCOREAPP
-
+ // SqlCe does not currently support .NET Core, so don't do anything for AssemblyInitialization
#else
throw new PlatformNotSupportedException();
#endif
diff --git a/test/EFCore.Jet.Integration.Test/TestBase`.cs b/test/EFCore.Jet.Integration.Test/TestBase`.cs
index b67489d..5948456 100644
--- a/test/EFCore.Jet.Integration.Test/TestBase`.cs
+++ b/test/EFCore.Jet.Integration.Test/TestBase`.cs
@@ -146,14 +146,19 @@ namespace EFCore.Jet.Integration.Test
{
var optionsBuilder = new DbContextOptionsBuilder().EnableSensitiveDataLogging();
- if (dbConnection is SqlCeConnection)
+
#if NETFRAMEWORK
+ if (dbConnection is SqlCeConnection)
return optionsBuilder.UseSqlCe(dbConnection).Options;
-#else
+#elif NETCOREAPP
+ if (dbConnection is SqlCeConnection)
{
- Assert.Inconclusive();
+ Assert.Inconclusive("SqlCe does not currently support .NET Core");
return default;
}
+#else
+ if (dbConnection is SqlCeConnection)
+ throw new PlatformNotSupportedException();
#endif
else if (dbConnection is JetConnection)
return optionsBuilder.UseJet(dbConnection).Options;