agoeb
agoeb

Reputation: 269

How to specify an addin depencendy in MonoDevelop for older versions?

I am using MonoDevelop's AddinMaker addin to create an addin, which I would like to run not only on the version that I use to develop the plugin (5.9.2), but also on older versions (>= 5.0).

So far I found three points where dependencies to other addins are defined:

In AddinInfo.cs:

[assembly: AddinDependency("::MonoDevelop.Core", MonoDevelop.BuildInfo.CompatVersion)]
[assembly: AddinDependency("::MonoDevelop.DesignerSupport", MonoDevelop.BuildInfo.CompatVersion)]
[assembly: AddinDependency("::MonoDevelop.Ide", MonoDevelop.BuildInfo.CompatVersion)]
[assembly: AddinDependency("::MonoDevelop.SourceEditor2", MonoDevelop.BuildInfo.CompatVersion)]

In Manifest.addin.xml:

<Dependencies>
 <Addin id="::MonoDevelop.Core" version="5.0" />
 <Addin id="::MonoDevelop.DesignerSupport" version="5.0" />
 <Addin id="::MonoDevelop.Ide" version="5.0" />
 <Addin id="::MonoDevelop.SourceEditor2" version="5.0" />
</Dependencies>

Then there also are the "Addin References" added via the Project Pad UI, which do not seem to support setting a target version at all.

Whenever I package the plugin using mdtool pack MyPlugin.dll, a package is created, which contains duplicate lines in its auto-generated addin.info file:

<Dependencies>
  <Addin id="::MonoDevelop.Core" version="5.9.2" />
  <Addin id="::MonoDevelop.Ide" version="5.9.2" />
  <Addin id="::MonoDevelop.SourceEditor2" version="5.9.2" />
  <Addin id="::MonoDevelop.DesignerSupport" version="5.9.2" />
  <Addin id="::MonoDevelop.DesignerSupport" version="5.0" />
  <Addin id="::MonoDevelop.Ide" version="5.0" />
  <Addin id="::MonoDevelop.SourceEditor2" version="5.0" />
  <Addin id="::MonoDevelop.Core" version="5.0" />
</Dependencies>

I suspect the entries containing "5.0" as a version originate from my settings in the files mentioned above (AddinInfo.cs seems to be sufficient), and the "5.9.2" entries seem to originate from somewhere else. Is there a way to get rid of those? All the APIs I rely on are already there in 5.0.

Upvotes: 2

Views: 189

Answers (1)

Archiman
Archiman

Reputation: 1080

I had an exchange in the Xamarin forum, the answer was if you want to make your add-in compatible with Xamarin Studio 5.0 you need to build your add-in on that version. See: https://forums.xamarin.com/discussion/comment/170110#Comment_170110

Upvotes: 1

Related Questions