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

Internal InvalidOperationException occurs #105

Open
dittodhole opened this issue May 17, 2021 · 2 comments
Open

Internal InvalidOperationException occurs #105

dittodhole opened this issue May 17, 2021 · 2 comments

Comments

@dittodhole
Copy link

dittodhole commented May 17, 2021

Hi there,

<PackageReference Include="Makaretu.Dns.Multicast">
  <Version>0.27.0</Version>
</PackageReference>

I am unsure whether it occurs on receiver's or sender's site:

Class:   Makaretu.Dns.MulticastService
Method:  Void OnDnsMessage(System.Object, System.Net.Sockets.UdpReceiveResult)
Level:     ERROR
Logger:  Makaretu.Dns.MulticastService

Message: Receive handler failed
System.InvalidOperationException: La collection a �t� modifi�e�; l'op�ration d'�num�ration peut ne pas s'ex�cuter.
   � System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   � System.Collections.Generic.List`1.Enumerator.MoveNextRare()
   � System.Collections.Generic.List`1.Enumerator.MoveNext()
   � Makaretu.Dns.TXTRecord.WriteData(WireWriter writer)
   � Makaretu.Dns.ResourceRecord.Write(WireWriter writer)
   � Makaretu.Dns.Message.Write(WireWriter writer)
   � Makaretu.Dns.DnsObject.Length()
   � Makaretu.Dns.Message.Truncate(Int32 length)
   � Makaretu.Dns.MulticastService.SendAnswer(Message answer, Boolean checkDuplicate)
   � Makaretu.Dns.MulticastService.SendAnswer(Message answer, MessageEventArgs query, Boolean checkDuplicate)
   � Makaretu.Dns.ServiceDiscovery.OnQuery(Object sender, MessageEventArgs e)
   � Makaretu.Dns.MulticastService.OnDnsMessage(Object sender, UdpReceiveResult result)
Class:   Makaretu.Dns.MulticastService
Method:  Void OnDnsMessage(System.Object, System.Net.Sockets.UdpReceiveResult)
Level:     ERROR
Logger:  Makaretu.Dns.MulticastService

Message: Receive handler failed
System.AggregateException: Une ou plusieurs erreurs se sont produites. ---> System.InvalidOperationException: La collection a �t� modifi�e�; l'op�ration d'�num�ration peut ne pas s'ex�cuter.
   � System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   � System.Collections.Generic.List`1.Enumerator.MoveNextRare()
   � System.Collections.Generic.List`1.Enumerator.MoveNext()
   � Makaretu.Dns.TXTRecord.WriteData(WireWriter writer)
   � Makaretu.Dns.ResourceRecord.GetData()
   � Makaretu.Dns.ResourceRecord.Equals(Object obj)
   � System.Collections.Generic.ObjectEqualityComparer`1.Equals(T x, T y)
   � System.Collections.Generic.List`1.Contains(T item)
   � Makaretu.Dns.Resolving.NameServer.<>c__DisplayClass12_0.<AddAdditionalRecords>b__1(ResourceRecord a)
   � System.Linq.Enumerable.<>c__DisplayClass6_0`1.<CombinePredicates>b__0(TSource x)
   � System.Linq.Enumerable.WhereListIterator`1.MoveNext()
   � System.Linq.Enumerable.<DistinctIterator>d__64`1.MoveNext()
   � System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   � System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   � Makaretu.Dns.Resolving.NameServer.AddAdditionalRecords(Message response)
   � Makaretu.Dns.Resolving.NameServer.AddAdditionalRecords(Message response)
   � Makaretu.Dns.Resolving.NameServer.AddAdditionalRecords(Message response)
   � Makaretu.Dns.Resolving.NameServer.<ResolveAsync>d__9.MoveNext()
--- Fin de la trace de la pile � partir de l'emplacement pr�c�dent au niveau duquel l'exception a �t� lev�e ---
   � System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   � System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   � Makaretu.Dns.Resolving.NameServer.<ResolveAsync>d__8.MoveNext()
   --- Fin de la trace de la pile d'exception interne ---
   � System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   � System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   � System.Threading.Tasks.Task`1.get_Result()
   � Makaretu.Dns.ServiceDiscovery.OnQuery(Object sender, MessageEventArgs e)
   � Makaretu.Dns.MulticastService.OnDnsMessage(Object sender, UdpReceiveResult result)
---> (Exception interne #0) System.InvalidOperationException: La collection a �t� modifi�e�; l'op�ration d'�num�ration peut ne pas s'ex�cuter.
   � System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   � System.Collections.Generic.List`1.Enumerator.MoveNextRare()
   � System.Collections.Generic.List`1.Enumerator.MoveNext()
   � Makaretu.Dns.TXTRecord.WriteData(WireWriter writer)
   � Makaretu.Dns.ResourceRecord.GetData()
   � Makaretu.Dns.ResourceRecord.Equals(Object obj)
   � System.Collections.Generic.ObjectEqualityComparer`1.Equals(T x, T y)
   � System.Collections.Generic.List`1.Contains(T item)
   � Makaretu.Dns.Resolving.NameServer.<>c__DisplayClass12_0.<AddAdditionalRecords>b__1(ResourceRecord a)
   � System.Linq.Enumerable.<>c__DisplayClass6_0`1.<CombinePredicates>b__0(TSource x)
   � System.Linq.Enumerable.WhereListIterator`1.MoveNext()
   � System.Linq.Enumerable.<DistinctIterator>d__64`1.MoveNext()
   � System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   � System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   � Makaretu.Dns.Resolving.NameServer.AddAdditionalRecords(Message response)
   � Makaretu.Dns.Resolving.NameServer.AddAdditionalRecords(Message response)
   � Makaretu.Dns.Resolving.NameServer.AddAdditionalRecords(Message response)
   � Makaretu.Dns.Resolving.NameServer.<ResolveAsync>d__9.MoveNext()
--- Fin de la trace de la pile � partir de l'emplacement pr�c�dent au niveau duquel l'exception a �t� lev�e ---
   � System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   � System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   � Makaretu.Dns.Resolving.NameServer.<ResolveAsync>d__8.MoveNext()<---
@twofingerrightclick
Copy link

twofingerrightclick commented Jun 14, 2022

Si c'est toujours un problème pour toi, si te plait ajouter some sample code of how you are using the net-mdns library to give some context to the error messages.

@dittodhole
Copy link
Author

I am just calling Advertise and QueryUnicastServiceInstances. At some point, mentioned exception is thrown in the event handler.

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

2 participants