6

I am using the MonoDevelop.AddinMaker to develop a language binding Addin that includes Project and Source templates. When debugging this addin within Xamarin Studio, I am receiving the following error that the template file(s) were not found:

Loaded assembly: /Users/administrator/Documents/Code/playscript/playscriptredux/PlayScript.Addin/PlayScript.Addin/bin/Debug/PlayScript.Addin.dll
ERROR [2015-11-08 10:15:10Z]: Error loading template id PlayScriptConsoleProject in addin PlayScript.Addin.PlayScript.Addin:
System.ApplicationException: Template PsConsoleProject.xpt.xml not found
   at MonoDevelop.Ide.Codons.ProjectTemplateCodon.GetTemplate () in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/ProjectTemplateCodon.cs:line 56
   at MonoDevelop.Ide.Templates.ProjectTemplate..ctor (Mono.Addins.RuntimeAddin addin, System.String id, MonoDevelop.Ide.Codons.ProjectTemplateCodon codon, System.String overrideLanguage) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectTemplate.cs:line 193
   at MonoDevelop.Ide.Templates.ProjectTemplate.OnExtensionChanged (System.Object s, Mono.Addins.ExtensionNodeEventArgs args) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectTemplate.cs:line 412
ERROR [2015-11-08 10:15:10Z]: Error loading template id PlayScriptEmptyProject in addin PlayScript.Addin.PlayScript.Addin:
System.ApplicationException: Template PsEmptyProject.xpt.xml not found
   at MonoDevelop.Ide.Codons.ProjectTemplateCodon.GetTemplate () in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/ProjectTemplateCodon.cs:line 56
   at MonoDevelop.Ide.Templates.ProjectTemplate..ctor (Mono.Addins.RuntimeAddin addin, System.String id, MonoDevelop.Ide.Codons.ProjectTemplateCodon codon, System.String overrideLanguage) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectTemplate.cs:line 193
   at MonoDevelop.Ide.Templates.ProjectTemplate.OnExtensionChanged (System.Object s, Mono.Addins.ExtensionNodeEventArgs args) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectTemplate.cs:line 412

My Manifest.addin.xml contains:

<Extension path="/MonoDevelop/Ide/ProjectTemplates">
    <ProjectTemplate id="PlayScriptConsoleProject" resource="PsConsoleProject.xpt.xml" />
    <ProjectTemplate id="PlayScriptEmptyProject" resource="PsEmptyProject.xpt.xml" />
</Extension>

When this Addin is installed the template directory would normally be found within:

~/Library/Application Support/XamarinStudio-5.0/LocalInstall/Addins/PlayScript.Addin

When debugging via XS & MonoDevelop.AddinMaker the template directory would be within the project's bin/Debug output directory.

  • Where is MonoDevelop searching for these files?
  • Where should these template files (*.xpt.xml) be located at in order to debug the Addin?
SushiHangover
  • 73,120
  • 10
  • 106
  • 165
  • The .addin.xml file looks OK if the .xpt.xml files are embedded resources in your assembly. I am not sure why you are talking about a template directory. If you want the template files not to be embedded you can use the `file` attribute instead of the `resource` attribute. – Matt Ward Nov 09 '15 at 10:13
  • 1
    Thanks for the reply. The embedded resources are not working for templates (maybe a AddinMaker problem(?)),, SyntaxFiles, Icons, etc.. are working as embedded resources, but not templates... I switched them to `file="Templates/PsConsoleProject.xpt.xml"` and flagged the files as `Build Action=AddinFile` and now they are being loaded & parsed. If I could figure out the mpack issue of `ICSharpCode.SharpZipLib.Zip.ZipException: Version required to extract this entry not supported` I just might have a working Addin for PlayScript... :-/ Thanks again – SushiHangover Nov 09 '15 at 13:33
  • I would guess it is not an AddinMaker bug. The C# binding in MonoDevelop has project templates which are resources. You just need to make sure the resource id (LogicalName in the .csproj) matches the resource in the .addin.xml file. Probably not worth looking at if you have it working with the files being copied. – Matt Ward Nov 10 '15 at 19:42

0 Answers0