Skip to content
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

Unable to listen to events from System.Data.SqlClient and Microsoft.Data.SqlClient via EventListener in one application #436

Closed
vhatsura opened this issue Feb 19, 2020 · 2 comments
Assignees
Milestone

Comments

@vhatsura
Copy link

vhatsura commented Feb 19, 2020

Is your feature request related to a problem? Please describe.

At the moment, it's impossible to listen to events from System.Data.SqlClient and Microsoft.Data.SqlClient via EventListener in one .Net Framework application due to event sources for both libraries have the similar name Microsoft-AdoNet-SystemData. As a result, GUIDs associated with event sources also are similar and the following error has occurred:

Exception in Command Processing for EventSource Microsoft-AdoNet-SystemData:
An instance of EventSource with Guid 6a4dfe53-eb50-5332-8473-7b7e10a94fd1 already exists.

Describe the solution you'd like

Have a different event source name like it was done for diagnostic sources, however, it looks like a breaking change. Maybe it's a candidate to change it in 2.0.0 version

Describe alternatives you've considered

I don't see any alternatives right now.

Additional context

To be honest, I don't think it is often a scenario to have both SQL clients in user code. The only possible scenario is for the code migration period.

@JRahnama
Copy link
Contributor

JRahnama commented Feb 19, 2020

@vhatsura Thank you for mentioning this. Currently we are working on EventSource in NetFx and NetCore. In our next release for M.D.S, events will be unified under a general name Microsoft.Data.SqlClient.EventSource.

@cheenamalhotra cheenamalhotra added this to the 2.0.0 milestone Feb 19, 2020
@cheenamalhotra
Copy link
Member

Hi @vhatsura

The PR to address this issue along with EventSource addition (#399) has been merged.
The fix will be available in next release v2.0.0-preview2 planned in March.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants