Connect to SQL database with .net 8.0

Connect to SQL database with .net 8.0

CBennett34F8SS
Contributor Contributor
4,981 Views
5 Replies
Message 1 of 6

Connect to SQL database with .net 8.0

CBennett34F8SS
Contributor
Contributor

I have a command that will pull data from a SQL database and import it into a title block.  This worked fine in .net framework.  I recently migrated to 2025 and .net 8.0 and I am getting the following error: System.PlatformNotSupportedException: 'Microsoft.Data.SqlClient is not supported on this platform.'

 

I created a test console app in .net 8.0 and I am able to pull data from that database that way.  Has anyone else run into this issue?

Accepted solutions (1)
4,982 Views
5 Replies
Replies (5)
Message 2 of 6

CBennett34F8SS
Contributor
Contributor
Accepted solution

nevermind I found it,  for some reason Microsoft.Data.SqlClient is not choosing the correct runtime .dll to load.  I specified it in my project file with <RuntimeIdentifier>win-x64</RuntimeIdentifier>  and it is now working again.

Message 3 of 6

kerry_w_brown
Advisor
Advisor

For anyone else :
I noticed this today

https://adndevblog.typepad.com/autocad/2024/05/connecting-to-sql-server-from-autocad-2025.html

 

Perhaps this article by Madhukar Moogala  @moogalm will help those with an SQL issue.
Regards,


// Called Kerry or kdub in my other life.

Everything will work just as you expect it to, unless your expectations are incorrect. ~ kdub
Sometimes the question is more important than the answer. ~ kdub

NZST UTC+12 : class keyThumper<T> : Lazy<T>;      another  Swamper
0 Likes
Message 4 of 6

Fabian.OswaldS52TK
Enthusiast
Enthusiast

<RuntimeIdentifier>win-x64</RuntimeIdentifier> was the Solution!


Agrarbau - Industrie- und Gewerbebau - Behälterbau - Stahlbau - Nagelplatten - Hausbau

Oswald Fabian
0 Likes
Message 5 of 6

kerry_w_brown
Advisor
Advisor

Perhaps ypu guys need to look at this :

https://github.com/MadhukarMoogala/ACAD-SQLPlugin

 

From 3 months ago.


// Called Kerry or kdub in my other life.

Everything will work just as you expect it to, unless your expectations are incorrect. ~ kdub
Sometimes the question is more important than the answer. ~ kdub

NZST UTC+12 : class keyThumper<T> : Lazy<T>;      another  Swamper
0 Likes
Message 6 of 6

Domzinator
Advocate
Advocate

I have also strugled with this when i first tried to get all my tools to work in .net 8.0 i also use a sql database and there wasnt allot of info around at the time. Im glad to see that there are now

Civil 3D Certified Professional
0 Likes