Bug 1100 - python binding throws TargetInvocationException when creating a new project
Summary: python binding throws TargetInvocationException when creating a new project
Status: RESOLVED NOT_ON_ROADMAP
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Python Binding ()
Version: 2.6
Hardware: PC Linux
: Low normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2011-09-28 09:52 UTC by Nicklas Overgaard
Modified: 2014-02-17 15:12 UTC (History)
3 users (show)

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


Attachments
Fix for python-2.7 (1.03 KB, patch)
2011-10-12 17:39 UTC, Nathan Ehresmann
Details


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 on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NOT_ON_ROADMAP

Description Nicklas Overgaard 2011-09-28 09:52:33 UTC
When i create a new empty python project, the following exception is thrown:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object
  at PyBinding.PythonSite..ctor (IPythonRuntime runtime) [0x0000d] in /home/nover/packages/monodevelop-python/src/monodevelop-python-2.6/PyBinding/PyBinding/PythonSite.cs:50 
  at PyBinding.Gui.PythonEditorCompletion.Initialize () [0x00032] in /home/nover/packages/monodevelop-python/src/monodevelop-python-2.6/PyBinding/PyBinding.Gui/PythonEditorCompletion.cs:58 
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.Initialize (MonoDevelop.Ide.Gui.Document document) [0x00007] in /build/src/monodevelop-2.6/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:49 
  at MonoDevelop.Ide.Gui.Document.OnDocumentAttached () [0x00135] in /build/src/monodevelop-2.6/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs:553 
  at MonoDevelop.Ide.Gui.Workbench.WrapDocument (IWorkbenchWindow window) [0x0004f] in /build/src/monodevelop-2.6/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:565 
  at MonoDevelop.Ide.Gui.ViewCommandHandlers..ctor (IWorkbenchWindow window) [0x0000d] in /build/src/monodevelop-2.6/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewCommandHandlers.cs:49 
  at MonoDevelop.Ide.Gui.SdiWorkspaceWindow..ctor (MonoDevelop.Ide.Gui.DefaultWorkbench workbench, IViewContent content, Gtk.Notebook tabControl, MonoDevelop.Components.TabLabel tabLabel) [0x0011c] in /build/src/monodevelop-2.6/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs:98 
  at MonoDevelop.Ide.Gui.DefaultWorkbench.ShowView (IViewContent content, Boolean bringToFront) [0x00113] in /build/src/monodevelop-2.6/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs:379 
  at MonoDevelop.Ide.Gui.LoadFileWrapper.Invoke (System.String fileName) [0x0017b] in /build/src/monodevelop-2.6/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:1058 
  at MonoDevelop.Ide.Gui.Workbench.RealOpenFile (MonoDevelop.Ide.Gui.FileOpenInformation openFileInfo) [0x00387] in /build/src/monodevelop-2.6/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:745 
  at MonoDevelop.Ide.Gui.Workbench.OpenDocument (FilePath fileName, Int32 line, Int32 column, OpenDocumentOptions options, System.String encoding, IViewDisplayBinding binding) [0x001c4] in /build/src/monodevelop-2.6/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:381 
  at MonoDevelop.Ide.Gui.Workbench.OpenDocument (FilePath fileName, OpenDocumentOptions options) [0x00000] in /build/src/monodevelop-2.6/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:312 
  at MonoDevelop.Ide.Templates.ProjectTemplate.OpenCreatedSolution () [0x0003b] in /build/src/monodevelop-2.6/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectTemplate.cs:226 
  at MonoDevelop.Ide.Projects.NewProjectDialog.OpenEvent (System.Object sender, System.EventArgs e) [0x00206] in /build/src/monodevelop-2.6/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewProjectDialog.cs:369 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,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) [0x000d5] in /build/src/mono-2.10.5/mcs/class/corlib/System.Reflection/MonoMethod.cs:226 
  --- 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) [0x000eb] in /build/src/mono-2.10.5/mcs/class/corlib/System.Reflection/MonoMethod.cs:234 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /build/src/mono-2.10.5/mcs/class/corlib/System.Reflection/MethodBase.cs:96 
  at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x000bf] in /build/src/mono-2.10.5/mcs/class/corlib/System/Delegate.cs:408 
  at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00018] in /build/src/mono-2.10.5/mcs/class/corlib/System/MulticastDelegate.cs:70 
  at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in /build/src/mono-2.10.5/mcs/class/corlib/System/Delegate.cs:382 
  at GLib.Signal.ClosureInvokedCB (System.Object o, GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0 
  at GLib.SignalClosure.Invoke (GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0 
  at GLib.SignalClosure.MarshalCallback (IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data) [0x00000] in <filename unknown>:0 

Two times. After this, the project pad and everything is shown. However, when i try and double-click on the main.py file that is generated, nothing happens.

If i close monodevelop, open i again and then open the new solution, the same exception is thrown when trying to access the files.

I'm on ArchLinux, mono 2.10.5 and python 3.2.
Comment 1 Nathan Ehresmann 2011-10-11 18:59:35 UTC
I'm also getting the same exception when creating a new python project.

I'm using mono-2.10.2, monodevelop-2.8, and monodevelop-python-2.8 on Gentoo.

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object
  at PyBinding.PythonSite..ctor (IPythonRuntime runtime) [0x0000d] in /var/tmp/portage/dev-util/monodevelop-python-2.8/work/monodevelop-python-2.8/PyBinding/PyBinding/PythonSite.cs:50 
  at PyBinding.Gui.PythonEditorCompletion.Initialize () [0x00032] in /var/tmp/portage/dev-util/monodevelop-python-2.8/work/monodevelop-python-2.8/PyBinding/PyBinding.Gui/PythonEditorCompletion.cs:58 
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.Initialize (MonoDevelop.Ide.Gui.Document document) [0x00007] in /var/tmp/portage/dev-util/monodevelop-2.8/work/monodevelop-2.8/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:49 
  at MonoDevelop.Ide.Gui.Document.OnDocumentAttached () [0x00135] in /var/tmp/portage/dev-util/monodevelop-2.8/work/monodevelop-2.8/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs:577 
  at MonoDevelop.Ide.Gui.Workbench.WrapDocument (IWorkbenchWindow window) [0x0004f] in /var/tmp/portage/dev-util/monodevelop-2.8/work/monodevelop-2.8/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:568 
  at MonoDevelop.Ide.Gui.ViewCommandHandlers..ctor (IWorkbenchWindow window) [0x0000d] in /var/tmp/portage/dev-util/monodevelop-2.8/work/monodevelop-2.8/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewCommandHandlers.cs:49 
  at MonoDevelop.Ide.Gui.SdiWorkspaceWindow..ctor (MonoDevelop.Ide.Gui.DefaultWorkbench workbench, IViewContent content, Gtk.Notebook tabControl, MonoDevelop.Components.TabLabel tabLabel) [0x0011c] in /var/tmp/portage/dev-util/monodevelop-2.8/work/monodevelop-2.8/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs:98 
  at MonoDevelop.Ide.Gui.DefaultWorkbench.ShowView (IViewContent content, Boolean bringToFront) [0x00113] in /var/tmp/portage/dev-util/monodevelop-2.8/work/monodevelop-2.8/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs:379 
  at MonoDevelop.Ide.Gui.LoadFileWrapper.Invoke (System.String fileName) [0x001d6] in /var/tmp/portage/dev-util/monodevelop-2.8/work/monodevelop-2.8/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:1069 
  at MonoDevelop.Ide.Gui.Workbench.RealOpenFile (MonoDevelop.Ide.Gui.FileOpenInformation openFileInfo) [0x00387] in /var/tmp/portage/dev-util/monodevelop-2.8/work/monodevelop-2.8/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:748 
  at MonoDevelop.Ide.Gui.Workbench.OpenDocument (FilePath fileName, Int32 line, Int32 column, OpenDocumentOptions options, System.String encoding, IViewDisplayBinding binding) [0x001cf] in /var/tmp/portage/dev-util/monodevelop-2.8/work/monodevelop-2.8/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:382 
  at MonoDevelop.Ide.Gui.Workbench.OpenDocument (FilePath fileName, OpenDocumentOptions options) [0x00000] in /var/tmp/portage/dev-util/monodevelop-2.8/work/monodevelop-2.8/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:312 
  at MonoDevelop.Ide.Templates.ProjectTemplate.OpenCreatedSolution () [0x0003b] in /var/tmp/portage/dev-util/monodevelop-2.8/work/monodevelop-2.8/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectTemplate.cs:226 
  at MonoDevelop.Ide.Projects.NewProjectDialog.OpenEvent (System.Object sender, System.EventArgs e) [0x00206] in /var/tmp/portage/dev-util/monodevelop-2.8/work/monodevelop-2.8/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewProjectDialog.cs:369 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,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) [0x000d5] in /var/tmp/portage/dev-lang/mono-2.10.2-r1/work/mono-2.10.2/mcs/class/corlib/System.Reflection/MonoMethod.cs:226 
  --- 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) [0x000eb] in /var/tmp/portage/dev-lang/mono-2.10.2-r1/work/mono-2.10.2/mcs/class/corlib/System.Reflection/MonoMethod.cs:234 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /var/tmp/portage/dev-lang/mono-2.10.2-r1/work/mono-2.10.2/mcs/class/corlib/System.Reflection/MethodBase.cs:96 
  at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x000bf] in /var/tmp/portage/dev-lang/mono-2.10.2-r1/work/mono-2.10.2/mcs/class/corlib/System/Delegate.cs:408 
  at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00018] in /var/tmp/portage/dev-lang/mono-2.10.2-r1/work/mono-2.10.2/mcs/class/corlib/System/MulticastDelegate.cs:70 
  at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in /var/tmp/portage/dev-lang/mono-2.10.2-r1/work/mono-2.10.2/mcs/class/corlib/System/Delegate.cs:382 
  at GLib.Signal.ClosureInvokedCB (System.Object o, GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0 
  at GLib.SignalClosure.Invoke (GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0 
  at GLib.SignalClosure.MarshalCallback (IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data) [0x00000] in <filename unknown>:0
Comment 2 Nathan Ehresmann 2011-10-11 19:01:44 UTC
I forgot to mention, I'm using python-2.7.1.
Comment 3 Shanto 2011-10-12 03:32:57 UTC
Similar exceptions here on Arch Linux. http://pastie.org/2681403

Related Packages:
mono 2.10.5-1
mono-addins 0.6.2-1
mono-debugger 2.10-1
monodevelop 2.8-1
monodevelop-debugger-gdb 2.8-1
monodevelop-debugger-mdb 2.4-1
monodevelop-python 2.8-1
mono-tools 2.10-1
mono-zeroconf 0.9.0-2
python 3.2.2-1
python2 2.7.2-2
Comment 4 Nathan Ehresmann 2011-10-12 17:39:44 UTC
Created attachment 685 [details]
Fix for python-2.7

I have looked through the code a bit, and this patch fixes the exception when using python-2.7, but I'm not sure if the patch is providing the same functionality as with previous versions of python. Code completion for one isn't working on my machine.
Comment 5 Lluis Sanchez 2014-02-17 15:12:52 UTC
We don't support this binding anymore.