Click here to Skip to main content
15,867,955 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
We are about to migrate to later version of Dotnet Framework(from 3.5 to 4.0)
But when we try to run SqlXML command such as ExecuteStream
we are getting an error which is follwed below

C#
dbCmd.ExecuteStream()' threw an exception of type 'System.AccessViolationException' System.IO.Stream {System.AccessViolationException}


What I have tried:

I have just build my solution with new framework version which is getting that error
Posted
Updated 2-May-16 5:35am
v2

1 solution

See the answer by villecoder on this post - c# - How to handle AccessViolationException - Stack Overflow[^]
Quote:
In .NET 4.0, the runtime handles certain exceptions raised as Windows Structured Error Handling (SEH) errors as indicators of Corrupted State.

In particular that response directs to this article - CLR Inside Out - Handling Corrupted State Exceptions[^]
Quote:
In version 4 and later, the CLR exception system will not deliver CSEs to managed code unless the code has expressly indicated that it can handle process corrupted state exceptions.
 
Share this answer
 
Comments
KUMAR619 2-May-16 11:37am    
How to get rid of this issue.
Can you briefly explain please
CHill60 2-May-16 11:38am    
If you follow the first link you will find ways of dealing with the issue

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900