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

Common Language Runtime detected an invalid program net6.0 #23

Open
RussellMcDonnell opened this issue Feb 25, 2022 · 2 comments
Open

Comments

@RussellMcDonnell
Copy link

I have a series of tests that I run and build against net6.0, net5.0 and netcoreapp3.1 but DeepCopy is only failing on net6.0

This issue seems to be around trying to copy an IEnumerable or an object that contains an IEnumerable.

Message: 
System.InvalidProgramException : Common Language Runtime detected an invalid program.

Stack Trace: 
EnumeratorDeepCopier(Enumerator , CopyContext )
SelectListIterator2DeepCopier(IEnumerable1 , CopyContext )
CopierGenerator`1.Copy(T original, CopyContext context)
DeepCopier.Copy[T](T original)
Tokenizer.TokenizeAsync[T](T objectWithSensitiveData)
TokenizerTests.Tokenize_IEnumberableObject() line 151
--- End of stack trace from previous location ---

@ReubenBond
Copy link
Owner

Hi Russell, this package is not supported and hasn't been updated in a long time. I'm not sure what the issue might be, but perhaps there were some IL changes in .NET 6.0

@lofcz
Copy link

lofcz commented Jan 8, 2025

For .NET 8+ I'm maintaining FastCloner which has a similar API and is extensively tested on various collections, dictionaries and sets are specifically tricky since they can be read-only, hashcodes need to be preserved, some collections expose TryAdd instead of Add et cetera.

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