Search This Blog

Monday, February 26, 2018

AccessViolationException at Microsoft.VisualStudio.Shell.Interop.IVsRegisterEditors.UnregisterEditor may occur in Visual Studio 2010, 2012


This sporadic design time error might go away in Visual Studio 2013, 2015, 2017 and newer.

Exception

Type:
 System.AccessViolationException
Message:
 Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
StackTrace:
   Microsoft.VisualStudio.Shell.Interop.IVsRegisterEditors.UnregisterEditor(UInt32 dwCookie)
   Microsoft.VisualStudio.Shell.Package.Dispose(Boolean disposing)
   DevExpress.ExpressApp.Design.Core.XAFPackageV4.Dispose(Boolean disposing)
   Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsPackage.Close()



We have been tracking this error for years from XAF users using https://logify.devexpress.com. We also received a few tickets, but could never replicate this behavior for debugging. Our attempts to log diagnostic information about this error did not help either. Well, it does not seem to relate to the DevExpress.ExpressApp.Design.Core.XAFPackageV4.Dispose method itself. There are also many non-XAF reports devoted to the same error, but different packages on the Web. https://www.google.com/search?q=Microsoft.VisualStudio.Shell.Interop.IVsRegisterEditors.UnregisterEditor+accessviolationexception

From the Logify stats, we know that this error occurs only with these two old Visual Studio versions. It seems that something got fixed in newer IDE versions. If you are on Visual Studio 2010 or 2012 and encountered this error at design time, consider upgrading your IDE - it's 2018 after all:-)







No comments:

Post a Comment