Bug 40237 - Inner Exception: Member 'ListViewItemCount' was not found
Summary: Inner Exception: Member 'ListViewItemCount' was not found
Status: NEW
Alias: None
Product: Components
Classification: Xamarin
Component: Xamarin Components ()
Version: Production (addons.xamarin.com)
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2016-04-08 12:03 UTC by John Bester
Modified: 2016-11-15 09:04 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

XenAdmin main project compile log (74.26 KB, text/x-log)
2016-04-08 12:03 UTC, John Bester
XenAdmin main project compile log (mono 4.5.1) (172.52 KB, text/x-log)
2016-06-02 14:13 UTC, John Bester

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 40237 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description John Bester 2016-04-08 12:03:01 UTC
Created attachment 15658 [details]
XenAdmin main project compile log

Operating system:    Ubuntu 14.04 i386
Mono version:        Mono JIT compiler version 4.2.3 (Stable
MonoDevelop version: 5.10

I am in the process of building XenAdmin project ( https://github.com/xenserver/xenadmin ) for Linux. I managed to download all the third part dependencies and configured in MonoDevelop. All of the library projects was able to build (at least for Debug target). Finally I tried to build the main project. There was no C# syntax or dependency problems, but one of the fixed and was able to successfully compile al the different dependency projects, but it seems like there is a dependency check done on Mono libraries that failed. The compiler reported 1 error and from the compiler output I could find this line that seems to be the culprit:

		Tool /usr/lib/mono/4.5/resgen.exe execution started with arguments: /useSourcePath /compile "Dialogs/ConfirmVMDeleteDialog.resx,obj/Release/XenAdmin.Dialogs.ConfirmVMDeleteDialog.resources" 
/usr/lib/mono/4.5/Microsoft.Common.targets: error : Tool exited with code: 1. Output: Error: Exception has been thrown by the target of an invocation.
Inner exception: Member 'ListViewItemCount' was not found.

I attached the full compiler log.
Comment 1 John Bester 2016-06-02 14:10:34 UTC
I have an update on the this bug. I have installed mono version 4.5.1 (f959605 / Thu Apr 28 2016). Now I get a System.NullReferenceException in the build of XenAdmin project. I tried to comment out all references to ListViewGroup (which occurs only in two .cs files), but it does not seem to solve the problem even on a rebuild of the project. I have attached a new log containing stack traces.
Comment 2 John Bester 2016-06-02 14:13:56 UTC
Created attachment 16173 [details]
XenAdmin main project compile log (mono 4.5.1)

The stack trace does seem to pinpoint the null reference quite clearly. Even thought the exception stack trace is listed several times, they seem to be the same (on a quick glance).
Comment 3 John Bester 2016-06-02 14:57:10 UTC
I had a look at the source - I hope I have the correct web page ( https://github.com/mono/linux-packaging-mono/blob/master/mcs/class/System.Windows.Forms/System.Windows.Forms/ListViewGroup.cs ) and I could spot a bug (although it might not be the cause of the exception). If you look at the "items" property, it is initialised by all but one (private) constructor. Yet there is no check ever to determine if it is null when it is used. I suggest that "private ListView.ListViewItemCollection items" is initialized in all constructors irrespective of constructor parameters.