[MonoDevelop] StartupHandler

Lluis Sanchez Gual slluis.devel at gmail.com
Thu Jan 20 04:20:47 EST 2011


Hi,

In the test addin you attached, the extension attribute should be like
this:

[Extension(Path="/MonoDevelop/Ide/StartupHandlers", NodeName="Class")]

The Type parameter you had is not required, and can't be used in this
context. That parameter can be used to specify which type extension
point is being extended, but in this case the extension point is
specified using a path, not a base class. I'll add a check for this in
Mono.Addins and show a better error message.

Also, the NodeName parameter is required here because the
StartupHandlers expect extension nodes to have this name, while by
default the [Extension] attribute generates nodes with the name "Type"
instead.

All this may look a bit awkward, but that extension point was created in
a early version of Mono.Addins, which was mainly oriented on add-ins
described using xml manifests instead of attributes.

Finally, make sure that the version of the dependency you specify
matches the version you have. For example, if you are using MonoDevelop
from github, the dependency should be "MonoDevelop.Ide","2.6"

Lluis.

El dc 19 de 01 de 2011 a les 16:20 -0800, en/na Steven Schermerhorn va
escriure:
> 
> That does seem to have done the trick either.  To help make this easier, I created a play extension and attached it. If you drop this into ~/main/src/addins and add it to Main.sln it should be pretty easy to see that it isn't working.
> 
> I seem to get erratic messaging too. For example, sometimes it'll tell me there is an error and other times it just does nothing.
> 
> -Steven
> 
> On Jan 19, 2011, at 3:21 AM, Lluis Sanchez Gual wrote:
> 
> > Hi,
> > 
> > You need to declare a dependency to the MonoDevelop.Ide addin:
> > 
> > [assembly:AddinDependency ("MonoDevelop.Ide", "2.4"]
> > 
> > Lluis
> > 
> > El dt 18 de 01 de 2011 a les 22:11 -0800, en/na Steven Schermerhorn va
> > escriure:
> >> I am trying to create an Addin that runs at startup and am having some
> >> problems.
> >> 
> >> 
> >> I set breakpoints in each of the methods below, however they don't get
> >> hit however my extension does appear in the Addins dialog as being
> >> installed and enabled.
> >> 
> >> 
> >> Here is my extension:
> >> 
> >> 
> >> [assembly: Addin("MyTestExtension")]
> >> namespace MyTestExtension
> >> {
> >> [Extension("/MonoDevelop/Ide/StartupHandlers")]
> >> class MyTest : CommandHandler
> >> {
> >> 
> >> public MyTest()
> >> {
> >> System.Console.WriteLine("MyTest creatd!");
> >> }
> >> 
> >> protected override void Run ()
> >> {
> >> System.Console.WriteLine("MyTest ran!!");
> >> System.Diagnostics.Debugger.Break();
> >> int i = 0;
> >> i += 3;
> >> 
> >> base.Run ();
> >> }
> >> 
> >> protected override void Run (object state)
> >> {
> >> int i = 0;
> >> i += 3;
> >> }
> >> }
> >> }
> >> 
> >> 
> >> I also tried using a config file rather than attributes, however get
> >> the same result:
> >> 
> >> 
> >> <Addin id="MyTestExtension"
> >>  namespace="MonoDevelop"
> >>  name="MyTestExtension"
> >>  author="Steven Schermerhorn"
> >>  copyright="MIT X11"
> >>  url="http://sample.com"
> >>  description="MyTestExtension"
> >>  category="IDE extensions"
> >>  version="2.6">
> >> 
> >> <Extension path = "/MonoDevelop/Ide/StartupHandlers">
> >> <Class class="MyTestExtension.MyTest" />
> >> </Extension>
> >> </Addin>
> >> 
> >> 
> >> I am running this against the latest monodevelop. I have attempted
> >> using my own build of Mono.Addins so that I can step through what is
> >> going on but haven't gotten that far yet.
> >> 
> >> 
> >> Can anyone see anything obviously wrong?
> >> 
> >> 
> >> -Steven
> >> 
> >> 
> >> _______________________________________________
> >> Monodevelop-list mailing list
> >> Monodevelop-list at lists.ximian.com
> >> http://lists.ximian.com/mailman/listinfo/monodevelop-list
> > 
> > 
> 




More information about the Monodevelop-list mailing list