System.Data.SQLClient - Autocad 2025

System.Data.SQLClient - Autocad 2025

tmfieker
Participant Participant
1,602 Views
5 Replies
Message 1 of 6

System.Data.SQLClient - Autocad 2025

tmfieker
Participant
Participant

Loading an app (DLL created in VB.NET using .NET Framework 4.6) in Autocad 2025 returns the following error.

Erro.png

This app try to connect to a Microsft SQL Server using System. Data.SQLClient.

Running the same app in Autocad 2018 and 2024 it works perfectly.

Rebuild using .NET Framework 4.8 the same error is returned.

When SQL Server is not accessed this app runs in Autocad 2025 successfully (using .NET Framework 4.6 or 4.8).

Why is this occurring only in Autocad 2025?

Thanks!

0 Likes
1,603 Views
5 Replies
Replies (5)
Message 2 of 6

matt.worland
Collaborator
Collaborator

In 2025, Autocad is using .NET instead of the 4.8 framework. In .NET I believe it it was changed to Microsoft.Data instead of System.Data

If my reply was helpful, please give a "Thumbs Up" or "Accept as Solution"
0 Likes
Message 3 of 6

tmfieker
Participant
Participant

Matt, thanks for the answer, but replacing System.Data. SQLClient by Microsoft.Data.SQLClient also does not work and generates other errors.

0 Likes
Message 4 of 6

kerry_w_brown
Advisor
Advisor

From Dario Bellinazzi

I had the same problem, you need to specify both target framework and runtime platform in the .proj file:

<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>

Without <RuntimeIdentifier> dotnet builder doesn't know which type of SqlClient implementation (or others ex. .net Framework converted to NuGet namespaces) is expected to be used from .NET8 in the AutoCAD Environment from the various given by NuGet Package for different platforms.

//---

 

Do you find System.Data.SqlClient.dll in your output path folder?
If not add <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>. .NET8 doesn't automatically copy referenced packages without this setting, so it could be that the assembly resolver is not finding the referenced library because is not present.

 


I understand this issue was still being addressed.

perhaps Madhukar Moogala ( @moogalm ) can help.

 

 

Untried.
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
Message 5 of 6

tmfieker
Participant
Participant

Thanks, I´ll send an email to Madhu.

I will test your sugestion too. 

0 Likes
Message 6 of 6

tmfieker
Participant
Participant

Is is necessary to follow the Migration Guide written by Gilles Chanteau: 

https://info.quuxsoft.com/ftp/Migration_NET_Core%20English.pdf