Comments (4)
Is it only on .net6? Can you provide minimal snippet of code which cause this problem?
from deepcloner.
It's possible that it's in .Net 5 too, but it was exacerbated with .Net 6. QA says they've saw the SOAP issue since we implemented DeepCloner it just wasn't reproducible on demand like it was with .Net 6.
we were using it like this:
public static T? Clone(this T source)
{
return source == null ? default : source.DeepClone();
}
public static async Task<T?> CloneAsync(this T source)
{
return await Task.FromResult(source.Clone());
}
public static async Task<T?> CloneDataContractAsync(this T source)
{
return await Task.FromResult(source.CloneDataContract());
}
await sqlConnection.CloneAsync();
from deepcloner.
Please, do on clone SqlConnection object. DeepCloner will create not copy of connection, but copy of connection class. So, you'll have two simultaneous instances of one sql connection.
Moreover, SqlConnection uses native resources which impossible to clone (it's out of .NET). So, when you Dispose one connection and use second - the second one uses already released native resources and this causes Access Violation.
DeepCloner is intended to copy DTO objects without complex logic on it. Yes, it can be used to copy any complex structure, but behavior is undefined for this.
from deepcloner.
That makes sense. Thanks.
from deepcloner.
Related Issues (20)
- This exception is occasionally thrown in clones βmust be writeable (Parameter 'left')β HOT 4
- Request for info (country of origin) HOT 4
- HashSet contains method return false after deep clone HOT 8
- Support for cloning child to parent type HOT 2
- the program crashed when i deepclone opencvsahrp Mat HOT 3
- How to only clone the common properties? HOT 4
- Latest change has not been published to NuGet HOT 1
- Why version 0.X? HOT 3
- Exception: An instance of the __ComObject type cannot be created unless the type has been obtained using GetTypeFromProgID or GetTypeFromCLSID. HOT 4
- program crashed when deepclone multidimensional zero-length array HOT 1
- Dependency on BinaryFormatter? HOT 1
- When Object have navigation property, DeepClone throw exception. HOT 5
- Better error reporting HOT 1
- No stable cloning of `System.Drawing.Font` object HOT 6
- Memory corruption and program crash when cloning TaskCancelledException
- NHibernate Invalid cast exception
- Can't clone dictionary HOT 4
- Clone Action<T> delegate is incorrect
- Netstandard upgrade HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deepcloner.