1

everybody. I have next issue/problem. I have migrated my project (dll target, not exe) from netfr 4.6 to net6. Everything looks fine, there are almost no code changes. But when I try to use my built dll it could not resolve referenced assemblies: for now only System.Data.SqlClient, but further it may be more (I think).

Here is a message from the AssemblyResolve event handler: enter image description here

And there is the exception:

enter image description here

Because my folder contains only third-party assemblies (DevExpress) and not SqlClient.dll.

I tried to put there assemblies from nuget packages folder, but there are many tens versions and result was always identical:

enter image description here

Other code (except SqlClient) works, net6 runtime is ok.

Net Framework 4.8 is installed too.

So maybe somebody faced with the same issue and knows how to handle this situation (references resolving).

Thanks in advice.

Sergey Alikin
  • 159
  • 10
  • System.Data.SqlClient is not part of the primary platform pack - an *exe* would need a nuget package reference to https://www.nuget.org/packages/System.Data.SqlClient#versions-body-tab - however, this isn't an exe, it is a library; so: how are you shipping this library? the final exe needs the binaries, and the easiest way to do that would be via a transitive package dependency – Marc Gravell Dec 06 '22 at 13:52
  • @MarcGravell, thanks for your answer. There is more complicated question than just one file. SqlClient, Microsoft.Identity.Client, ... – Sergey Alikin Dec 07 '22 at 09:59
  • well, since this comment is the first time you've mentioned Microsoft.Identity.Client, and you haven't added any context: I'm not sure what you want me to do with that; but my observation remains: the easiest way to handle this is with transitive package dependencies, which would be resolved automatically when building the exe – Marc Gravell Dec 07 '22 at 11:02
  • Marc, I'm sorry, I wasted your time. If shortly - I'm done with the migration, but I have migrated to net7, not to net6. Thank you again for your patience. – Sergey Alikin Dec 10 '22 at 05:15

0 Answers0