You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I understand MS.Data.SqlClient does not support trimming yet. Could the team share a build configuration that works in .NET 8.0 to include SqlClient untrimmed into an exe that is otherwise trimmed?
My goal is to publish a CLI tool that is self-contained -- and obviously trimmed for size.
Since I updated to latest MS.Data.SqlClient and .NET 8.0, no configuration I tried to exclude SqlClient from trimming works.
The only setup that works is completely disabling trimming, and insead of being ~30Mo the self-contained executable is ~180Mo now. That's terrible for a CLI tool.
Most things I tried usually end up in a TypeLoadException with "Unable to load DLL 'Microsoft.Data.SqlClient.SNI.dll'".
And I've tried to go back to the previous default of partial for TrimMode, I've tried rooting MS.Data.SqlClient with TrimmerRootAssembly but it didn't work.
I'd like an example of a csproj configuration where .net 8 trimming works in a project using SqlClient (understanding that SqlClient itself can't be trimmed, but the rest should).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I understand MS.Data.SqlClient does not support trimming yet.
Could the team share a build configuration that works in .NET 8.0 to include SqlClient untrimmed into an exe that is otherwise trimmed?
My goal is to publish a CLI tool that is self-contained -- and obviously trimmed for size.
Since I updated to latest MS.Data.SqlClient and .NET 8.0, no configuration I tried to exclude SqlClient from trimming works.
The only setup that works is completely disabling trimming, and insead of being ~30Mo the self-contained executable is ~180Mo now. That's terrible for a CLI tool.
Most things I tried usually end up in a TypeLoadException with "Unable to load DLL 'Microsoft.Data.SqlClient.SNI.dll'".
Beta Was this translation helpful? Give feedback.
All reactions