c# - System.AccessViolationException on overridden abstract method -


One issue is why I have a problem, it took me a while but in the simplest case below After breaking, I also behave the following weird (for my eyes).

I have a base class:

  public abstract class was failed Sbsmitrbajh {public Asflsmitrbsejh (Pryoktaanupryogtokn Pryoktaanupryogtokn) {} public abstract Insent submitted (provider requests, Access.Central Services.CSS Services.Estinary Csitorinery, Cloned User Information Cloning User, Basket ITMTIM, CRMRSpons Sequence CRMRPS section, string CRMUSUN name, string CRMsupup user name); }  

A child example:

  public class CoreFailedSubmitter: FailedSubmitterBase {private string failed to post _emptyNarrativeString = "CS - Unspecified error"; Protected UserApplicationToken _userApplicationToken; Public Core File Assembler (UserAppsTitUserPropotToken): Base (UserApplicationsToken) {_userApplicationToken = userApplicationToken; } / ** / Public override integer ResubmitFailed (ProviderRequest request, Access.CentralServices.CSService.Itinerary csItinerary, ImpersonatedUserDetails impersonatedUser, BasketItem basketItem, CRMResponseDetails crmResponseDetails, string crmUsername, string crmSuperUsername) {return 0; }}  

When I call this as follows:

  CoreFailedSubmitter failedSubmitter = new CoreFailedSubmitter (_userApplicationToken); Return failed Submitter.ResubmitFailed (request, csItinerary, impersonatedUser, basketItem, crmResponseDetails, CRM username, crmSuperUsername);  

System.AccessViolationException : I often try to write this indicates

"to read or protect memory It is that the other memory is corrupt. "

I have repeated it on many machines (while debugging) so I do not believe this is a real memory problem.

I do not understand if I simply remove the abstract method, it works fine Example:

  public abstract class FailedSubmitterBase {public Asflःvisribej (UserApplicationToken userApplicationToken) {}} public class Korfailsbmitr failed Saubmitrbes {private string failed to post _emptyNarrativeString = "CS - unspecified error"; Protected UserApplicationToken _userApplicationToken; Public Core File Assembler (UserAppsTitUserPropotToken): Base (UserApplicationsToken) {_userApplicationToken = userApplicationToken; } / ** / public int ResubmitFailed (ProviderRequest request, Access.CentralServices.CSService.Itinerary csItinerary, ImpersonatedUserDetails impersonatedUser, BasketItem basketItem, CRMResponseDetails crmResponseDetails, string crmUsername, string crmSuperUsername) {return 0; }}  

Why does the abstract method cause failure with this exception? I can not see any reason for this What am I missing?

Update

By factoring my code again, I removed the abstract class and gave it a interface . This work Although for all objectives and purposes the interface and abstract class are doing the same thing. I can not really understand why this fails is the only thing that is out of me It stands for this class Access.CentralServices.CSService.Itinerary csItinerary . It's an auto generated SOAP class, but again, it's just a normal square, is not it really?

Some have corrupted memory, the reason is not that When you remove the intangible class, then there is no virtual call, so there is no indirect memory access (pointer) necessary

Now, what has your memory Has corrupted? By your description, always looking at the problem is reproducible, then it is deterministic. So whatever method you did to call the method, it would be my guess whether it was spoiling the memory or whatever you did in those sections or in order to build the objects of those sections:

< No access violation of the Safe CLR code, according to @ ur, on the comments you should see with care then you should see them with care; pre> UserApplicationToken ProviderRequest ImpersonatedUserDetails BasketItem CRMResponseDetails Should produce, so come either There is a possibility of CLR / compiler ( too many ) or one of those classes is the culprit you are using is another guideline: they are Tunkan and sorry for the original Win32 Will not call on libs, what they? Interop is similar to calling unsafe code.


Comments