Archive

Posts Tagged ‘Monodevelop’

All the Monodevelop 2.4 Issues im having

May 27, 2010 Leave a comment

Warn – 19:51:44 – Pango-Warning: couldn’t load font “Mono Bold Not-Rotated 10”, falling back to “Sans Bold Not-Rotated 10”, expect ugly output.
Stack trace:
at Pango.Layout.GetPixelSize(Int32 ByRef width, Int32 ByRef height)
at Mono.TextEditor.TextViewMargin.OptionsChanged() in /Users/michael/mono/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/TextViewMargin.cs:line 410
at Mono.TextEditor.TextEditor.OptionsChanged(System.Object sender, System.EventArgs args) in /Users/michael/mono/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditor.cs:line 552
at Mono.TextEditor.TextEditor.OnRealized() in /Users/michael/mono/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditor.cs:line 509
at Gtk.Widget.realized_cb(IntPtr widget)
at Gtk.Box.gtk_box_pack_start(IntPtr , IntPtr , Boolean , Boolean , UInt32 )
at Gtk.Box.PackStart(Gtk.Widget child, Boolean expand, Boolean fill, UInt32 padding)
at MonoDevelop.Ide.Gui.Dialogs.OptionsDialog.ShowPage(MonoDevelop.Ide.Extensions.OptionsDialogSection section) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsDialog.cs:line 330
at MonoDevelop.Ide.Gui.Dialogs.OptionsDialog.OnSelectionChanged(System.Object s, System.EventArgs a) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsDialog.cs:line 294
at System.Reflection.MonoMethod.InternalInvoke(System.Object , System.Object[] , System.Exception ByRef )
at System.Reflection.MonoMethod.Invoke(System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
at System.Reflection.MethodBase.Invoke(System.Object obj, System.Object[] parameters)
at System.Delegate.DynamicInvokeImpl(System.Object[] args)
at System.MulticastDelegate.DynamicInvokeImpl(System.Object[] args)
at System.Delegate.DynamicInvoke(System.Object[] args)
at GLib.Signal.ClosureInvokedCB(System.Object o, GLib.ClosureInvokedArgs args)
at GLib.SignalClosure.Invoke(GLib.ClosureInvokedArgs args)
at GLib.SignalClosure.MarshalCallback(IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data)
at Gtk.Dialog.gtk_dialog_run(IntPtr )
at Gtk.Dialog.Run()
at MonoDevelop.Ide.MessageService.RunCustomDialog(Gtk.Dialog dialog, Gtk.Window parent) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/MessageService.cs:line 287
at MonoDevelop.Ide.Gui.Workbench.ShowGlobalPreferencesDialog(Gtk.Window parentWindow, System.String panelId) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:line 500
at MonoDevelop.Ide.Gui.Workbench.ShowGlobalPreferencesDialog(Gtk.Window parentWindow) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:line 483
at MonoDevelop.Ide.Commands.MonodevelopPreferencesHandler.Run() in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/EditCommands.cs:line 79
at MonoDevelop.Components.Commands.CommandHandler.Run(System.Object dataItem) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandHandler.cs:line 61
at MonoDevelop.Components.Commands.CommandHandler.InternalRun(System.Object dataItem) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandHandler.cs:line 42
at MonoDevelop.Components.Commands.ActionCommand.DispatchCommand(System.Object dataItem) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/ActionCommand.cs:line 110
at MonoDevelop.Components.Commands.CommandManager.DispatchCommand(System.Object commandId, System.Object dataItem, System.Object initialTarget, CommandSource source) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:line 597
at MonoDevelop.Components.Commands.CommandManager.DispatchCommand(System.Object commandId, CommandSource source) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:line 490
at OSXIntegration.OSXMenu+c__AnonStorey6.m__10(System.Object , System.EventArgs ) in /Users/michael/mono/monodevelop/main/src/addins/MacPlatform/Menus/OSXMenu.cs:line 644
at Gtk.Application+InvokeCB.Invoke()
at GLib.Timeout+TimeoutProxy.Handler()
at Gtk.Application.gtk_main()
at Gtk.Application.Run()
at MonoDevelop.Ide.IdeApp.Run() in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs:line 383
at MonoDevelop.Ide.IdeStartup.Run(System.String[] args) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:line 257
at MonoDevelop.Startup.MonoDevelopMain.Main(System.String[] args) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Startup/MonoDevelop.Startup/MonoDevelopMain.cs:line 24
Warn – 19:51:44 – Pango-Warning: couldn’t load font “Mono Not-Rotated 10”, falling back to “Sans Not-Rotated 10”, expect ugly output.
Stack trace:
at Pango.Layout.GetSize(Int32 ByRef width, Int32 ByRef height)
at Mono.TextEditor.TextViewMargin.OptionsChanged() in /Users/michael/mono/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/TextViewMargin.cs:line 446
at Mono.TextEditor.TextEditor.OptionsChanged(System.Object sender, System.EventArgs args) in /Users/michael/mono/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditor.cs:line 552
at Mono.TextEditor.TextEditor.OnRealized() in /Users/michael/mono/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditor.cs:line 509
at Gtk.Widget.realized_cb(IntPtr widget)
at Gtk.Box.gtk_box_pack_start(IntPtr , IntPtr , Boolean , Boolean , UInt32 )
at Gtk.Box.PackStart(Gtk.Widget child, Boolean expand, Boolean fill, UInt32 padding)
at MonoDevelop.Ide.Gui.Dialogs.OptionsDialog.ShowPage(MonoDevelop.Ide.Extensions.OptionsDialogSection section) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsDialog.cs:line 330
at MonoDevelop.Ide.Gui.Dialogs.OptionsDialog.OnSelectionChanged(System.Object s, System.EventArgs a) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsDialog.cs:line 294
at System.Reflection.MonoMethod.InternalInvoke(System.Object , System.Object[] , System.Exception ByRef )
at System.Reflection.MonoMethod.Invoke(System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
at System.Reflection.MethodBase.Invoke(System.Object obj, System.Object[] parameters)
at System.Delegate.DynamicInvokeImpl(System.Object[] args)
at System.MulticastDelegate.DynamicInvokeImpl(System.Object[] args)
at System.Delegate.DynamicInvoke(System.Object[] args)
at GLib.Signal.ClosureInvokedCB(System.Object o, GLib.ClosureInvokedArgs args)
at GLib.SignalClosure.Invoke(GLib.ClosureInvokedArgs args)
at GLib.SignalClosure.MarshalCallback(IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data)
at Gtk.Dialog.gtk_dialog_run(IntPtr )
at Gtk.Dialog.Run()
at MonoDevelop.Ide.MessageService.RunCustomDialog(Gtk.Dialog dialog, Gtk.Window parent) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/MessageService.cs:line 287
at MonoDevelop.Ide.Gui.Workbench.ShowGlobalPreferencesDialog(Gtk.Window parentWindow, System.String panelId) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:line 500
at MonoDevelop.Ide.Gui.Workbench.ShowGlobalPreferencesDialog(Gtk.Window parentWindow) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:line 483
at MonoDevelop.Ide.Commands.MonodevelopPreferencesHandler.Run() in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/EditCommands.cs:line 79
at MonoDevelop.Components.Commands.CommandHandler.Run(System.Object dataItem) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandHandler.cs:line 61
at MonoDevelop.Components.Commands.CommandHandler.InternalRun(System.Object dataItem) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandHandler.cs:line 42
at MonoDevelop.Components.Commands.ActionCommand.DispatchCommand(System.Object dataItem) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/ActionCommand.cs:line 110
at MonoDevelop.Components.Commands.CommandManager.DispatchCommand(System.Object commandId, System.Object dataItem, System.Object initialTarget, CommandSource source) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:line 597
at MonoDevelop.Components.Commands.CommandManager.DispatchCommand(System.Object commandId, CommandSource source) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:line 490
at OSXIntegration.OSXMenu+c__AnonStorey6.m__10(System.Object , System.EventArgs ) in /Users/michael/mono/monodevelop/main/src/addins/MacPlatform/Menus/OSXMenu.cs:line 644
at Gtk.Application+InvokeCB.Invoke()
at GLib.Timeout+TimeoutProxy.Handler()
at Gtk.Application.gtk_main()
at Gtk.Application.Run()
at MonoDevelop.Ide.IdeApp.Run() in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs:line 383
at MonoDevelop.Ide.IdeStartup.Run(System.String[] args) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:line 257
at MonoDevelop.Startup.MonoDevelopMain.Main(System.String[] args) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Startup/MonoDevelop.Startup/MonoDevelopMain.cs:line 24
Error – 19:50:34 – Did not find resource ‘workspace-new-16.png’ in addin ‘MonoDevelop.Ide’ for icon ‘md-new-workspace’
Error – 19:48:16 – Gtk-Critical: gtk_window_realize_icon: assertion `info->icon_pixmap == NULL’ failed
Stack trace:
at Gtk.Widget.Realize()
at MonoDevelop.Ide.Gui.Workbench.Show(System.String workbenchMemento) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:line 108
at MonoDevelop.Ide.IdeApp.Initialize(IProgressMonitor monitor) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs:line 179
at MonoDevelop.Ide.IdeStartup.Run(System.String[] args) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:line 215
at MonoDevelop.Startup.MonoDevelopMain.Main(System.String[] args) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Startup/MonoDevelop.Startup/MonoDevelopMain.cs:line 24
Error – 19:48:15 – GdkPixbuf-Critical: gdk_pixbuf_composite: assertion `dest_x >= 0 && dest_x + dest_width width’ failed
Stack trace:
at Gdk.Pixbuf.Composite(Gdk.Pixbuf dest, Int32 dest_x, Int32 dest_y, Int32 dest_width, Int32 dest_height, Double offset_x, Double offset_y, Double scale_x, Double scale_y, InterpType interp_type, Int32 overall_alpha)
at MonoDevelop.Ide.ImageService.MergeIcons(Gdk.Pixbuf icon1, Gdk.Pixbuf icon2) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ImageService.cs:line 408
at MonoDevelop.Ide.ImageService.GetComposedIcon(System.String[] ids, IconSize size) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ImageService.cs:line 393
at MonoDevelop.Ide.ImageService.InternalGetStockId(Mono.Addins.RuntimeAddin addin, System.String filename, IconSize size) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ImageService.cs:line 426
at MonoDevelop.Ide.ImageService.LoadStockIcon(MonoDevelop.Ide.Extensions.StockIconCodon iconCodon) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ImageService.cs:line 92
at MonoDevelop.Ide.ImageService.m__114(MonoDevelop.Ide.Extensions.StockIconCodon i) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ImageService.cs:line 184
at System.Collections.Generic.List`1[[MonoDevelop.Ide.Extensions.StockIconCodon, MonoDevelop.Ide, Version=2.4.0.0, Culture=neutral, PublicKeyToken=null]].ForEach(System.Action`1 action)
at MonoDevelop.Ide.ImageService.EnsureStockIconIsLoaded(System.String stockId, IconSize size) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ImageService.cs:line 184
at MonoDevelop.Ide.ImageService.m__112(System.String stockId) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ImageService.cs:line 50
at MonoDevelop.Core.IconId.get_Name() in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core/IconId.cs:line 54
at MonoDevelop.Core.IconId.op_Implicit(IconId icon) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core/IconId.cs:line 66
at MonoDevelop.Components.Commands.CommandToolButton.Update(MonoDevelop.Components.Commands.CommandInfo cmdInfo) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandToolButton.cs:line 93
at MonoDevelop.Components.Commands.CommandToolButton.MonoDevelop.Components.Commands.ICommandUserItem.Update(MonoDevelop.Components.Commands.CommandTargetRoute targetRoute) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandToolButton.cs:line 61
at MonoDevelop.Components.Commands.CommandToolButton.OnParentSet(Gtk.Widget parent) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandToolButton.cs:line 53
at Gtk.Widget.parentset_cb(IntPtr widget, IntPtr previous_parent)
at Gtk.Container.gtksharp_container_base_add(IntPtr , IntPtr )
at Gtk.Container.OnAdded(Gtk.Widget widget)
at MonoDevelop.Components.DockToolbars.DockToolbar.OnAdded(Gtk.Widget w) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbar.cs:line 362
at Gtk.Container.added_cb(IntPtr container, IntPtr widget)
at Gtk.Container.gtk_container_add(IntPtr , IntPtr )
at Gtk.Container.Add(Gtk.Widget widget)
at MonoDevelop.Components.Commands.CommandManager.CreateToolbar(System.String id, MonoDevelop.Components.Commands.CommandEntrySet entrySet, System.Object initialTarget) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:line 476
at MonoDevelop.Components.Commands.CommandManager.CreateToolbar(System.String id, MonoDevelop.Components.Commands.CommandEntrySet entrySet) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:line 463
at MonoDevelop.Components.Commands.CommandManager.CreateToolbarSet(System.String addinPath) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:line 126
at MonoDevelop.Ide.Gui.DefaultWorkbench.InitializeWorkspace() in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs:line 269
at MonoDevelop.Ide.Gui.Workbench.Initialize(IProgressMonitor monitor) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:line 78
at MonoDevelop.Ide.IdeApp.Initialize(IProgressMonitor monitor) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs:line 171
at MonoDevelop.Ide.IdeStartup.Run(System.String[] args) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:line 215
at MonoDevelop.Startup.MonoDevelopMain.Main(System.String[] args) in /Users/michael/mono/monodevelop/main/src/core/MonoDevelop.Startup/MonoDevelop.Startup/MonoDevelopMain.cs:line 24
Warn – 19:48:15 – Error creating composed icon gtk-execute___asm0__debug-overlay-22.png__LargeToolbar at size LargeToolbar. Icon __asm0__debug-overlay-22.png__LargeToolbar is 22×22, expected 24×24.
Warn – 19:48:14 – Error creating composed icon gtk-execute___asm0__debug-overlay-22.png__SmallToolbar at size SmallToolbar. Icon __asm0__debug-overlay-22.png__SmallToolbar is 22×22, expected 16×16.

Advertisements
Categories: Development Tags: , , , ,

Creating a sample code snippet runner

May 10, 2010 Leave a comment

This may seem like a strange post but I thought I would share with you how I create code samples and run them. I create classes with the concepts I want to learn and implement IRunnable and my framework lists them in a menu and then you can run the classes. I really quite like this.

Heres the code. Nothing special, I just hope it helps you organise you code when your learning concepts.

Just a note these samples where all developed on Mac OS X Snow Leopard using the latest mono and mondevelop bits.

using System;
using System.Collections.Generic;
using System.Reflection;
using System.Linq;

namespace CSharpInDepth
{

	public interface IRunnable{
		void RunExamples();
	}

	public class InvalidSelectionException : Exception{
	
	}

	public class MenuGenerator{
	
		private string typeNameToExecute;
		private IEnumerable<string> cachedTypes;
		private RunnerableTypeNameGenerator generator;
		
		public MenuGenerator ()
		{
			generator = new RunnerableTypeNameGenerator();
			cachedTypes = new List<string>();
		}
	
		public void GenerateMenu()
		{
			
			cachedTypes = generator.GetTypes ();
			
			Console.WriteLine("Enter the number of the type you want to run.");
			
			if (cachedTypes != null && cachedTypes.Any ()) {
				int counter = 0;
				foreach (string type in cachedTypes){
					Console.WriteLine("{0}. {1}",++counter,type);
				}
			}
		}
		
		public void AcceptSelection(int selection){
			if(selection < 0)
				throw new InvalidSelectionException();
			
			typeNameToExecute = cachedTypes.ElementAt(selection - 1); 
			
		}
		
		public void Execute(){
			var instance = Activator.CreateInstance(Assembly.GetExecutingAssembly().GetName().FullName, typeNameToExecute);
			var runnerableType = (IRunnable)(instance.Unwrap());
			runnerableType.RunExamples();
		}
	}
	
	public class RunnerableTypeNameGenerator{
		public IEnumerable<string> GetTypes(){
			return Assembly.GetExecutingAssembly()
				    .GetTypes()
				    .Where(x => x.GetInterfaces().Any(y => y.Name.Equals("IRunnable")))
				    .Select(x => x.FullName);
		}
	}

	class MainClass
	{
		public static void Main (string[] args)
		{
			MenuGenerator generator = new MenuGenerator();
			generator.GenerateMenu();
			int selection = Convert.ToInt32(Console.ReadLine());
			Console.WriteLine("You selection was: " + selection);
			generator.AcceptSelection(selection);
			generator.Execute();
			Console.ReadKey();
		}
	}
}


Blair…