-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Presence of various section in app.config breaks initialiser #558
Comments
Could you share C:\Users\Jason\RiderProjects\TestSQL\TestSQL\bin\Debug\netcoreapp3. |
Sure, this one fails with the exception:
Adding only an appSettings section give a working TestSQL.dll.config of this:
|
Hi @jsobell, According to Microsoft documentation If I tried the sample you provided with this fix and it worked fine. Please give it a try and let me know if it fixes the issue.
|
Well that might explain why that tag in that way causes an issue, but it does leave a couple of questions:
If I add a definition for the subsection, the error is avoided, so hopefully this will help anyone else chasing this error: <configSections>
<section name="system.diagnostics" type="System.Configuration.SingleTagSectionHandler" />
</configSections> but given that this has never been a requirement in the past, is it right to enforce it in SqlClient? At the very least, let's get an appropriate exception thrown by the client :) |
I added it to more investigation for adding an appropriate exception. |
Awesome speedy work @cheenamalhotra |
The presence of a configSections in an app.config breaks the connection initialiser.
To reproduce just create the most basic app possible (server name etc. is irrelevant):
Adding an app.config with various combinations of sections such as
causes the exception, as does adding a
<system.diagnostics>
section.This is on .Net Core 3.0 or 3.1, Microsoft.Data.SqlClient, Version=1.12.20106.1
The text was updated successfully, but these errors were encountered: