MonoDevelop fails to package with error

Hello everyone. I am brand new to openSUSE (coming from Fedora then Kubuntu then Linux Mint) and I must say I am very impressed. Unfortunately I am also a C# developer and I need Mono (and more specifically MonoDevelop) to function correctly.

I installed MonoDevelop from YaST and started with the simple “Hello World” command line project that is included by default. I then added Tarball packaging to the solution and attempted to build the package. It spit out the following error:

“Package creation failed. Object reference not set to an instance of an object”

I then tried double clicking on the Tarball package in the solution and it gave me an Unhandled Exception error dialog with a stack trace.

Does anyone know what could be causing this problem? It’s as if I am missing a required package or something. I have tried to install automake but that didn’t change anything.

Any ideas would be very much appreciated! Thanks.

I am not absolutely sure because I cannot reproduce this behaviour:

Can you check if
autoconf, automake, make and tar are installed?

Which opensuse version are you using and which monodevelop version?

Thank you for your quick response.

I am running openSUSE 11.2 and MonoDevelop 2.0.

I had all of those installed already and even tried installing autoconf213 and cmake just in case but nothing worked.

Here is the stack trace from when I double click on the package in the solution:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.ArgumentNullException: Argument cannot be null.
Parameter name: key
at System.Collections.Generic.Dictionary`2[MonoDevelop.Projects.SolutionItem,MonoDevelop.Projects.SolutionItem].set_Item (MonoDevelop.Projects.SolutionItem key, MonoDevelop.Projects.SolutionItem value) [0x00000]
at MonoDevelop.Deployment.Gui.EntrySelectionTree.SetSelection (MonoDevelop.Projects.SolutionItem rootEntry, MonoDevelop.Projects.SolutionItem] childEntries) [0x00000]
at MonoDevelop.Deployment.Gui.EditPackageDialog…ctor (MonoDevelop.Deployment.Package package) [0x00000]
at MonoDevelop.Deployment.Gui.DeployOperations.ShowPackageSettings (MonoDevelop.Deployment.Package package) [0x00000]
at MonoDevelop.Deployment.NodeBuilders.PackageNodeCommandHandler.ActivateItem () [0x00000]
at MonoDevelop.Ide.Gui.Components.NodeCommandHandler.ActivateMultipleItems () [0x00000]
at MonoDevelop.Ide.Gui.Components.ExtensibleTreeView.ActivateCurrentItem () [0x00000]
at MonoDevelop.Ide.Gui.Components.ExtensibleTreeView.OnNodeActivated (System.Object sender, Gtk.RowActivatedArgs args) [0x00000]
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object] parameters, System.Globalization.CultureInfo culture) [0x00000]
— End of inner exception stack trace —
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object] parameters, System.Globalization.CultureInfo culture) [0x00000]
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object] parameters) [0x00000]
at System.Delegate.DynamicInvokeImpl (System.Object] args) [0x00000]
at System.MulticastDelegate.DynamicInvokeImpl (System.Object] args) [0x00000]
at System.Delegate.DynamicInvoke (System.Object] args) [0x00000]
at GLib.Signal.ClosureInvokedCB (System.Object o, GLib.ClosureInvokedArgs args) [0x00000]
at GLib.SignalClosure.Invoke (GLib.ClosureInvokedArgs args) [0x00000]
at GLib.SignalClosure.MarshalCallback (IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data) [0x00000]

To me it looks like your mono/monodevelop installation is somehow broken.

But lets start with small steps to find out, first of all you cannot expect
that your package contains anything usfull since you wrote that the package
creation itself failed.

“Package creation failed. Object reference not set to an instance of an
object”

So it does not help to look at the error message you receive by opening a
corrupt package.

As far as I understood you did the following.

Started monodevelop

Created a new project and chose to create a terminal application (C# or
VBnet?)

When a new project comes up which contains a simple “hello world” template

Did you try to compile it simply as first step?
Did you try to execute it in monodevolp?

What happens if you do this, what is shown in the console window (right
bottom by default) as output when you compile (success or some weird
errors).

If there are errors please post the complete output (not only the last
line).

When you choose “Project -> Create package” from the menu (what do you
choose in the wizard? source package or binary) does the error that the
cration failed appear now in the console window?

Can you post the complete trace?

What you did not mention is(or I missed it): Where do you double click on
the resulting package (on the same opensuse machine or on another windows
machine), since you double click I guess you use gnmoe not kde (but this
should be unrelated to your problem).

So the most important question is to find where happens the very first
problem (compiling or packaging process).

And least just to be sure that your installation is correct:

Open a terminal and type

zypper verify

what does it show?

Hi sorry if I wasn’t clear. What I mean by ‘opening the package’ is double clicking on a packaging project that I added to the solution when I first created the file.

You are correct with your assumption that I created a new C# console project and it does compile and display “hello world” inside of the MonoDevelop console without any errors.

From Project > Create Package I clicked Tarball and then chose Autotools based Makefile. Here is the output from that:

---------OUTPUT START---------

Creating packages

Package: Tarball

Building: HelloWorldTest (Debug)

Building Solution HelloWorldTest

Building: HelloWorldTest (Debug)
Performing main compilation…
/usr/bin/gmcs “/out:/tmp/mdTmpDir1588511654/HelloWorldTest/bin/Debug/HelloWorldTest.exe” “/r:System.dll” /noconfig /nologo /warn:4 /debug:+ /debug:full /optimize- /codepage:utf8 /define:“DEBUG” /t:exe “/tmp/mdTmpDir1588511654/HelloWorldTest/Main.cs” “/tmp/mdTmpDir1588511654/HelloWorldTest/AssemblyInfo.cs”
Build complete – 0 errors, 0 warnings

Generating Autotools files for Solution HelloWorldTest

Creating Makefile.am for Solution HelloWorldTest

Creating Makefile.am for Project HelloWorldTest
Creating autogen.sh
Creating configure.ac
Creating Makefile.include
Adding variables to top-level Makefile

Deploying Solution to Tarball
I am going to run ./configure with no arguments - if you wish
to pass any to it, please specify them on the autogen.sh command line.
Running aclocal -I . …
Running automake --gnu …
configure.ac:5: installing ./install-sh' configure.ac:5: installing ./missing’
Running autoconf …
Running ./configure …
checking for a BSD-compatible install… /usr/bin/install -c
checking whether build environment is sane… yes
checking for a thread-safe mkdir -p… /bin/mkdir -p
checking for gawk… gawk
checking whether make sets $(MAKE)… yes
checking whether to enable maintainer-specific portions of Makefiles… yes
checking for pkg-config… /usr/bin/pkg-config
checking for a BSD-compatible install… /usr/bin/install -c
checking for gmcs… /usr/bin/gmcs
configure: creating ./config.status
config.status: creating HelloWorldTest/helloworldtest
config.status: creating HelloWorldTest/Makefile
config.status: creating Makefile
{ test ! -d “helloworldtest-0.1” || { find “helloworldtest-0.1” -type d ! -perm -200 -exec chmod u+w {} ‘;’ && rm -fr “helloworldtest-0.1”; }; }
test -d “helloworldtest-0.1” || mkdir “helloworldtest-0.1”
(cd HelloWorldTest && /usr/bin/make top_distdir=…/helloworldtest-0.1 distdir=…/helloworldtest-0.1/HelloWorldTest
am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[1]: Entering directory /tmp/mdTmpDir1588511654/HelloWorldTest' make[1]: Leaving directory /tmp/mdTmpDir1588511654/HelloWorldTest’
test -n “”
|| find “helloworldtest-0.1” -type d ! -perm -777 -exec chmod a+rwx {} ; -o
! -type d ! -perm -444 -links 1 -exec chmod a+r {} ; -o
! -type d ! -perm -400 -exec chmod a+r {} ; -o
! -type d ! -perm -444 -exec /bin/sh /tmp/mdTmpDir1588511654/install-sh -c -m a+r {} {} ;
|| chmod -R a+r “helloworldtest-0.1”
tardir=helloworldtest-0.1 && /bin/sh /tmp/mdTmpDir1588511654/missing --run tar chof - “$tardir” | GZIP=–best gzip -c >helloworldtest-0.1.tar.gz
{ test ! -d “helloworldtest-0.1” || { find “helloworldtest-0.1” -type d ! -perm -200 -exec chmod u+w {} ‘;’ && rm -fr “helloworldtest-0.1”; }; }

Autotools files were successfully generated.
Solution was succesfully deployed

---------OUTPUT END---------

In regards to where I double click the package: because I adding a packaging project to the solution (to make it easier to build the package) I am actually double clicking on it within the solution explorer of MonoDevelop. I am running KDE 4.3.5.

When I built the above package (not using the solution package project but rather through the Project → Package file menu) I was able to run “./configure && make && make install” without errors. However as part of the project I was also trying to test unix integration and as such had adding a .desktop file. I set this file to be installed in the Games menu and checked include it deploy, however after running the above line the program is installed but no menu entry exists… am I missing something?

Thanks a lot for all of your help!

---------OUTPUT END---------

Fine so far there is at least some success :slight_smile:

About the question with the desktop file, I never used this so I am afraid I
cannot help you with this.

Did you open the package from dolphin to look into it and checked if the
…desktop is included in it?

I would post this problem with the .desktop file in the opensuse
programming-scripting forum
http://forums.opensuse.org/programming-scripting/

I am sure someone there can help you with that.

Hmm the tarball doesn’t seem to contain the .desktop file but I had always assumed that it was created during the installation process.

In any event thank you so much for your help. I still don’t know what’s causing my packaging project to fail but at least there is a work around.

I will check with the programming-scripting forum for my last problem. Thanks again!

I was able to reproduce your packaging problem in a fresh system (in
vmware).

Adding a package project to an existing project (with some kind of hello
world) resulted in the error you noticed when building the package.

Then I right clicked the project “tarball” an error message occured before
the properties dialog opened, I clicked “ok” to the error message and then
clicked through the dialog and set what I wanted but could not save it.
Clicked cancel in the properties dialog.

After that the package project automagically was able to compile and again
rght clicking on the project and open its property dialog worked without any
error.

Seems to be simply a bug in the monodevelop 2.0 gui.

I will check that again and check also if ther is a known bug for this in
the mono project and file a bug report otherwise.