-
Aug 31st, 2023, 08:34 AM
#1
Thread Starter
Lively Member
System.Data.SqlClient not found at run-time (installed release .exe)
I am using the VS2022 template (project) for setup and deployment. I am not using any sql in the Winform app (.NET 7.0). Occasionally, when compiling (building) the assembly, the assembly will populate a listing of System.Data.SqlClient in the setup dependencies. If I manually delete the System.Data.SqlClient dependency in the setup project, then build the setup, there are no issues.
However, with the latest version of VS (Pro), I started noticing the exception System.Data.SqlClient not found during run-time of the installed .exe (bulit in \Release\bin). Whether or not this is due to the latest update of VS, I am wondering how to stop the compiled/installed app assembly from *looking for* System.Data.SqlClient. I have all the namespaces (Imports...) removed that mention Sql. The attached pic is from actual run-time of the installed .exe
-
Aug 31st, 2023, 10:37 AM
#2
Re: System.Data.SqlClient not found at run-time (installed release .exe)
Unless something is broken, it would only be including the assembly in the installer if you have referenced it in the application project. Remove the reference and there should be no issue, I would think.
-
Aug 31st, 2023, 10:38 AM
#3
Re: System.Data.SqlClient not found at run-time (installed release .exe)
The VB.NET forum is for questions about VB.NET. Questions about installers belong in the Application Deployment forum. Thread moved.
-
Aug 31st, 2023, 11:22 AM
#4
Thread Starter
Lively Member
Re: System.Data.SqlClient not found at run-time (installed release .exe)
-
Aug 31st, 2023, 02:36 PM
#5
Thread Starter
Lively Member
Re: System.Data.SqlClient not found at run-time (installed release .exe)
Since I am using JSON, there are numerous JSON dependencies for System.Data.SqlClient listed throughout the app. Thus, I made sure the latest assembly was installed using Nuget, and the Imports System.Data.Sqlclient was listed at the top of the namespace listings. The I qui and rstarted VS2022 compiled, built the setup app and I still get the same error at run-time. So what's happening is that the app assembly is looking for version 4.6.0.0 (see pic above), even though I am using the redirect in app.config as follows:
Code:
<dependentAssembly>
<assemblyIdentity name="System.Data.SqlClient" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.6.0.0" newVersion="4.8.5.0" />
</dependentAssembly>
By the way, I used the publicKeyToken of the new version (4.8.5), but at run-time the app assembly is not recognizing the redirect. Last, I searched "Entire Solution" for 4.6.0 and found nothing. So where could the reference call to an old assembly be coming from and why is the redirect not working?
-
Aug 31st, 2023, 03:07 PM
#6
Re: System.Data.SqlClient not found at run-time (installed release .exe)
Since I am using JSON, there are numerous JSON dependencies for System.Data.SqlClient listed throughout the app.
Yeah, that's not tracking for me ... I don't see what JSON has to do with SQLClient in anyway... they're two separate animals. What library did you install for JSON parsing? I've been doing some work with JSON lately too, but never needed SQLClient ...
-tg
-
Aug 31st, 2023, 05:01 PM
#7
Thread Starter
Lively Member
Re: System.Data.SqlClient not found at run-time (installed release .exe)
On the other hand, if I uninstall system.data.sqlclient in nuget, and make sure the imports does not include the namespace, why is the app looking for the sql assembly?
-
Aug 31st, 2023, 07:59 PM
#8
Re: System.Data.SqlClient not found at run-time (installed release .exe)
Perhaps you should look at the stack trace for the exception to see where it's being thrown.
-
Sep 1st, 2023, 04:12 PM
#9
Re: System.Data.SqlClient not found at run-time (installed release .exe)
 Originally Posted by pel11
On the other hand, if I uninstall system.data.sqlclient in nuget, and make sure the imports does not include the namespace, why is the app looking for the sql assembly?
What library did you install for JSON parsing?
-tg
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|