We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Cannot unsubscribe from "LogEntriesChanged" event handler because a new delegate is created inside the add method of the event.
You should be able to unsubscribe from "LogEntriesChanged" with the same event handler that is used to subscribe to the event.
``
public event NotifyCollectionChangedEventHandler LogEntriesChanged { add { _options.LogEntries.CollectionChanged += (sender, eventRecordArgs) => { try { value(sender, eventRecordArgs); } catch (Exception exception) { _options.Logger.Error("Error calling the LogEntriesChanged event handler: {0}", exception.Message); } }; } remove => _options.LogEntries.CollectionChanged -= value; } https://github.com/WireMock-Net/WireMock.Net/blob/master/src/WireMock.Net/Server/WireMockServer.LogEntries.cs
public event NotifyCollectionChangedEventHandler LogEntriesChanged { add { _options.LogEntries.CollectionChanged += (sender, eventRecordArgs) => { try { value(sender, eventRecordArgs); } catch (Exception exception) { _options.Logger.Error("Error calling the LogEntriesChanged event handler: {0}", exception.Message); } }; } remove => _options.LogEntries.CollectionChanged -= value; }
The text was updated successfully, but these errors were encountered:
@IamHF Can you try preview version: 1.5.13-ci-16909
1.5.13-ci-16909
https://github.com/WireMock-Net/WireMock.Net/wiki/MyGet-preview-versions
Sorry, something went wrong.
#870
@IamHF Can you please test that preview version?
@IamHF Can you please verify if that preview NuGet fixes your problem?
Code merged
StefH
No branches or pull requests
Describe the bug
Cannot unsubscribe from "LogEntriesChanged" event handler because a new delegate is created inside the add method of the event.
Expected behavior:
You should be able to unsubscribe from "LogEntriesChanged" with the same event handler that is used to subscribe to the event.
Test to reproduce
``
Other related info
public event NotifyCollectionChangedEventHandler LogEntriesChanged { add { _options.LogEntries.CollectionChanged += (sender, eventRecordArgs) => { try { value(sender, eventRecordArgs); } catch (Exception exception) { _options.Logger.Error("Error calling the LogEntriesChanged event handler: {0}", exception.Message); } }; } remove => _options.LogEntries.CollectionChanged -= value; }
https://github.com/WireMock-Net/WireMock.Net/blob/master/src/WireMock.Net/Server/WireMockServer.LogEntries.cs
The text was updated successfully, but these errors were encountered: