linq2db / linq2db

Linq to database provider.
MIT License
2.99k stars 457 forks source link

Target .NET 5.0 #2808

Closed MJNsoft closed 3 years ago

MJNsoft commented 3 years ago

Describe your issue.

If you have a question, first try to check our documentation, especially FAQ and search in issues - maybe your question already answered there.

If you are seeing an exception, include the full exceptions details (message and stack trace).

Exception message:
Stack trace:

Steps to reproduce

Include a complete code listing (or project/solution) that we can run to reproduce the issue.

Partial code listings, or multiple fragments of code, will slow down our response or cause us to push the issue back to you to provide code to reproduce the issue.

<code with error and mapping classes>

Environment details

linq2db version: ? Database Server: ? Database Provider: ? Operating system: ? .NET Framework: ?

MJNsoft commented 3 years ago

Targeting .NET 5.0 including support for MS Access would be greatly appreciated.

MaceWindu commented 3 years ago
  1. What you expect to achieve with net5 targeting?
  2. Access already supported using both OleDb and ODBC drivers.
MJNsoft commented 3 years ago

Access is explicitly deactivated for .NET standard builds 1.6 and 2.0 which is used when building a .NET 5.0 app. By targeting .NET 5.0 and using Microsoft.Windows.Compatibility for this target this could easily be fixed.

MaceWindu commented 3 years ago

Not sure I understand. .net knows nothing about Access as there is no managed Access provider. All interactions with Access are done using System.Data.OleDb or System.Data.ODBC generic providers and they work even with .net core 2.1 (lowest runtime version we use for testing).

Only know issue is a bug with x64 OleDb provider, causing AV. But this bug is not fixed and actual for all .net core versions including net 5: https://github.com/dotnet/runtime/issues/46187

MJNsoft commented 3 years ago

I have a test project which targeted .NET 4.61 previously which I want to change to .NET 5.0. I found that the target of Linq2Db being used in this project to be netstandard2.0 as net5.0 was not explicitly targeted. I found that my tests did not work any more because there is no Provider "Access". The reason for this is a deactived line in ctor DataConnection() when targeting netstandard2.0. After I added net5.0 to the project and adjusting some #if everything worked fine.