Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Loader Lock error with VB.NET 2008 (Windows XP only?)

When I run my application (WPF,VB.net 2008) on Windows XP, I get weird Windows Errors. When I installed VS2008 on the machines that got the error and debug. I got a loader lock exception, so I went into Debug and removed it. However, I still get the error when it is installed on the machine.

Is there a way to remove the Loader Lock Exception when the application is install. I do understands that it might not be the best solution, but it seems this happen only when I start an WindowsElementHost with a ReportViewer and this is causing the problem, so I don't really know what else to do with it.

All version of XP have that problem, as with 2003.

In Windows 7 and Vista I never run into that error while debugging and the installed product. The same thing applies with 2008 and 2008R2.

like image 577
David Brunelle Avatar asked Jun 23 '12 03:06

David Brunelle


1 Answers

I've done a little bit of research and below you can find my guesses:

  • maybe it's a bug in the Report Viewer control itself and you should update to a later version. I've noticed that on December 2012 a new version was released (see this post), supposedly running on both .NET 3.5 and 4.0 (so it should work with VB 2008, see download page);
  • I've noticed that Report Viewer 2008 SP1 requires .NET 3.5 SP1 (see the download page) -- maybe an outdated version can trigger the exception you are seeing;
  • maybe Windows XP is not updated to the latest Service Pack or is the wrong edition -- again Report Viewer 2010 SP1 requires Windows XP SP3 (see download page) and Report Viewer 2012 does not run on Windows XP Starter Edition;
  • maybe it's a library used by Report Viewer that causes this exception (especially a mixed mode assembly) -- a dump or a stack trace would be helpful in this sense;
  • there is a comprehensive answer in this thread in the Visual Studio Tools for Office forum that lists several resources to understand this problem;
  • the previous link suggests that in some conditions it's safe to ignore this lock. If from your testing under Visual Studio with Loader Lock MDA disabled you see that there is no problem, you can disable the MDA in production machines using the instructions in this blog post -- basically it involves setting an environment variable and adding some lines to the app.config file (see also the documentation for Loader Lock MDA to see what the new lines should look like). I haven't tried it but I thought it may be useful for you as a last resort solution -- just be sure to test thoroughly your application to avoid undesired side effects.

To get more help, I suggest you so specify:

  • the version of Report Viewer you are using;
  • the version of .NET Framework you are targeting (in particular including Service Pack);
  • what Service Pack is installed for Windows XP;
  • any stack trace or debugging information you can gather.
like image 191
edymtt Avatar answered Oct 31 '22 16:10

edymtt